/* ============================================================
   Urfa Studio — Responsive Stylesheet
   Mobile-first breakpoints
   ============================================================ */
html,
body {
  overflow-x: hidden;
}
/* ── Large Desktop (1400px+) ──────────────────────────────── */
@media (min-width: 1400px) {
  .container { max-width: 1360px; }
  .products-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ── Desktop (1025px–1399px) ──────────────────────────────── */
@media (max-width: 1280px) {
  .hero-title { font-size: 3.4rem; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 28px; }
}

@media (max-width: 1100px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .reviews-grid { grid-template-columns: repeat(2, 1fr); }
  .bestsellers-wrap { grid-template-columns: 1fr; }
  .hero-content { grid-template-columns: 1fr; gap: 40px; padding-top: calc(var(--nav-height) + 20px); }
  .hero-image-grid { justify-self: center; max-width: 400px; width: 100%; }
  .hero-text-block { max-width: 100%; text-align: center; }
  .hero-eyebrow { justify-content: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; }
}

/* ── Tablet (768px–1024px) ────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --nav-height: 64px; }

  .nav-links { display: none; }
  #hamburger { display: flex; }

  .section { padding: 60px 0; }
  .section-sm { padding: 36px 0;overflow-x: auto; }

  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand { grid-column: span 2; }

  /* Shop page sidebar */
  .shop-layout { grid-template-columns: 1fr !important; }
  .shop-sidebar {
    position: fixed;
    top: 0; left: -100%;
    width: 300px;
    height: 100vh;
    overflow-y: auto;
    background: var(--white);
    z-index: 1100;
    padding: 80px 24px 40px;
    box-shadow: var(--shadow-lg);
    transition: left .35s ease;
  }
  .shop-sidebar.sidebar-open { left: 0; }
  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1050;
    display: none;
  }
  .sidebar-overlay.active { display: block; }
  .filter-toggle-btn { display: flex !important; }

  /* Shop filters sidebar acts like a popup on mobile/tablet */
  #close-filters-btn { display: inline-flex; }

  /* Product detail */
  .product-detail-grid { grid-template-columns: 1fr !important; }

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

  /* Admin layout */
  .admin-layout { grid-template-columns: 1fr !important; }
  .admin-sidebar {
    position: fixed !important;
    left: -280px;
    top: 0; bottom: 0;
    z-index: 1100;
    transition: left .35s ease;
  }
  .admin-sidebar.open { left: 0 !important; }
}

/* ── Compact Navbar (≤ 860px) ─────────────────────────────── */
@media (max-width: 860px) {
  /* 2-row navbar (logo+icons, then search) */
  :root { --nav-height: 104px; }

  .nav-inner {
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-between;
    row-gap: 10px;
    column-gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
    height: 100%;
  }

  .nav-logo { order: 1; flex-shrink: 1; }
  .nav-logo-name { font-size: 1.2rem; }
  .nav-logo-tagline { font-size: 0.5rem; }
  .nav-actions {
    order: 2;
    margin-left: auto;
  }

  .nav-search {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
    position: static;
    left: auto;
    top: auto;
    transform: none;
    margin: 0;
  }

  #hamburger {
    position: static;
    left: auto;
    top: auto;
  }
}

/* ── Mobile (≤ 767px) ─────────────────────────────────────── */
@media (max-width: 767px) {
  /* Mobile navbar becomes 2 rows (logo+icons, then search) */
  :root { --nav-height: 112px; }

  .container { padding: 0 16px; }
  .section { padding: 48px 0; }

  /* Hero */
  #hero { min-height: auto; padding-bottom: 0; }
  .hero-title { font-size: clamp(1.8rem, 6vw, 2.8rem); line-height: 1.2; margin-bottom: 12px; }
  .hero-desc { font-size: .9rem; line-height: 1.5; margin-bottom: 16px; }
  .hero-stats { gap: 16px; flex-wrap: wrap; font-size: .8rem; }
  .hero-content { gap: 24px; }
 .hero-image-grid {
    max-width: 100%;
    display: flex;
    gap: 10px;
    padding-bottom: 10px;

    overflow-x: scroll;
    scrollbar-width: none;

    width: 100%;
}

.hero-image-grid::-webkit-scrollbar {
    display: none;
}
  .hero-img-card { flex-shrink: 0; width: 140px; height: 180px; scroll-snap-align: start; border-radius: var(--radius-md); }
  .hero-img-card:nth-child(1) { grid-row: unset; }
  .hero-cta { gap: 10px; flex-wrap: wrap; }
  .hero-cta .btn { flex: 1; min-width: 120px; padding: 12px 16px; font-size: .85rem; }

  /* Nav */
  .nav-icon-btn:not(#cart-icon-btn) { display: none; }
  .nav-actions .btn { display: none; }

  .nav-inner {
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-between;
    row-gap: 10px;
    column-gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
    height: 100%;
  }

  /* Keep logo + icons on the first row */
  .nav-logo { order: 1; flex-shrink: 1; max-width: 140px; }
  .nav-logo-name { font-size: 0.95rem; }
  .nav-logo-tagline { font-size: 0.45rem; }
  .nav-actions {
    order: 2;
    margin-left: auto;
    align-items: center;
    gap: 10px;
  }

  /* Search becomes the second row */
  .nav-search {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
    position: static;
    left: auto;
    top: auto;
    transform: none;
    margin: 0;
  }

  /* Hamburger should flow normally on mobile */
  #hamburger {
    position: static;
    left: auto;
    top: auto;
  }

  /* Categories */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .category-card { aspect-ratio: 2/3; }
  .cat-wide { aspect-ratio: 3/2 !important; grid-column: span 2; }

  /* Products */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-info { padding: 12px 14px 16px; }
  .product-name { font-size: .95rem; }
  .product-actions { opacity: 1; transform: none; }
  .product-quick-add {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 1 !important;
    transform: translateY(0) !important;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 11px 8px;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
  }
  .product-quick-add i { font-size: .85rem; }

  /* Reviews */
  .reviews-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-brand { grid-column: unset; }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* Newsletter */
  .newsletter-form {
    flex-direction: column;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    padding: 0;
    gap: 12px;
  }
  .newsletter-form input {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius-xl);
    padding: 13px 20px;
    width: 100%;
  }

  /* Marquee */
  .marquee-track { gap: 40px; }

  /* Breadcrumb */
  .breadcrumb { font-size: .72rem; }

  /* Buttons */
  .btn-lg { padding: 14px 28px; font-size: .82rem; }

  /* Toast */
  #toast-container { right: 12px; bottom: 20px; }
  .toast { max-width: calc(100vw - 24px); font-size: .8rem; }

  /* Modal */
  .modal-box { padding: 24px 18px; }

  /* Product detail thumbnails */
  .product-thumbs { flex-direction: row !important; overflow-x: auto; }
  .product-thumb { flex-shrink: 0; }

  /* Section headers */
  .section-sub { padding: 0 20px; }

  /* Shop filters bar */
  .shop-bar {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  .shop-bar-right {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Cart */
  .cart-item { flex-direction: column; align-items: flex-start !important; }
  .cart-item-img { width: 100% !important; height: 200px !important; }

  /* Login */
  .auth-grid { grid-template-columns: 1fr !important; }
  .auth-banner { display: none !important; }

  /* About */
  .about-story-grid { grid-template-columns: 1fr !important; }
  .about-values-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .about-team-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── Small Mobile (≤ 400px) ───────────────────────────────── */
@media (max-width: 400px) {
  .categories-grid { grid-template-columns: 1fr 1fr; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .btn { padding: 12px 24px; }
  .about-values-grid { grid-template-columns: 1fr !important; }
}

/* ── Landscape Mobile ─────────────────────────────────────── */
@media (max-width: 767px) and (orientation: landscape) {
  #hero { min-height: auto; }
  .hero-content { padding-top: calc(var(--nav-height) + 16px); }
}

/* ── Touch Device Enhancements ────────────────────────────── */
@media (hover: none) {
  .product-actions { opacity: 1; transform: none; }
  .product-quick-add { transform: translateY(0); position: static; }
  .product-img-wrap { aspect-ratio: 3/4; }
  .category-card .cat-arrow { opacity: 1; transform: rotate(0deg); }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  #navbar, #footer, .toast-container { display: none; }
  body { background: white; }
}
