/* ==========================================================================
   5. PAGES — listing, product detail, cart, checkout, account, CMS
   ========================================================================== */

/* ── breadcrumbs and page banners ───────────────────────────────────────── */
.fh-crumbs,.breadcrumb-bar{
  padding:12px var(--m-gutter);
  font-size:.75rem;
  white-space:nowrap;overflow-x:auto;
  scrollbar-width:none;-ms-overflow-style:none;
}
.fh-crumbs::-webkit-scrollbar,.breadcrumb-bar::-webkit-scrollbar{display:none;}

.page-banner,.fh-banner{
  padding:var(--m-block-sm) var(--m-gutter);
  text-align:center;
}
.page-banner h1,.fh-banner h1{font-size:clamp(1.4rem,6vw,1.8rem);}
.page-banner p,.fh-banner p{font-size:.8125rem;max-width:38ch;margin:8px auto 0;}

.fh-page{padding:var(--m-block-sm) var(--m-gutter) var(--m-block);}
.fh-page-narrow{max-width:none;}
.fh-h1{font-size:clamp(1.4rem,6vw,1.8rem);}
.fh-sub{font-size:.8125rem;}

/* ── listing chrome ─────────────────────────────────────────────────────── */
.cat-nav-wrap{
  overflow-x:auto;padding:12px var(--m-gutter);
  scrollbar-width:none;-ms-overflow-style:none;
}
.cat-nav-wrap::-webkit-scrollbar{display:none;}
.cat-nav-group{flex-wrap:nowrap;gap:7px;}
.cat-nav-group .glabel{display:none;}
.cat-pill{flex:0 0 auto;white-space:nowrap;padding:9px 15px;font-size:.75rem;}

.toolbar{
  flex-direction:column;align-items:stretch;gap:10px;
  padding:12px var(--m-gutter);
  position:sticky;top:var(--m-header);z-index:900;
  background:#fff;border-bottom:1px solid #eee;
}
.toolbar .count{font-size:.75rem;text-align:center;}
.toolbar-right{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.sort-select,.filter-btn{width:100%;min-height:44px;justify-content:center;}

/* filters become a bottom sheet */
.filter-panel{
  position:fixed;inset:auto 0 0 0;top:auto;
  width:100%;max-height:82vh;overflow-y:auto;
  border-radius:14px 14px 0 0;
  transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow:0 -8px 40px rgba(0,0,0,.22);
  z-index:2500;padding:20px var(--m-gutter) 26px;
  display:block;
}
.filter-panel.open{transform:translateY(0);}
.filter-panel::before{
  content:'';display:block;width:42px;height:4px;border-radius:2px;
  background:#ddd;margin:0 auto 16px;
}
.filter-actions{
  position:sticky;bottom:0;background:#fff;
  padding-top:12px;margin-top:8px;
  display:grid;grid-template-columns:1fr 1fr;gap:10px;
}
.filter-apply,.filter-clear{min-height:46px;}

/* shop.php filters: a bottom sheet opened by the "Filters" button beside Sort */
.shop-layout{grid-template-columns:1fr;gap:0;padding:0 0 var(--m-block);}
.filter-sidebar{
  position:fixed;inset:auto 0 0 0;top:auto;z-index:2500;
  width:100%;max-height:86vh;margin:0;padding:0;
  display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;
  border:none;border-radius:14px 14px 0 0;background:#fff;
  transform:translateY(102%);transition:transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow:0 -8px 40px rgba(0,0,0,.22);
}
body.fs-open .filter-sidebar{transform:none;}
.filter-sidebar .fs-header{
  position:sticky;top:0;z-index:2;flex:none;
  padding:22px var(--m-gutter) 14px;gap:12px;background:#fff;
}
.filter-sidebar .fs-header::before{
  content:'';position:absolute;top:8px;left:50%;width:42px;height:4px;margin-left:-21px;border-radius:2px;background:#ddd;
}
.filter-sidebar .fs-header h3{margin-right:auto;}
.filter-sidebar > .filter-group{flex:none;}
.filter-sidebar .fg-head{padding-left:var(--m-gutter);padding-right:var(--m-gutter);}
.filter-sidebar .fg-body{padding-left:var(--m-gutter);padding-right:var(--m-gutter);}
.fs-scrim{z-index:2499;}
.prod-area-top{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:stretch;
  padding:12px var(--m-gutter);margin-bottom:14px;
  position:sticky;top:var(--m-header);z-index:900;background:#fff;
}
.prod-area-top .fs-open-btn,.prod-area-top .sort-select{min-height:44px;height:auto;}
.prod-count{grid-column:1/-1;order:3;text-align:center;font-size:.75rem;}

.listing-empty{padding:40px var(--m-gutter);font-size:.875rem;}
.pager{gap:6px;flex-wrap:wrap;padding:0 var(--m-gutter);}
.pager a,.pager span{min-width:40px;min-height:40px;}

/* ── product detail ─────────────────────────────────────────────────────── */
.pd-wrap{
  /* minmax(0,…): a plain 1fr grows to the thumbnail strip's full width and
     pushed the whole product column off-screen on phones */
  grid-template-columns:minmax(0,1fr);gap:0;
  padding:0 0 var(--m-block);
}
.pd-gallery{position:static;}
.pd-main-img{
  height:auto;aspect-ratio:3/4;width:100%;
  object-fit:cover;
}
.pd-thumbs{
  gap:7px;padding:10px var(--m-gutter) 0;
  overflow-x:auto;flex-wrap:nowrap;
  scrollbar-width:none;-ms-overflow-style:none;
}
.pd-thumbs::-webkit-scrollbar{display:none;}
.pd-thumb{width:62px;height:78px;flex:0 0 auto;}

.pd-info{padding:var(--m-block-sm) var(--m-gutter) 0;}
.pd-info .tag{font-size:.6875rem;letter-spacing:.16em;}
.pd-info h1{font-size:clamp(1.3rem,5.5vw,1.6rem);line-height:1.25;}
.pd-rating{gap:8px;font-size:.8125rem;}
.pd-price{font-size:1.5rem;}
.pd-old-price{font-size:1rem;}
.pd-tax-note{font-size:.75rem;margin-bottom:22px;}

.pd-colours{gap:9px;}
.pd-colour{width:40px;height:40px;}
.pd-sizes{gap:8px;}
.pd-size-btn{min-width:52px;min-height:46px;padding:12px 14px;font-size:.8125rem;}

.pd-actions{flex-direction:column;gap:10px;margin-top:22px;}
.pd-btn{width:100%;}
.pd-wish{width:100%;height:48px;order:3;}
.pd-badges-row{flex-direction:column;gap:8px;}
.pd-badge-item{min-width:0;}
.pd-specs li{flex-direction:column;gap:2px;}
.pd-specs li b{min-width:0;}

.pd-reviews,.related-section{padding:0 var(--m-gutter) var(--m-block);}
.pd-rev-grid{grid-template-columns:1fr;gap:12px;}
.pd-rev-form{padding:18px 14px;}
.related-title{font-size:1.15rem;}

/* sticky buy bar keeps the primary action reachable */
.pd-sticky-buy{
  position:fixed;left:0;right:0;bottom:0;z-index:1500;
  background:#fff;border-top:1px solid #eaeaea;
  padding:10px var(--m-gutter);
  display:flex;gap:10px;align-items:center;
  box-shadow:0 -4px 20px rgba(0,0,0,.08);
}
.pd-sticky-buy .price{font-size:1.05rem;font-weight:700;white-space:nowrap;}
.pd-sticky-buy .fh-btn{flex:1;margin:0;}
body.has-buybar{padding-bottom:74px;}

/* ── cart ───────────────────────────────────────────────────────────────── */
.fh-cart-layout{grid-template-columns:1fr;gap:16px;}
.fh-cart-item{
  grid-template-columns:88px 1fr;
  gap:12px;padding:16px 0;
}
.fh-cart-item img{width:88px;height:112px;}
.fh-cart-name{font-size:.9375rem;line-height:1.35;}
.fh-cart-meta{font-size:.75rem;}
.fh-cart-price{
  grid-column:2;text-align:left;
  padding-top:8px;font-size:1rem;
}
.fh-qty{margin-top:10px;}
.fh-qty button{width:38px;height:38px;}
.fh-qty span{width:44px;}

.fh-summary{position:static;padding:18px var(--m-gutter);}
.fh-summary h3{font-size:1rem;}
.fh-sum-row{font-size:.875rem;}
.fh-sum-row.total{font-size:1.05rem;}
.fh-coupon-row{flex-direction:column;gap:8px;}
.fh-coupon-row input,.fh-coupon-row button{width:100%;}

/* ── checkout ───────────────────────────────────────────────────────────── */
.fh-checkout{grid-template-columns:1fr;gap:16px;}
.fh-steps{
  gap:6px;font-size:.6875rem;
  overflow-x:auto;padding-bottom:4px;
  scrollbar-width:none;-ms-overflow-style:none;
}
.fh-steps::-webkit-scrollbar{display:none;}
.fh-step{flex:0 0 auto;white-space:nowrap;}
.fh-addr-pick{grid-template-columns:1fr;gap:10px;}
.fh-addr{padding:14px;font-size:.8125rem;}
.fh-pay{padding:14px;gap:10px;}
.fh-pay strong{font-size:.875rem;}
.fh-pay span{font-size:.75rem;}

/* ── account ────────────────────────────────────────────────────────────── */
.fh-account{grid-template-columns:1fr;gap:14px;}
.fh-side{
  display:flex;overflow-x:auto;gap:4px;padding:4px;
  scrollbar-width:none;-ms-overflow-style:none;
}
.fh-side::-webkit-scrollbar{display:none;}
.fh-side-head{display:none;}
.fh-side a{flex:0 0 auto;white-space:nowrap;font-size:.8125rem;padding:11px 15px;}
.fh-stat-row{grid-template-columns:1fr 1fr;gap:10px;}
.fh-stat strong{font-size:1.2rem;}
.fh-card{padding:18px var(--m-gutter);}
.fh-card-head{flex-direction:column;align-items:flex-start;gap:6px;}

/* tables scroll rather than squash */
.fh-table{display:block;overflow-x:auto;white-space:nowrap;font-size:.8125rem;}
.fh-table th,.fh-table td{padding:9px 8px;}

/* ── auth + CMS ─────────────────────────────────────────────────────────── */
.fh-auth{padding:var(--m-block-sm) var(--m-gutter) var(--m-block);}
.fh-auth-card{padding:24px 18px;box-shadow:none;border:1px solid #eee;}
.fh-auth-card h1{font-size:1.35rem;}
.fh-cms{padding:18px var(--m-gutter);}
.fh-cms h2{font-size:1.2rem;}
.fh-cms h3{font-size:1.05rem;}
.fh-cms p,.fh-cms li{font-size:.875rem;line-height:1.8;}

.fh-empty{padding:44px var(--m-gutter);}
.fh-empty .ti{font-size:2.4rem;}
.fh-empty h2{font-size:1.15rem;}

/* ── contact ────────────────────────────────────────────────────────────── */
.fh-contact-grid{grid-template-columns:1fr !important;gap:16px;}
