/* Responsive Design for Gem Trease Pharma */

/* Default Menu Toggle (Hidden on Desktop) */
.menu-toggle {
    display: none;
}

/* Tablet & Mobile (Max 992px) */
@media (max-width: 992px) {

    /* Mobile Menu Toggle Button */
    .menu-toggle {
        display: block !important;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--primary);
        order: 1;
        /* Place it first (left) */
        margin-right: 15px;
    }

    /* Mobile Navigation Drawer */
    .nav-links {
        display: flex !important;
        position: fixed;
        top: 0;
        left: -100%;
        /* Hidden by default */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-light);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        /* Above overlay */
        gap: 25px;
    }

    /* Dark Mode Drawer Background */
    [data-theme="dark"] .nav-links {
        background: #001A0E;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    /* Mobile Menu Header */
    .nav-links::before {
        content: "Menu";
        display: block;
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary);
        margin-bottom: 20px;
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding-bottom: 15px;
    }

    [data-theme="dark"] .nav-links::before {
        color: #D1FFBD;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Active State for Drawer */
    .nav-links.active {
        left: 0;
    }

    /* Overlay when menu is open */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        backdrop-filter: blur(2px);
    }

    .menu-overlay.active {
        display: block;
    }

    /* Flex Order for Header Items on Mobile */
    nav {
        height: 58px !important;
        padding: 0 !important;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .logo {
        order: 2;
        /* Logo in middle */
        margin-right: auto;
    }

    .nav-actions {
        order: 3;
        /* Actions on right */
        gap: 15px !important;
    }

    /* Container padding */
    .container {
        padding: 0 15px !important;
    }

    /* Hero adjustments */
    .hero {
        min-height: auto !important;
        padding: 60px 0 32px !important;
        text-align: center;
    }

    .hero .container {
        flex-direction: column !important;
        gap: 40px !important;
    }

    .hero-content {
        order: 2;
        width: 100% !important;
    }

    .hero-image {
        width: 250px !important;
        margin: 0 auto !important;
        transform: none !important;
    }

    .hero-btns {
        justify-content: center;
    }

    /* Grid Layouts to Single Column */
    .shop-layout,
    .product-layout,
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    /* Product Page Specifics */
    .product-page {
        padding-top: 100px !important;
    }

    .main-img-box {
        height: 250px !important;
        /* Smaller height for better mobile view */
    }

    .buy-actions {
        grid-template-columns: 1fr !important;
    }
}

/* --- Mobile phones (Max 768px) --- */
@media (max-width: 768px) {

    /* Header & Logo */
    .logo {
        font-size: 1.2rem !important;
    }

    .logo img {
        height: 40px !important;
    }

    .logo small {
        display: none !important;
        /* Hide tagline on mobile to save space */
    }

    /* Hide text in "Return to Shop" button */
    .btn-text {
        display: none !important;
    }

    .nav-actions .btn {
        padding: 8px 10px !important;
        /* Smaller icon button */
    }

    /* Products Grid - 1 Column */
    .products-grid,
    .categories-grid,
    .top-selling-grid {
        grid-template-columns: 1fr !important;
    }

    .category-card {
        height: 120px !important;
    }

    /* Typography */
    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.8rem !important;
    }

    .product-meta h1 {
        font-size: 1.8rem !important;
    }

    /* Footer */
    .footer-links ul {
        text-align: center;
    }

    .footer-brand,
    .footer-links h5 {
        text-align: center;
    }

    .trust-info {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .trust-item {
        justify-content: center;
    }

    /* Newsletter Mobile Fix */
    .newsletter {
        padding: 60px 20px !important;
        border-radius: 30px !important;
        text-align: center !important;
    }

    .subscribe-form {
        flex-direction: column !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.05) !important;
        padding: 10px !important;
        gap: 12px !important;
        border-radius: 25px !important;
        border: 1px solid rgba(210, 248, 172, 0.2) !important;
    }

    .subscribe-form input {
        width: 100% !important;
        height: 50px !important;
        background: transparent !important;
        border-radius: 0 !important;
        text-align: center !important;
        font-size: 1rem !important;
    }

    .subscribe-form button {
        width: 100% !important;
        height: 55px !important;
        border-radius: 20px !important;
        font-size: 1.1rem !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Modal Mobile Fix */
    .payment-modal .modal-content {
        max-height: 85vh !important;
        padding: 20px !important;
        overflow-y: auto !important;
    }
}

/* --- Very Small Screens (Galaxy Fold, etc.) --- */
@media (max-width: 400px) {
    .logo div {
        display: none !important;
        /* Hide name completely, show only logo icon */
    }

    .logo img {
        height: 45px !important;
    }

    .nav-actions {
        gap: 10px !important;
    }
}