/* =====================================================================
   Handicrafto - storefront responsive rules
   ===================================================================== */

@media (max-width: 1199.98px) {
  .hero .carousel-item { height: 480px; }
  .hero h1, .hero h2 { font-size: 2.5rem; }
}

@media (max-width: 991.98px) {
  :root { --header-h: 64px; }

  .mobile-toggle { display: inline-flex; }
  .brand img { height: 38px; }
  .header-main { gap: 8px; flex-wrap: wrap; padding: 8px 0; }
  .header-actions { order: 2; }
  .header-action span.label { display: none; }
  .header-action { padding: 6px 8px; }
  .search-box { order: 3; flex: 0 0 100%; max-width: none; margin-bottom: 4px; }

  /* Category navigation becomes a slide-in drawer */
  .category-nav {
    position: fixed; top: 0; left: 0; bottom: 0; width: 290px; max-width: 86vw; z-index: 1060; background: #fff;
    transform: translateX(-100%); transition: transform .3s ease; overflow-y: auto; border-top: 0; box-shadow: var(--shadow);
  }
  .category-nav.open { transform: none; }
  .category-nav .container { display: block; padding: 0; }
  .drawer-head { display: flex !important; justify-content: space-between; align-items: center; padding: 16px 18px; background: var(--c-ink); color: #fff; }
  .cat-nav-list { flex-direction: column; gap: 0; }
  .cat-nav-list > li > a { padding: 13px 18px; border-bottom: 1px solid var(--c-line); justify-content: space-between; }
  .cat-dropdown { position: static; display: none; box-shadow: none; border: 0; border-radius: 0; background: var(--c-cream); padding: 6px 12px; }
  .cat-nav-list > li:hover .cat-dropdown { display: none; }
  .cat-nav-list > li.open .cat-dropdown,
  .cat-nav-list > li.open:hover .cat-dropdown { display: block; }
  .nav-sell { margin: 16px 18px; }
  .drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 1055; display: none; }
  .drawer-backdrop.show { display: block; }

  .hero .carousel-item { height: 420px; }
  .hero h1, .hero h2 { font-size: 2.1rem; }
  .hero p { font-size: 1rem; }

  .filter-toggle { display: inline-flex; }
  .filter-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 320px; max-width: 90vw; z-index: 1060; background: var(--c-cream);
    transform: translateX(100%); transition: transform .3s ease; overflow-y: auto; padding: 16px; box-shadow: var(--shadow);
  }
  .filter-panel.open { transform: none; }
  .summary-card { position: static; }
  .auth-form { padding: 32px 26px; }
}

@media (max-width: 767.98px) {
  body { font-size: 14.5px; }
  .section { padding: 38px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .section-head h2 { font-size: 1.5rem; }

  .topbar .container { justify-content: center; text-align: center; }
  .topbar-links { display: none; }

  .hero .carousel-item { height: 380px; }
  .hero h1, .hero h2 { font-size: 1.7rem; }
  .hero .slide-overlay { background: linear-gradient(0deg, rgba(20, 8, 8, .82), rgba(20, 8, 8, .35)); }
  .hero .slide-body { align-items: flex-end; padding-bottom: 46px; }

  .pc-body { padding: 10px 12px 12px; }
  .pc-title { font-size: .94rem; }
  .price-now { font-size: 1.05rem; }
  .pc-actions .btn { padding: .45rem .5rem; font-size: .82rem; }

  .pd-title { font-size: 1.45rem; }
  .pd-price .price-now { font-size: 1.6rem; }
  .gallery-thumbs button { width: 58px; height: 58px; }

  .cart-line { flex-wrap: wrap; padding: 14px; }
  .cart-line img { width: 72px; height: 72px; }
  .cart-line .line-total { min-width: 0; width: 100%; text-align: left; }

  .page-head h1 { font-size: 1.5rem; }
  .store-info { flex-direction: column; text-align: center; margin-top: -40px; }
  .store-info .logo { width: 88px; height: 88px; margin-top: -60px; }
  .store-hero { height: 170px; }

  .footer-bottom { flex-direction: column; text-align: center; }
  .toast-stack { right: 10px; left: 10px; top: 76px; }
  .toast-msg { max-width: none; }
  .nav-tabs-brand { flex-wrap: nowrap; overflow-x: auto; }
  .nav-tabs-brand .nav-link { white-space: nowrap; padding: .7rem .9rem; }
}

@media (max-width: 420px) {
  .spec-mini { grid-template-columns: 1fr; }
  .coupon-box { flex-direction: column; }
}
