/* =====================================================================
   Florista — магазин: карточки, окно товара, корзина, оформление.
   Использует токены цвета страницы (--bg, --ink, --gold…).
   ===================================================================== */

/* ---------- Кнопка корзины в шапке ---------- */
.cart-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink); background: rgba(26,24,20,.35); transition: border-color .3s; cursor: pointer; }
.cart-btn:hover { border-color: var(--gold); }
.cart-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cart-btn b { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--gold); color: #1a1814; font: 600 11px/20px var(--sans); text-align: center; }
.cart-btn b:empty, .cart-btn b[data-n="0"] { display: none; }
.cart-btn.bump { animation: cartBump .5s var(--ease); }
@keyframes cartBump { 30% { transform: scale(1.15); } }

/* ---------- Сетка товаров ---------- */
.pgrid { display: grid; gap: 20px 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 22px; } }
@media (min-width: 1200px) { .pgrid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcard { position: relative; display: flex; flex-direction: column; text-align: left; color: inherit; text-decoration: none; }
.pcard .pimg { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--bg-3); }
.pcard .pimg img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), opacity .5s; }
.pcard:hover .pimg img { transform: scale(1.05); }
.pcard .ptag { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 100px; font-size: 11px; letter-spacing: .06em;
  background: rgba(26,24,20,.75); color: var(--gold-2); backdrop-filter: blur(4px); }
.pcard .pbody { padding-top: 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pcard .ptitle { font-family: var(--serif); font-size: 22px; line-height: 1.15; padding: 6px 0 4px; }   /* крупнее зона нажатия на телефоне */
.pcard .pmeta { font-size: 12px; color: var(--ink-3); }
.pcard .prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.pcard .pprice { font-size: 16px; font-weight: 500; white-space: nowrap; }
.pcard .pprice s { color: var(--ink-3); font-weight: 300; font-size: 13px; margin-left: 6px; }
.padd { flex: none; min-height: 40px; padding: 0 14px; border-radius: 100px; border: 1px solid rgba(201,168,120,.5); color: var(--gold-2);
  font: 500 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; background: none; cursor: pointer; transition: all .3s var(--ease); }
.padd:hover { background: var(--gold); color: #1a1814; border-color: var(--gold); }
.padd.done { background: var(--gold); color: #1a1814; }
@media (max-width: 480px) { .pcard .prow { flex-direction: column; align-items: stretch; } .padd { width: 100%; } .pcard .ptitle { font-size: 19px; } }

/* ---------- Витрина на главной ---------- */
.showcase-foot { display: flex; justify-content: center; margin-top: 44px; }

/* ---------- Панели: окно товара и корзина ---------- */
.shop-layer { position: fixed; inset: 0; z-index: 120; visibility: hidden; }
.shop-layer.open { visibility: visible; }
.shop-dim { position: absolute; inset: 0; background: rgba(12,11,9,.72); opacity: 0; transition: opacity .4s var(--ease); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.shop-layer.open .shop-dim { opacity: 1; }
.shop-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); display: flex; flex-direction: column;
  background: var(--bg-2); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .5s var(--ease); }
.shop-layer.open .shop-panel { transform: none; }
.shop-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.shop-head h3 { flex: 1; font: 400 28px/1.1 var(--serif); }
.shop-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); background: none; cursor: pointer; font-size: 16px; }
.shop-x:hover { border-color: var(--gold); }
.shop-back { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); background: none; border: 0; cursor: pointer; padding: 10px 0; }
.shop-body { flex: 1; overflow-y: auto; padding: 20px; overscroll-behavior: contain; }
.shop-foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg-2); }
.shop-foot .btn { width: 100%; }
.shop-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 14px; color: var(--ink-2); }
.shop-total b { font: 500 26px/1 var(--sans); color: var(--ink); }
.shop-note { font-size: 13px; color: var(--ink-2); padding: 12px 14px; border-left: 2px solid var(--gold); background: var(--bg); margin-bottom: 14px; }
.shop-note b { color: var(--ink); font-weight: 500; }

/* Окно товара: крупнее, по центру на компьютере */
.pview .shop-panel { width: min(980px, 100vw); }
@media (min-width: 900px) {
  .pview .shop-panel { top: 50%; left: 50%; right: auto; bottom: auto; height: min(680px, calc(100vh - 48px)); border: 1px solid var(--line);
    transform: translate(-50%, calc(-50% + 30px)); opacity: 0; transition: transform .5s var(--ease), opacity .4s; flex-direction: row; }
  .pview.open .shop-panel { transform: translate(-50%, -50%); opacity: 1; }
}
.pv-media { position: relative; background: var(--bg-3); flex: none; }
.pv-close { position: absolute; top: 14px; right: 14px; z-index: 3; background: rgba(26,24,20,.7); backdrop-filter: blur(6px); }
@media (max-width: 899px) { .pv-slides img { max-height: 52vh; } .pv-slides { height: auto; } }
.pv-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; height: 100%; }
.pv-slides::-webkit-scrollbar { display: none; }
.pv-slides img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; aspect-ratio: 4 / 5; }
.pv-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.pv-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(239,231,220,.4); }
.pv-dots i.on { background: var(--ink); }
@media (min-width: 900px) { .pv-media { width: 52%; } .pv-slides img { aspect-ratio: auto; } }
.pv-info { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pv-info .shop-body { padding: 24px 24px 12px; }
.pv-title { font: 400 clamp(34px, 5vw, 44px)/1.05 var(--serif); margin: 6px 0 10px; }
.pv-price { font-size: 24px; font-weight: 500; }
.pv-price s { font-size: 15px; color: var(--ink-3); font-weight: 300; margin-left: 8px; }
.pv-text { color: var(--ink-2); font-size: 15px; margin: 14px 0; }
.pv-comp { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.pv-label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 10px; }
.sizes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.size { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-align: left; color: var(--ink); cursor: pointer; transition: border-color .25s; }
.size small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.size.sel { border-color: var(--gold); background: rgba(201,168,120,.08); }
.pv-perks { display: grid; gap: 8px; margin-top: 20px; font-size: 13px; color: var(--ink-2); }
.pv-perks span::before { content: "— "; color: var(--gold); }

/* ---------- Корзина ---------- */
.cline { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cline .th { width: 64px; height: 80px; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); display: grid; place-items: center; }
.cline .th img { width: 100%; height: 100%; object-fit: cover; }
.cline .th svg, .addon svg { width: 28px; height: 28px; fill: none; stroke: var(--gold); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.cline .nm { font-family: var(--serif); font-size: 19px; line-height: 1.15; }
.cline .sz { font-size: 12px; color: var(--ink-3); }
.cline .pr { font-weight: 500; text-align: right; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 100px; margin-top: 6px; }
.qty button { width: 32px; height: 32px; background: none; border: 0; color: var(--ink); cursor: pointer; font-size: 16px; }
.qty span { min-width: 22px; text-align: center; font-size: 14px; }
.cdel { font-size: 12px; color: var(--ink-3); background: none; border: 0; cursor: pointer; text-decoration: underline; margin-top: 6px; display: block; margin-left: auto; }
.addons { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.addons::-webkit-scrollbar { display: none; }
.addon { flex: none; width: 128px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-align: left; color: var(--ink); cursor: pointer; transition: border-color .25s; }
.addon:hover { border-color: rgba(201,168,120,.55); }
.addon.in { border-color: var(--gold); background: rgba(201,168,120,.08); }
.addon b { display: block; font-weight: 400; font-size: 13px; line-height: 1.25; margin: 8px 0 4px; min-height: 32px; }
.addon span { font-size: 13px; color: var(--gold-2); }
.cart-empty { text-align: center; padding: 50px 10px; color: var(--ink-2); }
.cart-empty p { font: 400 26px/1.2 var(--serif); color: var(--ink); margin-bottom: 8px; }

/* ---------- Оформление ---------- */
.co { display: grid; gap: 12px; }
.co h4 { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 500; margin: 16px 0 2px; }
.co h4:first-child { margin-top: 0; }
.cf { display: block; }
.cf > span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.cf input, .cf select, .cf textarea { width: 100%; min-height: 50px; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); outline: none; transition: border-color .25s; }
.cf textarea { min-height: 84px; resize: vertical; }
.cf select { color-scheme: dark; }
.cf input[type="date"] { color-scheme: dark; }
.cf input:focus, .cf select:focus, .cf textarea:focus { border-color: var(--gold); }
.cf.err input { border-color: #d7836f; }
.co .two { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.co .four { display: grid; gap: 8px; grid-template-columns: repeat(4, 1fr); }
.cchips { display: flex; flex-wrap: wrap; gap: 8px; }
.cchip { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 100px; background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; transition: all .25s; }
.cchip.sel { border-color: var(--gold); background: rgba(201,168,120,.12); color: var(--gold-2); }
.cchip:disabled { opacity: .35; cursor: default; }
.ccheck { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.ccheck input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold); flex: none; }
.co-err { color: #e59a88; font-size: 14px; margin-bottom: 10px; }
.co-sum { font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; margin-bottom: 12px; }
.co-sum div { display: flex; justify-content: space-between; gap: 10px; }
.co-done { text-align: center; padding: 30px 6px; }
.co-done .no { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.co-done h3 { font: 400 36px/1.1 var(--serif); margin: 12px 0 14px; }
.co-done p { color: var(--ink-2); margin-bottom: 10px; }
.co-done .btn { width: 100%; margin-top: 10px; }

/* Спиннер для кнопок (если на странице его нет) */
.shop-spin { width: 18px; height: 18px; border: 2px solid rgba(26,24,20,.3); border-top-color: #1a1814; border-radius: 50%; animation: shopSpin .8s linear infinite; }
@keyframes shopSpin { to { transform: rotate(360deg); } }
.shop-toast { position: fixed; z-index: 130; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 18px; border-radius: 100px;
  background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.45); max-width: calc(100vw - 32px); text-align: center; }
@media (prefers-reduced-motion: reduce) { .shop-panel, .shop-dim, .pcard .pimg img { transition: none !important; } }
