:root{
  --bg:#ffffff;
  --text:#0b0b0b;
  --muted:#6f6f6f;
  --line:#e8e8e8;
  --card:#f7f7f7;
  --accent:#d4b10a; /* “highlighted” nav items */
}

@font-face {
  font-family: 'AvenirCustom';
  src: url('/assets/fonts/Avenir.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nordhin';
  src: url('/assets/fonts/Nordhin.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

*{box-sizing:border-box}
html,body{height:100%}
body {
  margin: 0;
  font-family: 'AvenirCustom', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

b, strong {
  font-family: 'Nordhin', sans-serif;
  font-weight: 700;
}

* {
  font-weight: inherit;
}

[style*="font-weight:700"],
[style*="font-weight: 700"],
.font-bold,
.logo,
.category-nav .highlight {
  font-family: 'Nordhin', sans-serif;
  font-weight: 700;
}

* {
  font-family: 'AvenirCustom', Arial, sans-serif;
}

strong, b,
h1, h2, h3, h4, h5, h6 {
  font-family: 'Nordhin', sans-serif;
  font-weight: 700;
}

a{color:inherit;text-decoration:none}
a:hover{text-decoration:underline}
.sr-only{position:absolute;left:-9999px}

.site-header{
  border-bottom:1px solid var(--line);
  background:#fff;
  position:sticky;
  top:0;
  z-index:10;
}

.topbar{
  display:grid;
  grid-template-columns: 140px 1fr auto;
  gap:16px;
  align-items:center;
  padding:14px 18px;
}

.logo{
  display:inline-flex;
  width:110px;
  height:44px;
  align-items:center;
  justify-content:center;
  font-weight:700;
  letter-spacing:.05em;
}

.primary-nav, .utility-nav, .category-nav{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  align-items:center;
}

.primary-nav a, .category-nav a,
.utility-nav a, .utility-nav button{
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.category-nav .highlight{
  color: black;
  font-weight:700;
}

.active{
  text-decoration:underline;
  text-underline-offset: 4px;
}

.linklike{
  appearance:none;
  border:none;
  background:transparent;
  padding:0;
  cursor:pointer;
  font:inherit;
}
.linklike:hover{text-decoration:underline}

.subbar{
  border-top:1px solid var(--line);
  padding:10px 0;
  display:flex;
  justify-content:center; /* center horizontally */
}

.category-nav{
  display:flex;
  gap:18px;
  align-items:center;
  justify-content:center; /* center items inside */
}

.sep{
  width:1px;
  height:18px;
  background:var(--line);
  display:inline-block;
  margin:0 6px;
}

.page{
  max-width:1200px;
  margin:0 auto;
  padding:22px 18px 60px;
}

.grid-head{margin-bottom:12px}
.results-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  font-size:14px;
}
.results-bar .clear{color:var(--muted)}

.product-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:18px;
}

.loading{color:var(--muted); padding:14px}

.card{
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
  display:flex;
  flex-direction:column;
  min-height: 340px;
  position: relative;
}

.card-media{
  background:var(--card);
  aspect-ratio: 1 / 1;
  overflow:hidden;
}
.card-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.card-body{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.title-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.sub{color:var(--muted); font-size:13px}
.price{color:var(--muted); font-size:13px}

.btn{
  margin-top:auto;
  width:100%;
  border:1px solid var(--text);
  background:#fff;
  color:var(--text);
  border-radius:10px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{background:#f2f2f2}
.btn:disabled{opacity:.6; cursor:not-allowed}

.btn.subtle{
  border-color:var(--line);
  color:var(--muted);
}

.page-title{margin:0 0 14px 0}
.prose{max-width:65ch; line-height:1.6}
.empty{color:var(--muted)}

.site-footer{
  border-top:1px solid var(--line);
  padding:18px;
}
.footer-inner{
  max-width:1200px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.muted{color:var(--muted)}

/* Bag */
.bag-actions{
  display:flex;
  gap:12px;
  margin: 10px 0 16px;
  max-width:520px;
}
.bag-actions .btn{margin-top:0}

.bag-wrap{max-width:720px}
.bag-list{display:flex;flex-direction:column;gap:14px}
.bag-item{
  display:grid;
  grid-template-columns: 96px 1fr auto;
  gap:14px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  align-items:center;
}
.bag-item img{
  width:96px;height:96px;object-fit:cover;border-radius:12px;
}
.bag-meta{display:flex;flex-direction:column;gap:6px}
.bag-title{display:flex;justify-content:space-between;gap:10px}
.bag-remove{
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:10px 12px;
  cursor:pointer;
}
.bag-total{
  margin-top:18px;
  display:flex;
  justify-content:space-between;
  border-top:1px solid var(--line);
  padding-top:14px;
}

/* Search overlay */
.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.42);
  display:grid;
  place-items:center;
  padding:18px;
}
.overlay-card{
  width:min(560px, 100%);
  background:#fff;
  border-radius:16px;
  border:1px solid var(--line);
  padding:14px;
}
.overlay-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}
.icon-btn{
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  padding:8px 10px;
  cursor:pointer;
}
.search-form{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px;
}
.search-form input{
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
}
.search-form button{
  border:1px solid var(--text);
  border-radius:10px;
  background:#fff;
  padding:10px 12px;
  cursor:pointer;
  font-weight:600;
}
.hint{color:var(--muted); font-size:13px; margin:10px 0 0}

/* Responsive */
@media (max-width: 980px){
  .topbar{
    grid-template-columns: 120px 1fr;
    grid-template-areas:
      "logo util"
      "primary primary";
  }
  .logo{grid-area:logo}
  .utility-nav{grid-area:util; justify-content:flex-end}
  .primary-nav{grid-area:primary}
  .product-grid{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .bag-item{grid-template-columns: 96px 1fr}
  .bag-item .bag-remove{grid-column: 1 / -1; width:100%}
}
@media (max-width: 520px){
  .product-grid{grid-template-columns: 1fr}
  .bag-actions{flex-direction:column; max-width:none}
}
/* Force hidden overlays to not display */
.overlay[hidden] { display: none !important; }

/* ---------- Customs builder ---------- */
.customs-wrap {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  padding: 18px;
}

.customs-left .customs-title {
  margin: 0 0 10px 0;
}

.customs-panel {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 14px;
  background: rgba(0,0,0,0.18);
}

.field { display: grid; gap: 6px; margin: 10px 0; }
.field > span { font-size: 13px; opacity: 0.9; }
.field input[type="file"], .field select, .field input[type="range"] {
  width: 100%;
}

.row { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: inherit;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,0.10); }
.btn.primary { border-color: rgba(255,255,255,0.30); background: rgba(255,255,255,0.14); }

.divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 14px 0;
}

.customs-right {
  min-height: 520px;
}

.customs-view {
  height: calc(100vh - 160px);
  min-height: 520px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
  position: relative;
}

.customs-view canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.small-note {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 10px;
}

.btn.active { outline: 2px solid rgba(255,255,255,0.35); }

/* ---------- Product detail page ---------- */
.card-link{
  position:absolute;
  inset:0;
  z-index:0;
}
.card-media, .card-body{
  position:relative;
  z-index:1;
}
.card-body .btn{
  position:relative;
  z-index:2;
}

.product-shell{
  max-width:1100px;
  margin:0 auto;
  padding:22px 18px 34px;
}
.back-link{
  display:inline-flex;
  gap:8px;
  align-items:center;
  color:var(--muted);
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.back-link:hover{ text-decoration:underline; }

.product-layout{
  margin-top:18px;
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:34px;
  align-items:start;
}

.product-media{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
}
.product-media img{
  width:100%;
  height:auto;
  display:block;
}

.product-info{
  padding-top:8px;
}

.product-title{
  margin:0;
  font-size:28px;
  letter-spacing:.01em;
}
.product-price{
  margin-top:8px;
  color:var(--muted);
}
.product-sub{
  margin-top:10px;
  color:var(--muted);
  font-size:14px;
}
.product-meta{
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
}
.product-desc{
  margin-top:14px;
  line-height:1.6;
  max-width:55ch;
}

.field{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.field span{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
}
.field select, .field input{
  height:40px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:8px 10px;
  font-size:14px;
  background:#fff;
}

.btn.large{
  margin-top:18px;
  padding:14px 14px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

/* Responsive */
@media (max-width: 900px){
  .product-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-layout{ grid-template-columns: 1fr; }
}

.card {
  position: relative; /* required so absolute positioning uses the card as reference */
}

.card-link {
  position: absolute;
  inset: 0;
  display: block;  /* CRITICAL: makes the <a> actually have size */
  z-index: 2;
}

/* keep your image/text visible */
.card-media, .card-body {
  position: relative;
  z-index: 1;
}

/* but keep the add button ABOVE the overlay so it still works */
.card-body .btn {
  position: relative;
  z-index: 3;
}

