/**
 * Responsive CSS - Mobile-First Approach
 * Thumba Herbz Website
 *
 * Breakpoints:
 * - Mobile: < 576px (default)
 * - Mobile Large: 576px - 767px
 * - Tablet: 768px - 1023px
 * - Laptop: 1024px - 1199px
 * - Desktop: 1200px+
 */

/* ============================================
   LAPTOP (1024px - 1199px)
   ============================================ */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    /* Products Grid - 3 columns */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Hero Section */
    .hero-section h1 {
        font-size: var(--text-4xl);
    }

    /* Footer - 2 columns */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   TABLET (768px - 1023px)
   ============================================ */
@media (max-width: 1023px) {
    .container {
        max-width: 720px;
    }

    /* Typography Scale Down */
    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
    h3 { font-size: var(--text-2xl); }
    h4 { font-size: var(--text-xl); }

    /* Section Padding */
    .section {
        padding: var(--space-10) 0;
    }

    /* Header - Show mobile menu */
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex !important;
        position: relative;
        z-index: 1001;
    }

    /* Ensure close button (X) is visible when menu is active */
    .mobile-menu-toggle.active {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1001;
        background: var(--color-white);
        padding: var(--space-3);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
    }

    .mobile-menu-toggle.active span {
        background-color: var(--color-dark);
    }

    .main-nav.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: var(--color-white);
        box-shadow: var(--shadow-xl);
        z-index: 1000;
        padding: var(--space-6);
        padding-top: 80px;
        overflow-y: auto;
        animation: slideInLeft 0.3s ease;
    }

    .main-nav.active .nav-menu {
        flex-direction: column;
        gap: 0;
    }

    .main-nav.active .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    .main-nav.active .nav-item a {
        display: block;
        padding: var(--space-4) 0;
        color: var(--color-text);
    }

    .main-nav.active .dropdown-menu {
        position: static;
        box-shadow: none;
        padding-left: var(--space-4);
        display: none;
        background: var(--color-bg-light);
    }

    .main-nav.active .dropdown-menu.active {
        display: block;
    }

    .main-nav.active .dropdown-menu li {
        border-bottom: 1px solid var(--color-border-light);
    }

    .main-nav.active .dropdown-menu li:last-child {
        border-bottom: none;
    }

    .main-nav.active .dropdown-menu a {
        padding: var(--space-3) var(--space-2);
        font-size: var(--text-sm);
    }

    /* Mobile Submenu for Honey */
    .main-nav.active .dropdown-submenu-list {
        position: static;
        box-shadow: none;
        padding-left: var(--space-4);
        display: none;
        background: var(--color-bg-lighter);
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-left: 0;
    }

    .main-nav.active .dropdown-submenu-list.active {
        display: block;
    }

    .main-nav.active .dropdown-submenu-list a {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-sm);
    }

    .main-nav.active .dropdown-submenu > a i {
        transform: rotate(0deg);
    }

    .main-nav.active .dropdown-submenu.active > a i {
        transform: rotate(90deg);
    }

    /* Mobile Menu Overlay */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }

    @keyframes slideInLeft {
        from {
            transform: translateX(-100%);
        }
        to {
            transform: translateX(0);
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    /* Hero Section */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        order: -1;
        max-width: 400px;
        margin: 0 auto;
    }

    /* Products Controls - Responsive */
    .products-controls {
        padding: var(--space-5);
    }

    .category-buttons {
        gap: var(--space-2);
    }

    .category-btn {
        padding: 0.625rem 1rem;
        font-size: 0.813rem;
    }

    .controls-row {
        gap: var(--space-3);
    }

    .search-box {
        min-width: 200px;
    }

    .sort-label {
        font-size: 0.813rem;
    }

    .sort-select {
        padding: 0.625rem 2rem 0.625rem 0.875rem;
        font-size: 0.813rem;
    }

    .view-btn {
        padding: 0.5rem 0.875rem;
    }

    /* Products Grid - 2 columns */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }

    /* Why Choose Us - 2 columns */
    .why-choose-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer - 2 columns */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Cart Page - Stack layout */
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
        margin-top: var(--space-6);
    }

    /* Product Details */
    .product-layout {
        grid-template-columns: 1fr;
    }

    /* Top Bar - Simplify */
    .top-bar-left a span {
        display: none;
    }

    .top-bar-text {
        font-size: var(--text-sm);
    }
}

/* ============================================
   MOBILE LARGE (576px - 767px)
   ============================================ */
@media (max-width: 767px) {
    .container {
        max-width: 100%;
        padding: 0 var(--space-4);
    }

    /* Typography */
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }

    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-5);
        font-size: var(--text-sm);
    }

    .btn-lg {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-base);
    }

    /* Section Padding */
    .section {
        padding: var(--space-8) 0;
    }

    /* Header */
    .logo img {
        height: 60px;
    }

    .logo-text {
        display: none;
    }

    .header-actions {
        gap: var(--space-2);
    }

    .search-toggle {
        display: none;
    }

    /* Top Bar - Hide on mobile */
    .top-bar {
        display: none;
    }

    /* Hero Section */
    .hero-section {
        padding: var(--space-8) 0;
    }

    .hero-section h1 {
        font-size: var(--text-2xl);
    }

    .hero-section .subtitle {
        font-size: var(--text-base);
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--space-3);
    }

    .hero-buttons .btn {
        width: 100%;
    }

    /* Products Grid - 2 columns */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    /* Product Card */
    .product-card {
        padding: var(--space-4);
    }

    .product-name {
        font-size: var(--text-sm);
    }

    .product-price {
        font-size: var(--text-base);
    }

    /* Why Choose Us - 1 column */
    .why-choose-grid {
        grid-template-columns: 1fr;
    }

    /* Footer - 1 column */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .footer-newsletter {
        padding: var(--space-5);
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input {
        width: 100%;
    }

    .newsletter-form button {
        width: 100%;
    }

    /* Cart Table - Card Layout */
    .cart-table {
        display: none;
    }

    .cart-mobile {
        display: block;
    }

    .cart-item-card {
        background: var(--color-white);
        padding: var(--space-4);
        border-radius: var(--radius-lg);
        margin-bottom: var(--space-4);
        box-shadow: var(--shadow-md);
    }

    .cart-item-card .cart-item-image {
        width: 80px;
        height: 80px;
    }

    /* Forms - Full width */
    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        width: 100%;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: var(--text-xs);
        flex-wrap: wrap;
    }

    /* Product Tabs */
    .product-tabs {
        overflow-x: auto;
    }

    .product-tabs button {
        white-space: nowrap;
        font-size: var(--text-sm);
    }

    /* Modal - Full screen */
    .modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    /* Image Gallery */
    .product-gallery-thumbnails {
        justify-content: center;
    }

    /* Testimonial Cards */
    .testimonial-card {
        padding: var(--space-5);
    }

    /* Payment Methods */
    .payment-methods {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ============================================
   MOBILE (< 576px)
   ============================================ */
@media (max-width: 575px) {
    /* Container */
    .container {
        padding: 0 var(--space-3);
    }

    /* Typography */
    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }
    h3 { font-size: var(--text-lg); }
    h4 { font-size: var(--text-base); }

    /* Section Padding */
    .section {
        padding: var(--space-6) 0;
    }

    /* Products Controls - Mobile */
    .products-controls {
        padding: var(--space-4);
    }

    .filter-title {
        font-size: var(--text-base);
    }

    .category-buttons {
        gap: var(--space-2);
    }

    .category-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }

    .category-btn i {
        font-size: 0.875rem;
    }

    .category-count {
        min-width: 20px;
        height: 20px;
        font-size: 0.688rem;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }

    .search-box {
        min-width: 100%;
        width: 100%;
    }

    .search-input {
        padding: 0.75rem 2.5rem 0.75rem 2.5rem;
        font-size: 0.875rem;
    }

    .sort-box {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }

    .sort-label {
        font-size: 0.875rem;
    }

    .sort-select {
        width: 100%;
        padding: 0.75rem 2.5rem 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .view-toggle {
        width: 100%;
        justify-content: center;
    }

    .view-btn {
        flex: 1;
        padding: 0.75rem 1rem;
    }

    .results-info {
        padding: var(--space-2) 0;
    }

    .results-count {
        font-size: 0.813rem;
    }

    /* Hero Section */
    .hero-section h1 {
        font-size: var(--text-xl);
        line-height: 1.3;
    }

    /* Products Grid - 1 column */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Product Card */
    .product-card-actions {
        flex-direction: column;
    }

    .product-card-actions .btn {
        width: 100%;
    }

    /* Cart Summary */
    .cart-summary {
        padding: var(--space-4);
    }

    .cart-actions {
        flex-direction: column;
    }

    .cart-actions .btn {
        width: 100%;
    }

    /* Promo Code */
    .promo-code-form {
        flex-direction: column;
    }

    .promo-code-form input {
        width: 100%;
    }

    .promo-code-form button {
        width: 100%;
    }

    /* Footer Bottom */
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }

    /* Trust Badges */
    .trust-badge {
        font-size: var(--text-xs);
    }

    /* Contact Page */
    .page-header-section {
        padding: var(--space-8) 0 var(--space-6);
    }

    .page-title {
        font-size: var(--text-3xl);
    }

    .page-subtitle {
        font-size: var(--text-lg);
    }

    .contact-form-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .form-intro {
        position: static;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .business-hours-header {
        flex-direction: column;
        text-align: center;
    }

    .social-links-grid {
        grid-template-columns: 1fr;
    }

    .cta-content-wrapper h2 {
        font-size: var(--text-3xl);
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    .cta-features-inline {
        flex-direction: column;
        gap: var(--space-4);
    }

    /* Contact Info Grid */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-info-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    /* About Image Grid */
    .about-images {
        grid-template-columns: 1fr;
    }

    /* Mission Vision Grid */
    .mission-vision-grid {
        grid-template-columns: 1fr;
    }

    /* Values Grid */
    .values-grid {
        grid-template-columns: 1fr;
    }

    /* Process Timeline */
    .process-timeline {
        padding-left: var(--space-4);
    }

    .process-step::before {
        left: -32px;
    }

    /* Related Products */
    .related-products-grid {
        grid-template-columns: 1fr;
    }

    /* Quantity Selector */
    .quantity-selector {
        max-width: 200px;
        width: auto;
    }

    /* Product Meta */
    .product-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Share Buttons */
    .share-buttons {
        flex-wrap: wrap;
    }

    /* Reviews */
    .review-item {
        padding: var(--space-4);
    }

    /* Sitemap Grid */
    .sitemap-grid {
        grid-template-columns: 1fr;
    }

    /* Newsletter Content */
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   LANDSCAPE MODE (Mobile)
   ============================================ */
@media (max-width: 767px) and (orientation: landscape) {
    .hero-section {
        padding: var(--space-6) 0;
    }

    .hero-image {
        max-width: 300px;
    }

    /* Full-width hero responsive */
    .hero-fullwidth {
        min-height: 500px;
    }

    .hero-fullwidth .hero-title {
        font-size: 2rem;
    }

    .hero-fullwidth .hero-subtitle {
        font-size: 1rem;
    }

    .hero-content-centered {
        padding: 2rem 0;
    }

    .main-nav.active {
        width: 240px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .top-bar,
    .main-header,
    .whatsapp-float,
    .back-to-top,
    .mobile-menu-toggle,
    .newsletter-form,
    .footer-social,
    .share-buttons,
    .add-to-cart-btn,
    .cart-btn {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
    }

    a {
        text-decoration: underline;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --color-text: #000000;
        --color-border: #000000;
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .whatsapp-float::before {
        animation: none;
    }

    .hero-image {
        animation: none;
    }
}
