/* ══════════════════════════════════════════════════════════════════
   ADAM SHOES - Responsive Breakpoints
   Mobile First: 480px → 768px → 1024px → 1280px
   ══════════════════════════════════════════════════════════════════ */

/* ── Max 1280px (Wide Desktop) ─────────────────────────────────── */
@media (max-width: 1280px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

/* ── Max 1024px (Tablet Landscape) ─────────────────────────────── */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: var(--space-4);
    }

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

    .hero h1, .hero-title {
        font-size: var(--text-4xl);
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

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

/* ── Max 768px (Tablet Portrait) ───────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-container {
        padding: 0 var(--space-4);
    }

    .header-logo img {
        height: 34px;
    }

    .hero, .hero-banner {
        min-height: 380px;
    }

    .hero h1, .hero-title {
        font-size: var(--text-3xl);
    }

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

    .hero-content {
        padding: var(--space-10) var(--space-4);
    }

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

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

    .section, .home-section {
        padding: var(--space-8) 0;
    }

    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .trust-item {
        justify-content: flex-start;
    }

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

    .container {
        padding: 0 var(--space-4);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .product-card-info {
        padding: var(--space-3);
    }

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

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

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

    .category-card {
        padding: var(--space-6) var(--space-3);
    }

    .brands-strip {
        gap: var(--space-6);
    }

    .brand-logo img {
        height: 30px;
    }

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

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }

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

    .toast-container {
        inset-inline: var(--space-3);
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    .confirm-dialog {
        padding: var(--space-6);
    }

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

    .product-card-wishlist {
        opacity: 1;
    }

    .breadcrumb {
        font-size: var(--text-xs);
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ── Max 480px (Mobile) ────────────────────────────────────────── */
@media (max-width: 480px) {
    .hero h1, .hero-title {
        font-size: var(--text-2xl);
    }

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

    .hero-badge {
        font-size: var(--text-xs);
    }

    .trust-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .trust-icon {
        width: 40px;
        height: 40px;
    }

    .trust-icon svg {
        width: 20px;
        height: 20px;
    }

    .trust-text strong {
        font-size: var(--text-xs);
    }

    .trust-text span {
        font-size: 10px;
    }

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

    .newsletter-box {
        padding: var(--space-6) var(--space-4);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

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

    .product-card {
        border-radius: var(--radius-md);
    }

    .product-card-info {
        padding: var(--space-2) var(--space-3);
    }

    .product-card-brand {
        font-size: 10px;
    }

    .product-card-name {
        font-size: var(--text-xs);
        -webkit-line-clamp: 1;
    }

    .price-current {
        font-size: var(--text-sm);
    }

    .price-original {
        font-size: var(--text-xs);
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .category-card {
        padding: var(--space-4) var(--space-2);
    }

    .category-card-icon {
        width: 48px;
        height: 48px;
    }

    .category-card h3 {
        font-size: var(--text-sm);
    }

    .announcement-bar {
        font-size: var(--text-xs);
        padding: var(--space-1) var(--space-2);
    }

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

    .header-icon-btn {
        width: 36px;
        height: 36px;
    }

    .header-icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .mobile-menu {
        width: 85vw;
    }
}

/* ══════════════════════════════════════════════════════════════
   Modern mobile improvements (added 2026)
   ══════════════════════════════════════════════════════════════ */

/* All phones */
@media (max-width: 640px) {
    /* Header — bigger logo, hide nav (mobile menu instead).
       Header stays at 70px; logo grows up to 60px (5px breathing
       room on each side). object-fit: contain prevents distortion. */
    :root { --header-height: 70px; }
    .header-logo img {
        height: 60px !important;
        max-height: 60px !important;
        width: auto;
        object-fit: contain;
        border-radius: 16px;
    }
    .header-actions { gap: 4px; }
    .header-icon-btn { padding: 8px; }

    /* Hero — clean stacking, smaller logo, tighter padding */
    .hero-banner { min-height: 320px; }
    .hero-inner { padding: var(--space-6) var(--space-4) var(--space-4); gap: var(--space-3); }
    .hero-logo { max-width: 280px !important; height: auto; }
    .hero-title { font-size: 1.6rem !important; line-height: 1.15 !important; }
    .hero-subtitle { font-size: var(--text-sm) !important; line-height: 1.5; }
    .hero-cta { padding: 12px 22px !important; font-size: 14px !important; }
    .hero-image { max-width: 200px !important; }

    /* SALE banner */
    .sale-banner-wrap { padding: var(--space-4) var(--space-3) 0; }
    .sale-banner { border-radius: 16px; }
    .sale-banner-inner { padding: var(--space-5) var(--space-4); }
    .sale-banner-title { font-size: 1.3rem !important; }
    .sale-banner-subtitle { font-size: 0.875rem; }
    .sale-banner-cta { padding: 10px 20px !important; font-size: 13px; }

    /* Sections — tighter padding */
    .home-section { padding: var(--space-8) 0 !important; }
    .section-title { font-size: 1.4rem; }
    .container { padding: 0 var(--space-3); }

    /* Products grid — 2 cols on phone */
    .products-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: var(--space-3) !important;
    }
    .product-card-name { font-size: 13px; line-height: 1.3; }
    .product-card-brand { font-size: 11px; }
    .product-card-info { padding: var(--space-3) !important; }
    .price-current { font-size: 14px; }
    .price-original { font-size: 12px; }

    /* Categories — 2 cols */
    .categories-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: var(--space-3) !important;
    }
    .category-card { padding: var(--space-5) var(--space-3); }
    .category-name { font-size: 13px; }

    /* Brands strip — horizontal scroll on mobile */
    .brands-strip {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: var(--space-2);
    }
    .brand-item {
        flex-shrink: 0; min-width: 120px;
        scroll-snap-align: start;
    }
    .brand-item img { height: 38px; }
    .brand-name { font-size: 12px; }

    /* Trust badges — 2 cols on phone */
    .trust-grid { grid-template-columns: 1fr 1fr !important; gap: var(--space-3); }
    .trust-item { gap: var(--space-2); }
    .trust-text strong { font-size: 13px; }
    .trust-text span { font-size: 11px; }
    .trust-icon svg { width: 22px; height: 22px; }

    /* Testimonials — swipeable horizontal carousel (peek next card) */
    .testimonials-grid {
        display: flex !important;
        grid-template-columns: none !important;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--space-4);
        gap: var(--space-3);
        padding: 4px var(--space-4) var(--space-4);
        margin: 0 calc(var(--space-4) * -1);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .testimonials-grid::-webkit-scrollbar { display: none; }
    .testimonial-card {
        flex: 0 0 72%;
        max-width: 72%;
        scroll-snap-align: center;
        display: block !important;
    }
    .testimonial-card:nth-child(n) { display: block !important; }

    /* Follow Us — single column on phone */
    .social-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-2);
    }
    .social-card { padding: var(--space-3); }
    .social-icon { width: 40px !important; height: 40px !important; }

    /* Contact section — single column */
    .contact-home-card {
        grid-template-columns: 1fr !important;
        gap: var(--space-5) !important;
        padding: var(--space-5) !important;
    }

    /* Footer — logo on its own row, 3 link cols below */
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: var(--space-5) var(--space-3);
    }
    .footer-col:first-child {
        grid-column: 1 / -1;
        text-align: center;
        padding-bottom: var(--space-5);
        margin-bottom: var(--space-2);
        border-bottom: 1px solid var(--border);
    }
    .footer-col:first-child img {
        height: 64px !important;
        margin: 0 auto 10px !important;
    }
    .footer-col:first-child p {
        max-width: 340px;
        margin: 0 auto var(--space-3);
        font-size: 12.5px;
    }
    .footer-col h3 { font-size: 13px; margin-bottom: var(--space-3); }
    .footer-col a { font-size: 12.5px; padding: 4px 0; }
    .footer-social { justify-content: center; }
    .footer-social a { width: 36px; height: 36px; }
    .footer-bottom { padding: var(--space-4) 0; }

    /* Auth forms */
    .auth-card { padding: var(--space-6) var(--space-4); }
    .auth-title { font-size: 1.5rem; }
    .form-row { grid-template-columns: 1fr !important; }

    /* Buttons should be tappable (44px target per Apple HIG) */
    .btn { min-height: 42px; padding: 10px 18px; }
    .btn-lg { min-height: 48px; padding: 12px 22px; font-size: 15px; }

    /* Cart */
    .cart-grid { grid-template-columns: 1fr !important; gap: var(--space-4); }
    .cart-item { flex-direction: row !important; gap: var(--space-3); }
    /* cart-item sizing handled in cart.html (class is cart-item-image) */
    .cart-summary { position: static !important; }

    /* Profile */
    .profile-hero { padding: var(--space-5) var(--space-4) !important; flex-direction: column; align-items: stretch; gap: var(--space-3); }
    .profile-hero-left { width: 100%; }
    .profile-layout { grid-template-columns: 1fr !important; gap: var(--space-4); }
    .profile-card, .profile-side-card { padding: var(--space-4) !important; }
}

/* Tiny phones (≤380px) */
@media (max-width: 380px) {
    .hero-title { font-size: 1.3rem !important; }
    .header-logo img { height: 52px !important; max-height: 52px !important; }
    /* Carousel cards a touch wider on tiny phones for legibility */
    .testimonial-card { flex: 0 0 78% !important; max-width: 78% !important; }
    /* Footer keep 3-col link row but tighten gaps; logo row already spans full width */
    .footer-grid { gap: var(--space-4) var(--space-2) !important; }
    .footer-col h3 { font-size: 12px; }
    .footer-col a { font-size: 12px; }
    .container { padding: 0 var(--space-2); }
}

/* Admin panel mobile fixes */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(100%);  /* RTL hidden right */
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-right: 0 !important; }
    .admin-mobile-toggle { display: flex !important; }
    .admin-content { padding: 16px !important; }
    .admin-header-title { font-size: 1rem; }

    /* Admin cards full width */
    .pf-layout, .od-layout { grid-template-columns: 1fr !important; }
    .pf-sidebar, .od-sidebar { position: static !important; }
    .cust-grid { grid-template-columns: 1fr !important; }

    /* Admin tables horizontal scroll */
    .admin-table-wrap, .pf-variants, .cust-table, .q-table {
        display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
}

/* ── Print ─────────────────────────────────────────────────────── */
@media print {
    .site-header,
    .announcement-bar,
    .site-footer,
    .toast-container,
    .confirm-overlay,
    .search-overlay,
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }

    .main-content {
        min-height: auto;
    }

    body {
        background: white;
        color: black;
    }
}
