/* ==========================================================================
   MiloMart — store.css  (commerce components; uses theme.css tokens only)
   ========================================================================== */
[hidden] { display: none !important; }

/* --- Header icon buttons -------------------------------------------------- */
.header-tools { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
@media (min-width: 1000px) { .header-tools { margin-left: 0; } .nav { margin-inline: auto; } }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--radius-pill); border: 1.5px solid transparent; background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { border-color: var(--line); background: var(--card); }
.icon-btn svg { width: 21px; height: 21px; }
.cart-count {
  position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: #fff; font-size: .7rem; font-weight: 800; line-height: 19px; text-align: center;
}
.header-inner .header-cta { margin-left: .4rem; }

/* --- Product cards & grids ------------------------------------------------ */
.pgrid { display: grid; gap: clamp(1rem, 2.2vw, 1.6rem); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcard a { display: block; text-decoration: none; color: inherit; border-radius: var(--radius); }
.pcard figure { margin: 0; position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1; }
.pcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.pcard a:hover img { transform: scale(1.035); }
.pcard .status { position: absolute; left: .7rem; top: .7rem; }
.pcard-noimg { display: block; width: 100%; height: 100%; background:
  linear-gradient(135deg, var(--paper-2), var(--paper)); }
.pcard-body { padding: .8rem .15rem 0; }
.pcard-body h3 { font-size: var(--step-0); font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.pcard a:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.pcard-price { margin-top: .3rem; font-weight: 700; font-size: var(--step--1); color: var(--ink); }
.pcard-price .from { font-weight: 500; color: var(--ink-2); }
.pcard-price s, .pdp-price s { color: var(--ink-3); font-weight: 500; margin-left: .35rem; }
.row-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.row-head h2 { font-size: var(--step-3); }

/* --- Listing toolbar & filters -------------------------------------------- */
.toolbar { display: grid; gap: 1rem; margin-bottom: 1.6rem; }
.filters { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: end;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.filters .filter { display: grid; gap: .3rem; }
.filters label, .filters legend { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.filters select, .filters input[type="number"] {
  min-height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
  padding: .45rem .7rem; font-size: .92rem;
}
.filters input[type="number"] { width: 6.5rem; }
.filters fieldset { border: 0; padding: 0; display: grid; gap: .3rem; }
.price-pair { display: flex; align-items: center; gap: .4rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-size: .92rem; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.filters .btn { min-height: 44px; padding: .55rem 1.1rem; font-size: .9rem; }
.toolbar-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-size: var(--step--1); color: var(--ink-2); }
.link-btn { background: none; border: 0; padding: .5rem 0; min-height: 44px; color: var(--accent-ink); font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.load-more { display: flex; justify-content: center; margin-top: 2.2rem; }
[aria-busy="true"] .pgrid { opacity: .55; transition: opacity .2s; }

/* --- Breadcrumbs ---------------------------------------------------------- */
.crumbs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; font-size: var(--step--1); color: var(--ink-3); margin-bottom: 1.3rem; }
.crumbs li + li::before { content: '/'; margin-right: .35rem; color: var(--line); }
.crumbs a { color: var(--ink-2); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* --- Collection header ---------------------------------------------------- */
.col-head { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 900px) { .col-head { grid-template-columns: 1.1fr .9fr; } }
.col-head figure { margin: 0; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); background: var(--paper-2); }
.col-head img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* --- Product page --------------------------------------------------------- */
@media (min-width: 960px) { .pdp { grid-template-columns: 1.05fr .95fr; } }
.gallery-main.is-media { aspect-ratio: 1 / 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: grid; place-items: center; }
.gallery-main.is-media img, .gallery-main.is-media video, .gallery-main.is-media iframe { width: 100%; height: 100%; object-fit: contain; border: 0; background: #fff; }
.gallery-thumbs.is-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .6rem; margin-top: .8rem; }
.gallery-thumbs.is-media button { position: relative; padding: 0; aspect-ratio: 1 / 1; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden; cursor: pointer; min-height: 44px; }
.gallery-thumbs.is-media button[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.gallery-thumbs.is-media img { width: 100%; height: 100%; object-fit: cover; }
.thumb-play { position: absolute; inset: auto .3rem .3rem auto; background: rgba(17,26,49,.8); color: #fff; font-size: .65rem; border-radius: 99px; padding: .15rem .4rem; }
.pdp-info { display: grid; gap: 1.1rem; align-content: start; }
@media (min-width: 960px) { .pdp-info { position: sticky; top: 96px; } }
.pdp-info h1 { font-size: var(--step-4); }
.pdp-vendor { font-size: var(--step--1); font-weight: 700; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.pdp-price { font-size: var(--step-3); font-weight: 800; letter-spacing: -.03em; }
.pdp-price s { font-size: var(--step-1); }
.pdp-stock { font-size: var(--step--1); font-weight: 700; color: var(--ink-2); min-height: 1.2em; }
.opt { border: 0; padding: 0; display: grid; gap: .55rem; }
.opt legend { font-size: var(--step--1); font-weight: 700; margin-bottom: .5rem; }
.opt legend span { font-weight: 500; color: var(--ink-2); }
.variants button { min-height: 44px; cursor: pointer; }
.variants button.is-unavailable { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.buy-row { display: grid; grid-template-columns: auto 1fr; gap: .7rem; }
.buy-row .btn { width: 100%; }
.pdp-actions { margin-top: 0; }
.pdp-actions .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.pdp-msg { font-size: var(--step--1); color: #B3261E; min-height: 1em; }
.notify { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; }
.notify h2 { font-size: var(--step-1); margin-bottom: .3rem; }
.notify p { font-size: var(--step--1); color: var(--ink-2); }
.notify-form { display: grid; grid-template-columns: 1fr auto; gap: .6rem; margin-top: .8rem; }
.notify-form input[type="email"] { min-height: 46px; }
.notify .form-status { margin-top: .7rem; }
.pdp-desc { color: var(--ink-2); }
.pdp-desc > * + * { margin-top: .8rem; }
.pdp-desc ul, .pdp-desc ol { padding-left: 1.2rem; }
.pdp-desc img { border-radius: var(--radius); }
.acc-body a { color: var(--accent-ink); }
.acc-body > * + * { margin-top: .5rem; }
.pdp-loading { min-height: 60vh; display: grid; place-items: center; color: var(--ink-3); }
.skeleton { width: min(100%, 520px); display: grid; gap: .9rem; }
.skeleton span { display: block; height: 1rem; border-radius: 8px; background: linear-gradient(90deg, var(--paper-2), #ece6dd, var(--paper-2)); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .skeleton span { animation: sk 1.4s ease infinite; } }
@keyframes sk { to { background-position: -200% 0; } }

/* --- Quantity (small) ----------------------------------------------------- */
.qty--sm button { width: 38px; height: 38px; }
.qty--sm input { width: 44px; min-height: 38px; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* --- Overlays: cart drawer & search panel --------------------------------- */
html.has-overlay { overflow: hidden; }
.overlay { position: fixed; inset: 0; z-index: 120; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(17, 26, 49, .45); opacity: 0; transition: opacity .2s ease; border: 0; width: 100%; cursor: pointer; }
.overlay.is-open .overlay-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--paper);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .24s cubic-bezier(.2,.7,.2,1); }
.overlay.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: var(--step-1); }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.drawer-foot { border-top: 1px solid var(--line); padding: 1rem 1.25rem 1.25rem; background: var(--card); }
.search-panel { position: absolute; top: 0; left: 0; right: 0; background: var(--paper); box-shadow: var(--shadow-lg);
  transform: translateY(-12px); opacity: 0; transition: transform .2s ease, opacity .2s ease; padding: 1rem 0 1.4rem; max-height: 85vh; overflow-y: auto; }
.overlay.is-open .search-panel { transform: none; opacity: 1; }
.search-row { display: flex; gap: .6rem; align-items: center; }
.search-row input { flex: 1; min-height: 50px; font-size: 1.05rem; }
.search-note { font-size: var(--step--1); color: var(--ink-3); margin-top: .6rem; min-height: 1.2em; }
.suggest { list-style: none; padding: 0; margin-top: .8rem; display: grid; gap: .2rem; }
.suggest a { display: flex; align-items: center; gap: .8rem; padding: .55rem .7rem; border-radius: var(--radius-sm); text-decoration: none; min-height: 44px; }
.suggest [aria-selected="true"] a, .suggest a:hover { background: var(--accent-soft); }
.suggest img, .sg-ph { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--paper-2); flex: none; }
.sg-t { flex: 1; font-weight: 600; }
.sg-p { font-size: var(--step--1); font-weight: 700; }
.sg-k { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.search-page-form { display: flex; gap: .6rem; max-width: 640px; margin-top: 1.4rem; }
.search-page-form input { flex: 1; min-height: 50px; }

/* --- Cart lines ----------------------------------------------------------- */
.lines { list-style: none; padding: 0; display: grid; gap: 1rem; }
.line { display: grid; grid-template-columns: 80px 1fr auto; gap: .9rem; align-items: start; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.line-img img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); background: var(--paper-2); }
.line-img { display: block; width: 80px; height: 80px; border-radius: var(--radius-sm); background: var(--paper-2); }
.line-title { font-weight: 700; text-decoration: none; }
.line-title:hover { text-decoration: underline; }
.line-variant, .line-unit { font-size: var(--step--1); color: var(--ink-2); }
.line-controls { display: flex; align-items: center; gap: .8rem; margin-top: .5rem; flex-wrap: wrap; }
.line-remove { background: none; border: 0; color: var(--ink-2); font-size: var(--step--1); text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 .2rem; }
.line-total { font-weight: 700; }
.cart-sum { display: flex; justify-content: space-between; font-weight: 800; font-size: var(--step-1); }
.cart-note { font-size: var(--step--1); color: var(--ink-2); margin: .3rem 0 1rem; }
.cart-page { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .cart-page { grid-template-columns: 1.4fr .8fr; } }
.cart-summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Config-rendered values ----------------------------------------------- */
.cfg-missing { background: #FFF4D6; color: #6B4E00; border-radius: 4px; padding: 0 .25rem; font-weight: 600; }
.form-status.is-error { color: #B3261E; }
.form-status a { color: inherit; text-decoration: underline; font-weight: 700; }
.signup .form-status.is-error { color: #FFD7D3; }
.faq-group + .faq-group { margin-top: 2.6rem; }
.faq-group h2 { font-size: var(--step-2); margin-bottom: .8rem; }
.footer-bottom .link-btn { color: #B9C2D8; padding: 0; min-height: 0; font-weight: 500; font-size: inherit; }
.footer-bottom .link-btn:hover { color: #fff; }
.tile--live .tile-body h3::after { content: ' \2192'; color: var(--accent); }
