/* ==========================================================================
   Sandalo — Demonte Mobilya (product listing + product detail)
   Shared inner-page rules (page head, breadcrumb, chips, detail blocks…) live in pages.css,
   which every inner page loads before this file.
   Built only from the existing system: cream canvas, olive accents, serif
   headlines, Archivo UI, hairlines, 4:5 cards, generous spacing.
   No new colours, fonts, shadows or decorative patterns.
   ========================================================================== */


/* ---- Listing toolbar ----------------------------------------------------- */
.shop-toolbar {
  display: grid; gap: var(--sp-6); padding-block: var(--sp-6);
  border-top: var(--hairline); border-bottom: var(--hairline); margin-bottom: var(--sp-12);
}
@media (min-width: 1024px) { .shop-toolbar { grid-template-columns: 1fr auto; align-items: center; } }
.shop-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-6); }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--olive-500); }
.select-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.select-inline select { min-width: 9.5rem; min-height: 40px; border: 0; border-bottom: 1px solid var(--sage-grey); background: transparent; padding: 0 4px; }
.result-count { color: var(--text-muted); font-size: var(--fs-small); }

/* ---- Product grid & card ------------------------------------------------- */
/* Reserve room while the listing renders from data (prototype), so the bridge below doesn't jump. */
.product-grid:empty:not([hidden]) { min-height: 60vh; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-12) var(--gutter); }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.product-card { display: block; text-decoration: none; color: inherit; }
.product-card__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--stone); }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-base) var(--ease-out); }
.product-card:hover .product-card__media img { transform: scale(1.02); }
.product-card__name { margin-top: var(--sp-4); font-family: var(--font-serif); font-weight: 400; font-size: 22px; line-height: 1.25; color: var(--text-strong); }
.product-card__cat { margin-top: 2px; }
.stock-flag {
  position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  background: var(--cream); color: var(--olive-900); padding: 3px 8px;
}

/* Price: amount in Archivo, previous price struck through in graphite. */
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-top: var(--sp-2); font-weight: 500; }
.price__now { font-size: 17px; }
.price__was { color: var(--text-muted); text-decoration: line-through; font-size: var(--fs-small); font-weight: 400; }
.price--lg .price__now { font-size: 24px; }

.list-more { display: flex; justify-content: center; margin-top: var(--sp-16); }


/* ---- Product detail ------------------------------------------------------ */
.pdp { padding-top: calc(var(--header-h) + var(--sp-8)); }
.pdp__grid { row-gap: var(--sp-12); margin-top: var(--sp-6); }
.pdp__gallery { grid-column: 1 / -1; display: grid; gap: var(--sp-3); }
.pdp__info { grid-column: 1 / -1; display: grid; gap: var(--sp-6); align-content: start; }
@media (min-width: 1024px) {
  .pdp__gallery { grid-column: 1 / span 7; }
  .pdp__info { grid-column: 9 / span 4; position: sticky; top: calc(68px + var(--sp-8)); align-self: start; }
}
.gallery__main { aspect-ratio: 4 / 5; overflow: hidden; background: var(--stone); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.gallery__thumbs button { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid transparent; background: var(--stone); cursor: pointer; overflow: hidden; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--olive-500); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.pdp__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.stock-line { font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.stock-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage-grey); }
.stock-line[data-status="in_stock"]::before, .stock-line[data-status="made_to_order"]::before { background: var(--success); }
.stock-line[data-status="out_of_stock"]::before { background: var(--error); }

.qty { display: inline-grid; grid-template-columns: 44px 56px 44px; height: 48px; border: var(--hairline); }
.qty button { background: none; border: 0; font-size: 20px; cursor: pointer; }
.qty button:disabled { color: var(--sage-grey); cursor: not-allowed; }
.qty input { text-align: center; border: 0; border-inline: var(--hairline); background: transparent; font-size: 16px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.buy-row .btn { flex: 1 1 200px; }
.buy-note { font-size: var(--fs-small); color: var(--text-muted); }

.pdp__details { margin-top: var(--section-y); }
