/* store.css: catalog, product page, fabrics, cart. */

/* ---------- Search ---------- */
.search { display: flex; gap: 8px; width: min(100%, 380px); }
.search input { flex: 1; min-width: 0; }
.result-line { margin: -8px 0 16px; }

/* ---------- Grids ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 768px) { .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; } }

.product-card, .fabric-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    text-align: left;
    font: inherit;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.product-card:hover, .fabric-card:hover { border-color: #c9c6bf; box-shadow: 0 6px 18px rgba(29, 28, 26, .08); }
.product-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #faf9f7; border-radius: 6px; }
.fabric-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.product-card h2, .fabric-card h2 { font-size: .98rem; }
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 8px; margin-top: auto; }
.card-foot .price { white-space: nowrap; font-size: .95rem; }
.price { font-weight: 200; } 
/* ----------  font-weight: 700; ---------- */
.price-lg { font-size: 1.6rem; margin: 4px 0 12px; }
.rating { color: #b06f00; font-weight: 600; font-size: .9rem; }

.tag { display: inline-block; padding: 3px 9px; border-radius: 5px; font-size: .8rem; font-weight: 600; }
.tag-in { background: var(--ok-bg); color: var(--ok); }
.tag-out { background: #fbe4e1; color: #8f2a22; }
.product-card .tag-out { position: absolute; top: 20px; left: 20px; }

/* ---------- Product page ---------- */
.detail { display: grid; gap: 24px; padding: 20px; }
@media (min-width: 820px) { .detail { grid-template-columns: 1.15fr 1fr; gap: 36px; padding: 28px; } }
.info h1 { margin-bottom: 6px; }
.info .desc { color: #4a4843; margin: 16px 0 20px; max-width: 60ch; }

.gallery { display: flex; flex-direction: column-reverse; gap: 10px; }
@media (min-width: 820px) { .gallery { flex-direction: row; } }
.stage { flex: 1; display: grid; place-items: center; background: #faf9f7; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 280px; }
.stage img { max-height: 440px; width: auto; max-width: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
@media (min-width: 820px) { .thumbs { flex-direction: column; overflow: visible; } }
.thumb { flex: none; width: 56px; height: 56px; padding: 2px; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.thumb:hover { border-color: #b9b6af; }
.thumb.is-active { border-color: var(--ink); }

.buy { margin: 18px 0 10px; }
.qty { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-weight: 600; font-size: .92rem; }
.qty input { width: 84px; text-align: center; }
.btn-3d { margin: 4px 0 6px; }
.btn-3d img { filter: brightness(0) invert(1); }
.info .btn-block { margin-top: 8px; }

/* ---------- Fabrics ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; padding: 14px 16px; margin-bottom: 20px; }
.filter { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); flex: 1 1 170px; max-width: 240px; }
.filter select { color: var(--text); font-weight: 400; font-size: .95rem; }
.filters-clear { padding: 10px 4px; font-weight: 600; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { padding: 2px 8px; border-radius: 5px; background: #efeeea; color: #45433f; font-size: .76rem; font-weight: 600; }
.chip-shade { background: #fbe9d4; color: #8a4b00; }
.chip-light { background: #e2ecf6; color: #17457a; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(29, 28, 26, .65); overflow-y: auto; }
.modal-box { position: relative; width: min(860px, 100%); display: grid; gap: 22px; padding: 22px; margin: auto; }
@media (min-width: 760px) { .modal-box { grid-template-columns: 1.1fr 1fr; } }
.modal-close { position: absolute; top: 8px; right: 10px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-close:hover { color: var(--ink); background: #f0efec; }
.modal .stage { min-height: 240px; }
.modal .stage img { max-height: 340px; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; font-size: .94rem; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }
body.modal-open { overflow: hidden; }

/* ---------- Cart (lines live in cart.css) ---------- */
.cart-layout { display: grid; gap: 20px; align-items: start; }
@media (min-width: 900px) { .cart-layout { grid-template-columns: 1.5fr 1fr; } .checkout { position: sticky; top: 76px; } }
.lines { list-style: none; margin: 0; padding: 0; }
.qty-input { width: 72px; text-align: center; padding: 8px; }
.line-title { font-weight: 650; font-size: 1rem; text-decoration: none; }
.line-title:hover { text-decoration: underline; }
.clear-form { margin-top: 14px; }
.checkout h2 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.checkout > p { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.total { font-size: 1.4rem; font-weight: 700; }
.buy-hint { margin: 8px 0 0; text-align: center; }

/* ---------- Quick add-to-cart on catalog cards ---------- */
.product-item { position: relative; display: flex; flex-direction: column; }
.product-item > .product-card { flex: 1; }
.quick-add { position: absolute; bottom: 12px; right: 12px; margin: 0; }
.product-item .card-foot { min-height: 38px; align-items: center; padding-right: 46px; }
.quick-add button {
    width: 38px; height: 38px; display: grid; place-items: center; padding: 0;
    border-radius: 50%; border: 1px solid var(--accent-dark); background: var(--accent); color: var(--ink);
    box-shadow: 0 2px 8px rgba(29, 28, 26, .18); cursor: pointer;
}
.quick-add button:hover { background: var(--accent-dark); }
.quick-add button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.quick-add svg { width: 20px; height: 20px; }

/* ---------- Product photo: click to view full screen (lightbox.js) ---------- */
.stage { position: relative; }
.stage img[data-stage], img[data-zoom] { cursor: zoom-in; }
.zoom-hint {
    position: absolute; right: 10px; bottom: 10px; pointer-events: none;
    padding: 4px 11px; border-radius: 999px; background: rgba(29, 28, 26, .78); color: #fff; font-size: .78rem; font-weight: 600;
}
.lb { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #0c0b0a; color: #fff; }
.lb[hidden] { display: none; }
.lb-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.lb-count { margin-right: auto; font-weight: 600; font-size: .95rem; opacity: .85; }
.lb-btn { border: 0; border-radius: 999px; padding: 9px 18px; background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lb-close { width: 44px; height: 44px; padding: 0; font-size: 1.9rem; line-height: 1; }
.lb-view { overflow: auto; display: grid; place-items: center; min-height: 0; min-width: 0; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; -webkit-user-select: none; }
.lb.is-zoomed .lb-view { place-items: start center; }
.lb.is-zoomed .lb-img { width: 100%; max-width: none; max-height: none; height: auto; cursor: zoom-out; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: 2.1rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 4px; }
.lb-nav:hover { background: rgba(255, 255, 255, .28); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-strip { display: flex; gap: 8px; justify-content: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); overflow-x: auto; }
.lb-strip[hidden] { display: none; }
.lb-thumb { flex: none; width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; opacity: .6; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumb.is-active { border-color: var(--accent); opacity: 1; }
@media (max-width: 600px) { .lb-nav { width: 40px; height: 40px; } .lb-prev { left: 6px; } .lb-next { right: 6px; } }

/* ---------- Catalog extras ---------- */
.tagline { margin: 2px 0 0; }
.card-cta { font-size: .85rem; font-weight: 700; color: var(--head); white-space: nowrap; }
.product-card:hover .card-cta { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Warranty note and page ---------- */
.warranty { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #faf9f7; }
.warranty svg { flex: none; color: var(--ok); margin-top: 2px; }
.warranty strong { color: var(--head); }
.warranty p { margin: 2px 0 6px; font-size: .94rem; }
.warranty a { font-weight: 600; font-size: .9rem; }
.prose { max-width: 72ch; }
.prose .lead { font-size: 1.08rem; }
.prose h2 { margin: 22px 0 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfccc5; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); margin-top: 20px; }
.foot { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: space-between; align-items: flex-start; font-size: .92rem; }
.foot-brand { display: flex; flex-direction: column; gap: 2px; }
.foot-brand strong { color: #fff; letter-spacing: .14em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: #e9e6df; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot-contact { margin: 0; flex-basis: 100%; }
