@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    --primary:       #1a3a5c;
    --primary-light: #254d7a;
    --accent:        #e67e22;
    --accent-dark:   #d35400;
    --white:         #ffffff;
    --bg:            #f5f7fa;
    --text:          #2c3e50;
    --text-light:    #637385;
    --text-muted:    #9aabbb;
    --border:        #e2e8f0;
    --card-shadow:   0 4px 20px rgba(0,0,0,0.08);
    --card-hover:    0 8px 32px rgba(0,0,0,0.14);
    --header-h:      60px;
    --radius:        12px;
    --font:          'Poppins', sans-serif;
    --font-ar:       'Tajawal', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ===== CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== HEADER ===== */
.site-header {
    background: white;
    height: var(--header-h);
    position: sticky; top: 0; z-index: 500;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.site-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
}
.site-logo { flex-shrink: 0; display: flex; align-items: center; text-decoration: none; }
.site-logo img { height: 38px; width: auto; object-fit: contain; }
.logo-text { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.logo-text span { color: var(--accent); }

/* ── Main nav ── */
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a {
    padding: 7px 12px; color: var(--text); font-size: 0.85rem; font-weight: 500;
    border-radius: 8px; transition: all 0.2s; white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { background: rgba(26,58,92,0.07); color: var(--primary); }

/* ── Header actions (right side) ── */
.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.header-divider { width: 1px; height: 20px; background: var(--border); margin: 0 1px; flex-shrink: 0; }

.btn-hdr {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 10px; border-radius: 8px; font-size: 0.78rem; font-weight: 600;
    border: none; transition: all 0.2s; white-space: nowrap; text-decoration: none;
}
.btn-hdr-ghost  { background: transparent; color: var(--text-light); }
.btn-hdr-ghost:hover { background: var(--bg); color: var(--primary); }
.btn-hdr-accent { background: var(--accent); color: white; }
.btn-hdr-accent:hover { background: var(--accent-dark); }
.btn-hdr-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-hdr-outline:hover { border-color: var(--primary); color: var(--primary); }

.lang-btn {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 9px; border-radius: 8px; font-size: 0.78rem; font-weight: 700;
    border: 1.5px solid var(--border); background: white; color: var(--text); transition: all 0.2s;
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }

.cart-btn {
    position: relative; width: 38px; height: 38px; flex-shrink: 0;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; color: var(--text); font-size: 1rem;
}
.cart-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.cart-count {
    position: absolute; top: -6px; right: -6px;
    background: var(--accent); color: white; font-size: 0.6rem; font-weight: 700;
    width: 17px; height: 17px; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    border: 2px solid white;
}
.cart-count.show { display: flex; }

/* Mobile menu toggle */
.menu-toggle {
    display: none; background: none; border: none;
    font-size: 1.25rem; color: var(--text); padding: 4px; flex-shrink: 0;
}

/* Mobile nav dropdown */
.main-nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: white; box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    padding: 8px 12px 12px; z-index: 490; gap: 2px;
}
.main-nav.open a { padding: 10px 14px; font-size: 0.9rem; border-radius: 8px; }

/* ===== HERO SLIDER ===== */
.hero-section { position: relative; overflow: hidden; background: var(--primary); }
.hero-slider   { position: relative; width: 100%; }
.hero-slide {
    display: none; position: relative;
    min-height: 380px; align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, #0d2438 100%);
}
.hero-slide.active { display: flex; }
.hero-slide-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0.35;
}
.hero-content {
    position: relative; z-index: 2;
    padding: 50px 0; color: white; max-width: 580px;
}
.hero-badge {
    display: inline-block; background: var(--accent); color: white;
    padding: 4px 14px; border-radius: 20px; font-size: 0.72rem; font-weight: 700;
    margin-bottom: 14px; letter-spacing: 0.05em; text-transform: uppercase;
}
.hero-content h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.hero-content p  { font-size: 0.95rem; opacity: 0.85; margin-bottom: 24px; max-width: 480px; }
.btn-hero {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent); color: white; padding: 12px 24px;
    border-radius: 10px; font-weight: 700; font-size: 0.9rem; transition: all 0.2s;
}
.btn-hero:hover { background: var(--accent-dark); transform: translateY(-2px); }

/* Slider dots & arrows */
.slider-dots {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px; z-index: 10;
}
.slider-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.3s; border: none;
}
.slider-dot.active { background: var(--accent); width: 22px; border-radius: 4px; }
.slider-arrows {
    position: absolute; bottom: 16px; right: 16px; z-index: 10;
    display: flex; gap: 6px;
}
.slider-arrow {
    width: 34px; height: 34px; border-radius: 8px;
    background: rgba(255,255,255,0.2); border: none; color: white;
    font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.slider-arrow:hover { background: var(--accent); }

/* ===== SECTION HELPERS ===== */
.section { padding: 48px 0; }
.section-header { text-align: center; margin-bottom: 28px; }
.section-header h2 { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.section-line { width: 48px; height: 3px; background: var(--accent); border-radius: 2px; margin: 10px auto 0; }

/* ===== CATEGORIES GRID ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 20px;
}
.category-card {
    background: white; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--card-shadow); text-align: center;
    cursor: pointer; transition: all 0.3s; text-decoration: none; color: var(--text);
    border: 2px solid transparent;
}
.category-card:hover { box-shadow: var(--card-hover); transform: translateY(-3px); }
.category-card-img {
    width: 100%; aspect-ratio: 1; overflow: hidden;
    background: #f0f4f8; display: flex; align-items: center; justify-content: center;
}
.category-card-img img { width: 100%; height: 100%; object-fit: contain; }
.category-card-name { padding: 11px 10px; font-size: 0.84rem; font-weight: 600; line-height: 1.3; }
/* Active state */
.cat-active {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(230,126,34,0.18) !important;
    transform: translateY(-2px);
}
.cat-active .category-card-name { color: var(--accent); font-weight: 700; }

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(var(--prod-cols, 4), 1fr);
    gap: 20px;
}
.product-card {
    background: white; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--card-shadow); transition: all 0.3s;
    display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--card-hover); transform: translateY(-3px); }
.product-img { aspect-ratio: 4/3; overflow: hidden; background: #f8fafc; }
.product-img img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.4s; }
.product-card:hover .product-img img { transform: scale(1.05); }
.product-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #ccc; font-size: 2.5rem;
}
.product-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-category { font-size: 0.68rem; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.product-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 6px; line-height: 1.35; }
.product-desc {
    font-size: 0.78rem; color: var(--text-light); margin-bottom: 10px; flex: 1;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.product-price { font-size: 1rem; font-weight: 800; color: var(--primary); }
.product-unit  { font-size: 0.68rem; color: var(--text-muted); }
.btn-cart {
    flex-shrink: 0; padding: 7px 11px; background: var(--accent); color: white;
    border: none; border-radius: 8px; font-size: 0.76rem; font-weight: 700;
    transition: all 0.2s; display: flex; align-items: center; gap: 4px;
}
.btn-cart:hover  { background: var(--accent-dark); }
.btn-cart.added  { background: var(--primary); }

/* ===== FILTER SIDEBAR ===== */
.filter-sidebar { width: 230px; flex-shrink: 0; }
.filter-panel {
    background: white; border-radius: var(--radius);
    box-shadow: var(--card-shadow); overflow: hidden;
    position: sticky; top: 76px;
}
.filter-panel-title {
    padding: 13px 16px; font-weight: 700; font-size: 0.88rem;
    color: var(--primary); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 7px;
}
.filter-clear { margin-left: auto; font-size: 0.73rem; font-weight: 600; color: var(--accent); }
.filter-clear:hover { color: var(--accent-dark); }
.filter-section { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.filter-section:last-of-type { border-bottom: none; }
.filter-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 9px; }
.filter-options { display: flex; flex-direction: column; gap: 5px; }
.filter-option { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; cursor: pointer; color: var(--text); padding: 3px 0; }
.filter-option input[type="radio"] { accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.filter-option:hover { color: var(--primary); }
.search-wrap { position: relative; }
.search-wrap .form-control { padding-right: 32px; }
.search-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.82rem; pointer-events: none; }
.btn-apply-filter {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: calc(100% - 32px); margin: 12px 16px;
    padding: 10px; background: var(--primary); color: white;
    border: none; border-radius: 8px; font-size: 0.83rem; font-weight: 700;
    transition: background 0.2s;
}
.btn-apply-filter:hover { background: var(--primary-light); }
.btn-filter-toggle {
    display: none; align-items: center; gap: 6px;
    padding: 7px 13px; background: var(--primary); color: white;
    border: none; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
}

/* ===== CART DRAWER ===== */
.cart-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 900;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }
.cart-drawer {
    position: fixed; top: 0; right: -100%; width: 380px; max-width: 100vw;
    height: 100vh; background: white; z-index: 1000;
    display: flex; flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
}
.cart-drawer.open { right: 0; }
.cart-header { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.cart-header h3 { font-size: 0.98rem; font-weight: 700; }
.cart-close { width: 30px; height: 30px; border-radius: 8px; background: var(--bg); border: none; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; }
.cart-body { flex: 1; overflow-y: auto; padding: 12px 14px; -webkit-overflow-scrolling: touch; }
.cart-empty { text-align: center; padding: 50px 20px; color: var(--text-light); }
.cart-empty i { font-size: 2.8rem; margin-bottom: 10px; display: block; }
.cart-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.cart-item-img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #f0f0f0; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.81rem; font-weight: 600; margin-bottom: 2px; line-height: 1.3; }
.cart-item-controls { display: flex; align-items: center; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.qty-btn { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: white; font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.qty-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.qty-input { width: 34px; text-align: center; border: 1px solid var(--border); border-radius: 6px; padding: 2px; font-size: 0.8rem; }
.cart-item-price { font-size: 0.85rem; font-weight: 700; color: var(--primary); padding-top: 2px; flex-shrink: 0; }
.cart-item-remove { background: none; border: none; color: #e74c3c; font-size: 0.8rem; padding: 2px 4px; }
.cart-footer { padding: 12px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.cart-total { display: flex; justify-content: space-between; margin-bottom: 12px; font-weight: 700; font-size: 0.98rem; }
.cart-total-amount { color: var(--primary); font-size: 1.1rem; }
.btn-checkout {
    width: 100%; padding: 12px; background: var(--accent); color: white;
    border: none; border-radius: 10px; font-size: 0.92rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background 0.2s;
}
.btn-checkout:hover { background: var(--accent-dark); }

/* ===== CHECKOUT MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1100;
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: white; border-radius: 16px 16px 0 0; width: 100%; max-width: 100%;
    max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: white; z-index: 1; }
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-body { padding: 16px 18px 24px; }
.modal-close { background: none; border: none; font-size: 1.1rem; color: var(--text-light); padding: 4px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; }
.form-control {
    width: 100%; padding: 10px 13px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 0.875rem; color: var(--text); transition: border-color 0.2s;
    -webkit-appearance: none; appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,92,0.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-primary {
    width: 100%; padding: 13px; background: var(--primary); color: white;
    border: none; border-radius: 10px; font-size: 0.92rem; font-weight: 700;
    transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-light); }

/* ===== FOOTER ===== */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.85); padding: 48px 0 0; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.footer-logo { height: 38px; margin-bottom: 14px; }
.footer-about { font-size: 0.85rem; line-height: 1.7; opacity: 0.75; margin-bottom: 18px; }
.footer-social { display: flex; gap: 9px; flex-wrap: wrap; }
.social-link { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,0.1); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.88rem; transition: all 0.2s; }
.social-link:hover { background: var(--accent); }
.footer-contact h4 { font-size: 0.95rem; font-weight: 700; color: white; margin-bottom: 14px; }
.footer-contact-item { display: flex; gap: 10px; margin-bottom: 11px; font-size: 0.85rem; opacity: 0.8; align-items: flex-start; }
.footer-contact-item i { width: 16px; margin-top: 3px; color: var(--accent); flex-shrink: 0; }
.footer-bottom { margin-top: 36px; padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 0.78rem; opacity: 0.6; }

/* ===== ALERTS ===== */
.alert { padding: 11px 15px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 14px; }
.alert-success { background: #d4edda; color: #155724; }
.alert-danger  { background: #f8d7da; color: #721c24; }

/* ===== PAGE HERO (About / Contact) ===== */
.page-hero { background: var(--primary); color: white; padding: 48px 0; text-align: center; }
.page-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.page-hero p { opacity: 0.75; }

/* ===== AUTH PAGES ===== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px 16px; }
.auth-box { background: white; border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 420px; box-shadow: var(--card-shadow); }
.auth-box h2 { font-size: 1.3rem; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.auth-box p { color: var(--text-light); font-size: 0.85rem; margin-bottom: 22px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 0.83rem; color: var(--text-light); }
.auth-switch a { color: var(--accent); font-weight: 600; }

/* ===== THANK YOU ===== */
.thankyou-section { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; }
.thankyou-box { max-width: 480px; width: 100%; }
.thankyou-icon { font-size: 4rem; color: #27ae60; margin-bottom: 18px; }
.thankyou-box h1 { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin-bottom: 12px; }

/* ===== RTL ===== */
body.rtl { direction: rtl; font-family: var(--font-ar); }
body.rtl .cart-drawer { right: auto; left: -100%; }
body.rtl .cart-drawer.open { left: 0; right: auto; }
body.rtl .cart-count { right: auto; left: -6px; }
body.rtl .slider-arrows { right: auto; left: 16px; }
body.rtl .main-nav.open { left: 0; right: 0; }
body.rtl .filter-sidebar { left: auto; right: -100%; }
body.rtl .filter-sidebar.open { right: 0; left: auto; }
body.rtl .search-icon { right: auto; left: 10px; }
body.rtl .search-wrap .form-control { padding-right: 13px; padding-left: 32px; }
body.rtl .cart-item-remove { margin-left: 0; margin-right: auto; }

/* ===================================================================
   RESPONSIVE BREAKPOINTS
   =================================================================== */

/* ── Tablet landscape / small desktop: ≤ 1024px ── */
@media (max-width: 1024px) {
    .products-grid { gap: 16px; }
    .filter-sidebar { width: 210px; }
}

/* ── Tablet portrait: ≤ 860px ── */
@media (max-width: 860px) {
    /* Filter sidebar becomes slide-in drawer */
    .filter-sidebar {
        position: fixed;
        top: 0; left: -100%;
        width: 280px; height: 100vh;
        overflow-y: auto; z-index: 800;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
        transition: left 0.3s ease;
    }
    .filter-sidebar.open { left: 0; }
    .filter-panel { border-radius: 0; position: static; box-shadow: none; }
    .btn-filter-toggle { display: flex; }

    /* Hero */
    .hero-content h1 { font-size: 1.9rem; }
    .hero-slide { min-height: 320px; }
    .hero-content { padding: 40px 0; }

    /* Categories: allow scroll on small screens */
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }

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

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .site-footer { padding: 36px 0 0; margin-top: 40px; }
}

/* ── Tablet → hide main nav, show hamburger: ≤ 768px ── */
@media (max-width: 768px) {
    :root { --header-h: 56px; }

    .main-nav { display: none; }
    .menu-toggle { display: flex; }

    /* Header: only show icons on small screens */
    .btn-hdr .btn-label { display: none; }
    .btn-hdr-accent  { padding: 6px 8px; }
    .btn-hdr-outline { padding: 6px 8px; }
    .btn-hdr-ghost   { padding: 6px 8px; }

    /* Hero */
    .hero-content h1 { font-size: 1.6rem; }
    .hero-content p  { font-size: 0.88rem; margin-bottom: 18px; }
    .btn-hero { padding: 10px 20px; font-size: 0.85rem; }
    .hero-content { padding: 36px 0; }

    /* Section padding */
    .section { padding: 36px 0; }
    .section-header h2 { font-size: 1.4rem; }

    /* Categories horizontal scroll on mobile */
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    /* Products: 2-column grid */
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-body { padding: 11px; }
    .product-name { font-size: 0.83rem; }
    .product-desc { font-size: 0.74rem; -webkit-line-clamp: 2; }
    .product-price { font-size: 0.9rem; }
    .btn-cart { padding: 6px 9px; font-size: 0.72rem; }

    /* Checkout modal: full-screen bottom sheet */
    .modal { border-radius: 16px 16px 0 0; max-height: 95vh; }
    .form-grid { grid-template-columns: 1fr; }

    /* Auth pages */
    .auth-box { padding: 24px 18px; }

    /* Page hero */
    .page-hero { padding: 36px 0; }
    .page-hero h1 { font-size: 1.6rem; }

    /* Footer */
    .footer-grid { gap: 24px; }
    .footer-contact h4 { margin-top: 0; }
}

/* ── Mobile: ≤ 480px ── */
@media (max-width: 480px) {
    .container { padding: 0 12px; }

    /* Logo text smaller */
    .logo-text { font-size: 1.1rem; }
    .site-logo img { height: 32px; }

    /* Hero full-bleed */
    .hero-slide { min-height: 260px; }
    .hero-content h1 { font-size: 1.35rem; }
    .hero-content p  { font-size: 0.82rem; }
    .hero-badge { font-size: 0.65rem; padding: 3px 10px; margin-bottom: 10px; }
    .btn-hero { padding: 9px 16px; font-size: 0.8rem; }

    /* Categories: 3 equal columns */
    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .category-card-name { font-size: 0.7rem; padding: 6px 4px; }

    /* Products: 2 columns, compact */
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-body { padding: 9px; }
    .product-name { font-size: 0.78rem; -webkit-line-clamp: 2; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; }
    .product-footer { flex-direction: column; align-items: stretch; gap: 6px; }
    .btn-cart { justify-content: center; }

    /* Cart drawer: full width */
    .cart-drawer { width: 100%; }

    /* Section */
    .section { padding: 28px 0; }
    .section-header h2 { font-size: 1.25rem; }

    /* Filter sidebar */
    .filter-sidebar { width: 100%; }

    /* Auth */
    .auth-page { padding: 16px 12px; align-items: flex-start; padding-top: 40px; }
    .auth-box { padding: 22px 16px; border-radius: 12px; }

    /* Thank you */
    .thankyou-icon { font-size: 3.2rem; }
    .thankyou-box h1 { font-size: 1.5rem; }

    /* Footer */
    .site-footer { padding: 28px 0 0; margin-top: 32px; }
    .footer-about { font-size: 0.8rem; }
    .footer-contact-item { font-size: 0.8rem; }
}

/* ── Very small: ≤ 360px ── */
@media (max-width: 360px) {
    .header-actions { gap: 4px; }
    .header-divider { display: none; }
    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .products-grid { gap: 8px; }
    .cart-btn { width: 34px; height: 34px; }
}

/* ===== TOUCH IMPROVEMENTS ===== */
@media (hover: none) {
    /* Remove hover transforms on touch devices */
    .product-card:hover { transform: none; box-shadow: var(--card-shadow); }
    .category-card:hover { transform: none; box-shadow: var(--card-shadow); }
    .btn-hero:hover { transform: none; }
    /* Larger tap targets */
    .qty-btn { width: 30px; height: 30px; }
    .filter-option { padding: 6px 0; }
}

/* ===== SCROLLBAR (webkit) ===== */
.cart-body::-webkit-scrollbar,
.filter-sidebar::-webkit-scrollbar,
.modal::-webkit-scrollbar { width: 4px; }
.cart-body::-webkit-scrollbar-thumb,
.filter-sidebar::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
