/* ========================================
   RESPONSIVE UTILITIES - Tối ưu tất cả thiết bị
   ======================================== */

/* ========================================
   1. RESPONSIVE BREAKPOINTS
   ======================================== */
:root {
    /* Breakpoints */
    --mobile-sm: 320px;
    --mobile: 480px;
    --tablet: 768px;
    --laptop: 1024px;
    --desktop: 1280px;
    --desktop-xl: 1440px;

    /* Spacing system */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Touch-friendly sizes */
    --touch-target: 44px;
    --touch-target-lg: 56px;
}

/* ========================================
   2. MOBILE MENU STYLES
   ======================================== */

/* Mobile menu button */
.mobile-menu-btn {
    /* display: none; - Moved to site.css media query */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    position: relative;
}

.mobile-menu-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Hamburger icon */
.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* Active state (X icon) */
.mobile-menu-btn.active .hamburger {
    background: transparent;
}

.mobile-menu-btn.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-btn.active .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.mobile-overlay.active {
    opacity: 1;
}

/* ========================================
   3. RESPONSIVE GRID SYSTEM
   ======================================== */

/* Container với responsive padding */
.container-responsive {
    width: 100%;
    margin: 0 auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

@media (min-width: 768px) {
    .container-responsive {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }
}

@media (min-width: 1280px) {
    .container-responsive {
        max-width: 1280px;
    }
}

/* ========================================
   4. UTILITY CLASSES - Tái sử dụng
   ======================================== */

/* Section padding responsive */
.section-padding {
    padding: var(--spacing-2xl) var(--spacing-md);
}

@media (min-width: 768px) {
    .section-padding {
        padding: var(--spacing-3xl) var(--spacing-lg);
    }
}

@media (min-width: 1280px) {
    .section-padding {
        padding: 80px var(--spacing-xl);
    }
}

/* Badge system */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.badge-hot {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

.badge-featured {
    background: linear-gradient(135deg, #f6ad55 0%, #dd6b20 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(246, 173, 85, 0.4);
}

.badge-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

/* Card system */
.card-base {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-base:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Grid responsive */
.grid-responsive {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (min-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
}

/* ========================================
   5. TOUCH-FRIENDLY ELEMENTS
   ======================================== */

/* Minimum touch target */
.touch-target {
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.touch-target-lg {
    min-width: var(--touch-target-lg);
    min-height: var(--touch-target-lg);
}

/* Remove tap highlight on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth touch scrolling */
.scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* ========================================
   6. TYPOGRAPHY RESPONSIVE
   ======================================== */

.heading-xl {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .heading-xl {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) {
    .heading-xl {
        font-size: 3.5rem;
    }
}

.heading-lg {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .heading-lg {
        font-size: 2.5rem;
    }
}

.heading-md {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .heading-md {
        font-size: 1.75rem;
    }
}

.text-responsive {
    font-size: 0.95rem;
    line-height: 1.7;
}

@media (min-width: 768px) {
    .text-responsive {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    .text-responsive {
        font-size: 1.1rem;
    }
}

/* ========================================
   7. VISIBILITY HELPERS
   ======================================== */

/* Hide on mobile */
.hide-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hide-mobile {
        display: block;
    }
}

/* Show only on mobile */
.show-mobile {
    display: block;
}

@media (min-width: 768px) {
    .show-mobile {
        display: none;
    }
}

/* Hide on tablet */
@media (max-width: 1023px) {
    .hide-tablet {
        display: none;
    }
}

/* ========================================
   8. RESPONSIVE IMAGES
   ======================================== */

.img-responsive {
    width: 100%;
    height: auto;
    display: block;
}

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ========================================
   9. MOBILE SPECIFIC OPTIMIZATIONS
   ======================================== */

@media (max-width: 767px) {
    /* Reduce motion for performance */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        font-size: 16px !important;
    }

    /* Safe area for notched devices */
    .safe-area-padding {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ========================================
   10. LANDSCAPE MOBILE
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .mobile-menu-btn {
        padding: 4px;
    }

    .nav-links {
        padding-top: 60px;
    }

    .section-padding {
        padding: var(--spacing-lg) var(--spacing-md);
    }
}

/* ========================================
   11. ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--brand-green);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--brand-green);
    color: white;
    padding: 12px 24px;
    font-weight: 600;
    text-decoration: none;
    z-index: 9999;
    border-radius: 0 0 8px 0;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card-base {
        border: 2px solid currentColor;
    }

    .badge {
        border: 1px solid currentColor;
    }
}

/* Dark mode support (future-proof) */
/* Dark mode disabled - keeping light theme always */
/* @media (prefers-color-scheme: dark) {
    :root {
        --text: #ffffff;
        --bg: #1a202c;
        --bg-secondary: #2d3748;
    }
} */

/* ========================================
   12. PRINT STYLES
   ======================================== */

@media print {
    .mobile-menu-btn,
    .mobile-overlay,
    header,
    footer {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: underline;
    }
}
