/* =====================================================
   CYKĀH — Mobile overrides · Daily Paper design
   ===================================================== */

/* =====================================================
   TOUCH PERFORMANCE
   ===================================================== */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 768px) {
    * { -webkit-overflow-scrolling: touch; }

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

    img { max-width: 100%; height: auto; }
}

/* =====================================================
   NAVIGATION MOBILE
   ===================================================== */
@media (max-width: 768px) {
    nav {
        padding: 0 16px !important;
    }

    .nav-links        { display: none !important; }
    .gender-tabs-desktop { display: none !important; }
    .user-menu-desktop   { display: none !important; }

    .mobile-menu-btn {
        display: block !important;
    }
}

/* =====================================================
   HERO MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .hero-sm {
        min-height: 260px !important;
        padding: 2rem 16px !important;
        align-items: flex-end;
    }

    .hero-content h1 {
        font-size: clamp(1.75rem, 9vw, 2.5rem) !important;
    }

    .hero-content p {
        font-size: 0.7rem !important;
    }
}

/* =====================================================
   PRODUCT SECTIONS MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .products-section {
        padding: 1.5rem 12px !important;
    }

    .section-header h2 {
        font-size: 0.8rem !important;
    }

    /* 2-column grid on mobile */
    .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .product-info {
        padding: 0.625rem 0 0.875rem !important;
    }

    .product-name {
        font-size: 0.65rem !important;
    }

    .product-price {
        font-size: 0.7rem !important;
    }

    .add-to-cart-btn {
        font-size: 0.575rem !important;
        padding: 9px !important;
    }
}

/* =====================================================
   UTILITY SECTION MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .utility-section {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .util-box {
        padding: 1.75rem 16px !important;
        border-right: none !important;
        border-bottom: 1px solid var(--line) !important;
    }

    .util-box:last-child {
        border-bottom: none !important;
    }
}

/* =====================================================
   CART SIDEBAR MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }

    .cart-item-img {
        width: 60px !important;
        height: 75px !important;
        flex-shrink: 0 !important;
    }
}

/* =====================================================
   SEARCH MODAL MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .search-modal {
        padding: 1rem !important;
        align-items: flex-start !important;
        padding-top: calc(var(--header-total) + 2rem) !important;
    }

    .search-input {
        font-size: 1.25rem !important;
    }

    .close-search {
        top: calc(var(--header-total) + 0.75rem) !important;
        right: 1rem !important;
    }
}

/* =====================================================
   MOBILE MENU SIDEBAR
   ===================================================== */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85%;
    background: var(--bg);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    border-right: 1px solid var(--line);
}

.mobile-menu-sidebar.active {
    transform: translateX(0);
}

.mobile-menu-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mobile-menu-nav {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--fg);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s;
}

.mobile-menu-link:hover {
    background: var(--subtle);
}

.close-mobile-menu {
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
}

/* Gender tabs in mobile menu */
.gender-tab-btn {
    flex: 1;
    padding: 0.875rem 1rem;
    background: transparent;
    color: var(--muted);
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
}

.gender-tab-btn.active {
    color: var(--fg);
    border-bottom-color: var(--fg);
}

/* =====================================================
   ACCOUNT MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .account-container {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .account-nav {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 80%;
        background: var(--bg) !important;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        border-right: 1px solid var(--line) !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-top: none !important;
        border-bottom: none !important;
        padding: 1.5rem 1rem !important;
        box-shadow: none !important;
    }

    .account-nav.active {
        transform: translateX(0);
    }

    .account-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .nav-link {
        display: flex !important;
        align-items: center;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
        color: var(--fg) !important;
        text-decoration: none;
        font-size: 0.7rem !important;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        border-bottom: 1px solid var(--line);
        background: transparent !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        transition: background 0.15s;
    }

    .nav-link:hover {
        background: var(--subtle) !important;
        transform: none !important;
    }

    .nav-link.active {
        background: var(--fg) !important;
        color: var(--bg) !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .addresses-grid {
        grid-template-columns: 1fr !important;
    }

    .address-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .address-actions button {
        width: 100% !important;
    }
}

/* =====================================================
   CHECKOUT MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .checkout-header {
        padding: 2rem 1rem !important;
    }

    .checkout-header h1 {
        font-size: clamp(1.25rem, 6vw, 1.75rem) !important;
    }

    #checkoutForm {
        grid-template-columns: 1fr !important;
        padding: 0 1rem !important;
        gap: 1.5rem !important;
    }

    #orderSummary {
        position: static !important;
        width: 100% !important;
    }

    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* =====================================================
   PRODUCT DETAIL MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .product-detail-container {
        grid-template-columns: 1fr !important;
        padding: 1rem !important;
        gap: 1.5rem !important;
    }

    .main-image {
        height: 300px !important;
    }

    .thumbnail-images {
        gap: 0.5rem !important;
        margin-top: 0.75rem !important;
    }

    .thumbnail {
        width: 56px !important;
        height: 56px !important;
    }

    .variant-options {
        gap: 0.5rem !important;
    }

    .quantity-btn {
        width: 44px !important;
        height: 44px !important;
    }

    .quantity-input {
        width: 60px !important;
        height: 44px !important;
    }
}

/* =====================================================
   FOOTER MOBILE
   ===================================================== */
.footer-mobile { display: none; }

@media (max-width: 992px) {
    footer {
        padding: 2.5rem 1rem 3rem !important;
    }

    .footer-desktop { display: none !important; }
    .footer-mobile  { display: block !important; }
}

/* =====================================================
   PRODUCTS / CATEGORIES PAGES
   ===================================================== */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0 !important;
    }

    .products-header h1 {
        font-size: clamp(1.25rem, 6vw, 1.75rem) !important;
    }

    #productSearch {
        min-width: 100% !important;
    }

    #categoryFilter,
    #sortFilter {
        width: 100% !important;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =====================================================
   LEGAL PAGES
   ===================================================== */
@media (max-width: 768px) {
    section h1 { font-size: clamp(1.25rem, 6vw, 2rem) !important; }
    section h2 { font-size: clamp(1rem, 4vw, 1.25rem) !important; }
    section h3 { font-size: clamp(0.9rem, 3.5vw, 1.1rem) !important; }
    section p  { font-size: 0.875rem !important; line-height: 1.65 !important; }
    section li { font-size: 0.875rem !important; }
}

/* =====================================================
   TOUCH TARGETS
   ===================================================== */
@media (max-width: 768px) {
    button, [role="button"], input, select, textarea {
        min-height: 44px;
    }

    .add-to-cart-btn,
    .btn-primary,
    .btn-secondary,
    .btn-checkout,
    .btn-view-cart {
        min-height: 44px !important;
    }
}
