/* Account, checkout steps, filters and pager (platform-connected storefront) */
.account-box { grid-template-columns: minmax(0, 640px); justify-content: center; }
.account-box section > form + h2, .account-box section > h2 { margin-top: 34px; }
.account-box .collection-tabs { margin: 0 0 24px; justify-content: flex-start; }
.account-box .button { margin-top: 18px; }
.form-success { background: #eef3ea; color: #3c5a35; padding: 12px 14px; margin: 14px 0; font-size: .85rem; }
.text-button { background: none; border: 0; cursor: pointer; color: var(--brown); margin-top: 14px; text-transform: none; letter-spacing: 0; }
.text-button:disabled { opacity: .45; cursor: default; }
.book { list-style: none; margin: 10px 0; padding: 0; border-top: 1px solid var(--line); }
.book li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.book li > span:last-of-type { color: var(--muted); text-align: end; }
.inline-form { border: 1px solid var(--line); padding: 18px; margin: 12px 0; background: var(--cream); }
.inline-actions { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 8px; }
.inline-actions .button, .inline-actions .text-button { margin-top: 0; }
.form-note.full { grid-column: 1 / -1; }
.account-link { position: relative; }
.account-dot { position: absolute; top: 4px; inset-inline-end: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--brown); }
.filter-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin: -14px 0 26px; font-size: .78rem; color: var(--muted); }
.price-filter { display: flex; align-items: center; gap: 8px; }
.price-filter input { width: 86px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 4px 2px; font: inherit; }
.check { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { accent-color: var(--brown); }
.filter-row .text-button { margin-top: 0; }
.products-grid.is-loading { opacity: .5; transition: opacity .15s; }
.pager { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: 44px; font-size: .8rem; }
.pager .text-button { margin-top: 0; }
@media (max-width: 700px) { .filter-row { margin-top: 0; gap: 12px; } .price-filter input { width: 70px; } }

/* Filter panel (category tree + facets) */
.catalog-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 38px; align-items: start; }
.filter-panel { position: sticky; top: 16px; display: grid; gap: 4px; font-size: .8rem; max-height: calc(100vh - 32px); overflow: auto; padding-inline-end: 6px; }
.filter-panel-head { display: flex; justify-content: space-between; align-items: center; }
.filter-panel-head h2 { font-size: 1.1rem; margin: 0 0 6px; }
.filter-close, .filter-toggle, .filter-apply, .filter-overlay { display: none; }
.facet { border-bottom: 1px solid var(--line); padding: 10px 0; }
.facet > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: .8px; font-size: .68rem; color: var(--ink); }
.facet > summary::-webkit-details-marker { display: none; }
.facet-count { background: var(--brown); color: #fff; border-radius: 9px; font-size: .62rem; padding: 1px 7px; font-weight: 400; }
.facet ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; max-height: 280px; overflow: auto; }
.facet label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink); }
.facet label small { margin-inline-start: auto; color: var(--muted); }
.facet label.is-empty { color: var(--muted); opacity: .55; cursor: default; }
.facet input[type=checkbox] { accent-color: var(--brown); }
.subfacet { margin: 7px 0 2px !important; padding-inline-start: 22px !important; gap: 5px !important; }
.filter-panel .price-filter { margin-top: 10px; }
.filter-panel .check { padding: 8px 0; }
.catalog-results { min-width: 0; }
@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filter-toggle { display: flex; }
  .filter-panel { position: fixed; z-index: 60; inset-block: 0; inset-inline-start: 0; width: min(340px, 90vw); max-height: none; background: var(--paper, #faf8f4); padding: 18px; transform: translateX(-105%); transition: transform .25s; box-shadow: 0 0 30px #0003; }
  html[dir=rtl] .filter-panel { transform: translateX(105%); }
  .filter-panel.open { transform: none; }
  .filter-close, .filter-apply { display: inline-flex; }
  .filter-overlay { display: block; z-index: 55; }
}

.account-tabs { flex-wrap: wrap; gap: 8px 26px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.account-tabs a { font-size: .8125rem; letter-spacing: .6px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid transparent; }
.account-tabs a.active { color: var(--ink); border-color: var(--brown); }

/* ---- Stable layout while data loads: reserve the boxes first, then fill them (no jumping) ---- */
.catalog-results { min-height: 70vh; }
.product-card.is-skeleton .product-photo { position: relative; }
.product-card.is-skeleton .product-photo .sk { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border-radius: 0; }
.product-card.is-skeleton .product-info { display: grid; gap: 0; }
.product-card.is-skeleton .product-material { margin: 6px 0 10px; line-height: 1; }
.product-card.is-skeleton .sk { display: block; }
.facet-skeleton { display: grid; gap: 14px; padding: 14px 0 18px; border-bottom: 1px solid var(--line); }
.facet-skeleton .sk { display: block; }
.sk-title { display: block; height: 1.17em; margin: 0 auto; }
.page-heading h1 { min-height: 1.17em; }
.result-count { display: inline-block; min-width: 56px; }
/* Real cards fade in (opacity only: it never changes a size) */
.products-grid .product-card:not(.is-skeleton) { animation: card-in .35s ease both; }
@keyframes card-in { from { opacity: 0; } to { opacity: 1; } }
.products-grid.is-loading { transition: opacity .2s ease; }
@media (prefers-reduced-motion: reduce) { .products-grid .product-card:not(.is-skeleton) { animation: none; } }

/* ---- Product gallery slider (scroll-snap: swipe, trackpad, keys) ---- */
.slider { position: relative; width: 100%; height: 100%; }
.slider-track { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; outline-offset: -2px; }
.slider-track::-webkit-scrollbar { display: none; }
.slider-slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.slider > .slide-link, .slider-slide .slide-link { display: block; width: 100%; height: 100%; }
.slider img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; user-select: none; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .88); color: var(--ink); display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s ease, background .2s ease; padding: 0; }
.slider-btn svg { width: 17px; height: 17px; }
.slider-btn.prev { inset-inline-start: 10px; }
.slider-btn.next { inset-inline-end: 10px; }
.slider-btn.prev svg { transform: rotate(180deg); }
[dir="rtl"] .slider-btn.prev svg { transform: none; }
[dir="rtl"] .slider-btn.next svg { transform: rotate(180deg); }
.slider-btn:disabled { visibility: hidden; }
/* Cards: the arrows exist only while the pointer is over the photo (or the keyboard is inside it). A click leaves focus on the button, so :focus-within would keep them visible; :focus-visible does not. */
.product-photo:hover .slider-btn, .slider:has(:focus-visible) .slider-btn { opacity: 1; pointer-events: auto; }
.product-detail-image .slider-btn { opacity: 1; pointer-events: auto; }
.slider-dots { position: absolute; inset-inline: 0; bottom: 10px; z-index: 2; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.slider-dots button { pointer-events: auto; width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: rgba(48, 43, 37, .28); cursor: pointer; transition: background .2s ease, transform .2s ease; }
.slider-dots button.active { background: var(--ink); transform: scale(1.25); }
.product-photo .slider-dots { transition: bottom .3s ease; }
.product-photo:hover .slider-dots { bottom: 54px; }
.product-photo:hover .quick-add { z-index: 3; }
@media (hover: none) { .slider-btn { display: none; } }
