/* Карточка товара и расширенная корзина. Основная палитра наследуется от сайта. */
.card .ph[data-detail],.card h3[data-detail]{cursor:pointer}
.card .desc{display:none;flex:0}
.card-photo-button{width:100%;border:0;padding:0;color:inherit}
.title-detail{border:0;background:none;color:inherit;font:inherit;font-weight:inherit;text-align:left;padding:0}
.title-detail:hover{color:var(--brand-dk)}
.card .actions-row{display:flex;align-items:center;gap:8px;margin-top:10px;flex-shrink:0}
.card .foot{margin-top:auto}
.card .buy{flex:1;width:100%}
.card .buy{font-size:12.5px;line-height:1.2;padding:9px 10px;min-height:36px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}
.card .price{display:flex;flex-direction:column;align-items:flex-end;gap:0;margin-left:auto;line-height:1}
.card .old-price{position:relative;display:inline-block;margin-left:0;font-size:11px;color:#2f2925;font-weight:700;line-height:1.1;text-decoration:none;margin-bottom:2px}
.card .old-price::after{content:"";position:absolute;left:-2px;right:-2px;top:50%;height:2.5px;background:#e00000;transform:rotate(-12deg);transform-origin:center;border-radius:1px;pointer-events:none}
.card .price .now-price{font-size:22px;font-weight:900;color:#45B88B;line-height:1.05}
.card .discount-pill{position:absolute;top:10px;right:10px;background:var(--brand);color:#fff;border-radius:100px;padding:4px 8px;font-size:11px;font-weight:800}
.card .discount-pill{display:none}

.product-dialog{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);margin:0;width:min(1120px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);border:0;border-radius:18px;padding:0;background:var(--surface);color:var(--ink);box-shadow:0 24px 80px rgba(30,20,16,.35);overflow:hidden;box-sizing:border-box}
.product-dialog::backdrop,.zoom-dialog::backdrop{background:rgba(30,20,16,.64);backdrop-filter:blur(2px)}
.product-close{position:absolute;right:12px;top:12px;z-index:5;width:38px;height:38px;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);font-size:17px;line-height:1;box-shadow:var(--shadow-sm)}
.product-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr);min-height:600px;width:100%;min-width:0}
.gallery{padding:18px;background:#f8f3ea;border-radius:18px 0 0 18px;min-width:0}
.gallery-main{position:relative;aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;border-radius:14px;overflow:hidden;background:transparent}
.gallery-zoom{width:100%;height:100%;border:0;background:transparent;padding:0;display:flex;align-items:center;justify-content:center}
.gallery-zoom img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 0 0.5px rgba(110,78,45,.4))}
.gallery-placeholder{font-size:84px;opacity:.45}
.gallery-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:2;width:42px;height:42px;border:1px solid var(--line);background:rgba(255,255,255,.94);border-radius:50%;font-size:28px;line-height:1;color:var(--ink-soft);box-shadow:var(--shadow-sm)}
.gallery-arrow:hover{color:var(--brand);border-color:#dfb3c1}
.gallery-arrow.prev{left:12px}.gallery-arrow.next{right:12px}
.gallery-thumbs{display:flex;justify-content:center;gap:10px;margin-top:14px;overflow-x:auto;padding:2px}
.gallery-thumbs button{width:70px;height:70px;flex:0 0 70px;padding:0;border:2px solid transparent;border-radius:9px;background:#fff;overflow:hidden}
.gallery-thumbs button.on{border-color:var(--brand)}
.gallery-thumbs img{width:100%;height:100%;object-fit:cover}
.product-info{padding:38px 42px;overflow-y:auto;overflow-x:hidden;max-height:min(760px,calc(100vh - 42px));min-width:0;box-sizing:border-box}
.product-info h2{text-align:center;font-size:clamp(25px,3vw,36px);line-height:1.25;margin-bottom:8px}
.product-title-link{color:inherit;text-decoration:none;display:inline}
.product-title-link[href]{cursor:pointer}
.product-title-link[href]:hover{color:var(--brand-dk);text-decoration:underline}
.product-buyrow{display:flex;align-items:center;gap:14px}
.product-art{font-size:13.5px;color:#5a351d;font-weight:900;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap}
.product-prices{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.product-price-now{font-size:28px;font-weight:900;color:#45B88B}
.product-price-old{font-size:21px;color:#2f2925;text-decoration-line:line-through;text-decoration-color:#e00000;text-decoration-thickness:3px;font-weight:800}
.product-discount{display:none}
.product-note{font-size:11.5px;color:var(--ink-faint)}
.product-desc{font-size:14px;color:var(--ink-soft);margin:20px 0;padding-bottom:20px;border-bottom:1px solid var(--line);white-space:pre-line}
.product-options{display:grid;gap:13px}
.product-option label{display:block;font-size:13px;font-weight:700;margin-bottom:5px}
.product-option label span{color:var(--brand)}
.product-option select{width:100%;padding:12px 14px;border:1.5px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);font:inherit;font-size:14px;outline:none}
.product-option select:focus{border-color:var(--brand)}
.product-option.invalid select{border-color:var(--brand);background:#fff6f8}
.product-controls{margin-top:20px}
.product-qty{display:flex;align-items:center;border:1px solid var(--line);border-radius:10px;overflow:hidden;flex-shrink:0}
.product-qty button{width:42px;height:46px;border:0;background:var(--bg);font-size:18px}
.product-qty span{width:38px;text-align:center;font-weight:800}
.product-add{width:100%;margin-top:14px}
.product-total{font-size:14px;margin-left:auto}.product-total strong{font-size:21px;margin-left:5px}
.option-error{color:var(--brand);background:var(--brand-lt);border-radius:8px;padding:8px 10px;font-size:13px;font-weight:700;margin-top:9px}
.marketplaces{border-top:1px solid var(--line);margin-top:22px;padding-top:17px}
.marketplaces>span{display:block;text-align:center;font-size:16px;font-weight:700;color:var(--ink-soft);margin-bottom:12px}
.marketplaces>div{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px;flex-wrap:nowrap}
.marketplaces>div a{flex:1 1 0;width:auto;max-width:112px;min-width:0;height:auto;aspect-ratio:1;display:flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;border-radius:0;overflow:visible}
.marketplaces>div a img{display:block;width:100%;height:auto;aspect-ratio:1;max-width:none;max-height:none;object-fit:contain;border-radius:26px}
.marketplaces>div a:nth-child(4) img{border:2px solid #01a8fe}
@media(max-width:520px){.marketplaces>div{width:100%;gap:6px}.marketplaces>div a{max-width:none}.marketplaces>div a img{border-radius:18px}}
.market-link{height:46px;width:100%;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:9px;background:#fff;overflow:hidden;padding:0 12px;transition:.2s}
.market-link:hover{transform:translateY(-1px);box-shadow:var(--shadow-sm)}
.market-link img{max-width:150px;max-height:36px;object-fit:contain}

.zoom-dialog{width:min(1100px,calc(100% - 28px));height:min(900px,calc(100% - 28px));max-width:none;max-height:none;border:0;border-radius:14px;padding:18px;background:#fff}
.zoom-dialog img{width:100%;height:100%;object-fit:contain}
.zoom-dialog button{position:absolute;top:12px;right:12px;width:40px;height:40px;border:1px solid var(--line);border-radius:50%;background:#fff;font-size:17px;box-shadow:var(--shadow-sm)}

.cart-totals{display:grid;gap:6px;margin-bottom:14px;font-size:13px}
.cart-total-line{display:flex;justify-content:space-between;gap:14px}
.cart-total-line.discount{color:var(--brand-dk)}
.cart-total-line.final{font-size:16px;font-weight:800;border-top:1px solid var(--line);padding-top:8px;margin-top:3px}
.ci .choices{display:block;margin:4px 0;color:var(--ink-soft);line-height:1.45}
.ci .line-total{display:block;color:var(--ink);font-weight:700;margin-top:2px}
.send-error{color:var(--brand);font-size:13px;font-weight:700;background:var(--brand-lt);padding:10px;border-radius:8px;margin-top:10px}

/* Корзина: крупнее фото, аккуратная кнопка удаления и отдельное количество. */
.ci .thumb{width:68px;height:88px;border-radius:9px}
.ci .rm{width:30px!important;height:30px!important;background:var(--bg)!important;border:1px solid var(--line)!important;border-radius:8px!important;color:var(--brand-dk);display:flex;align-items:center;justify-content:center;align-self:center;padding:0!important;cursor:pointer}
.ci .rm svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ci .rm:hover{background:var(--brand-lt)!important;border-color:#eccdd7!important;color:var(--brand-dk)}

@media(max-width:760px){
  /* clip не ломает position:sticky у шапки (в отличие от overflow-x:hidden) */
  html,body{overflow-x:clip;overscroll-behavior-x:none;width:100%;max-width:100%}
  .layout,main,.grid,.cat-head,.crumb{max-width:100%;min-width:0}
  .product-dialog{left:50%;top:50%;width:calc(100vw - 12px);max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px);max-height:calc(100vh - 12px);overflow-x:hidden;overflow-y:auto}
  .product-layout{grid-template-columns:minmax(0,1fr);min-height:0;width:100%;overflow:hidden}
  .gallery{padding:8px 0 0;border-radius:14px 14px 0 0;background:#f8f3ea}
  .gallery-main{width:100%;aspect-ratio:auto;max-height:30vh;height:auto;border-radius:0;margin:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
  .gallery-zoom{width:100%;height:100%;max-height:30vh;display:flex;align-items:center;justify-content:center}
  .gallery-zoom img{width:auto;max-width:100%;height:auto;max-height:30vh;object-fit:contain;object-position:center;display:block;margin:0 auto}
  .gallery-thumbs{gap:6px;margin-top:6px;padding:0 10px 8px;justify-content:center;box-sizing:border-box}
  .gallery-thumbs button{width:40px;height:40px;flex-basis:40px}
  .gallery-arrow{width:34px;height:34px;font-size:22px}
  .gallery-arrow.prev{left:8px}.gallery-arrow.next{right:8px}
  .product-info{width:100%;padding:10px 14px 12px;max-height:none;overflow:visible;min-width:0}
  .product-info h2{font-size:clamp(20px,5vw,24px);line-height:1.15;margin-bottom:4px;overflow-wrap:anywhere}
  .product-art{font-size:12px}
  .product-desc{font-size:12.5px;margin:8px 0;padding-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .product-options{gap:8px}
  .product-option label{font-size:12px;margin-bottom:3px}
  .product-option select{padding:8px 10px;font-size:13px}
  .product-controls{margin-top:8px;flex-wrap:wrap;justify-content:space-between}
  .product-qty button{width:34px;height:36px;font-size:15px}
  .product-qty span{width:30px}
  .product-total{font-size:13px}.product-total strong{font-size:17px}
  .product-add{margin-top:8px;padding-top:10px;padding-bottom:10px}
  .product-close{right:8px;top:8px;width:34px;height:34px;font-size:15px}
  .marketplaces{margin-top:10px;padding-top:8px}
  .marketplaces>span{font-size:12px;margin-bottom:6px}
  .marketplaces>div{gap:10px;justify-content:center}
  .marketplaces>div a{flex:0 0 auto;max-width:72px;width:72px;min-width:72px;height:72px;aspect-ratio:1/1}
  .marketplaces>div a img{width:72px;height:72px;max-width:72px;max-height:72px;border-radius:16px}
}
@media(max-width:520px){
  .marketplaces>div{width:100%;gap:10px;justify-content:center;overflow:hidden}
  .marketplaces>div a{flex:0 0 auto;max-width:72px;width:72px;min-width:72px;height:72px;aspect-ratio:1/1}
  .marketplaces>div a img{width:72px;height:72px;max-width:72px;max-height:72px;border-radius:16px}
}
@media(max-width:360px){
  .marketplaces>div{gap:8px}
  .marketplaces>div a{max-width:64px;width:64px;min-width:64px;height:64px}
  .marketplaces>div a img{width:64px;height:64px;max-width:64px;max-height:64px;border-radius:14px}
  .gallery-main{max-height:26vh}
  .gallery-zoom{max-height:26vh}
  .gallery-zoom img{max-height:26vh}
}
@media(max-width:460px){
  .card .actions-row{flex-direction:column}.card .actions-row .details,.card .actions-row .buy{width:100%}
  .product-buyrow{flex-direction:row}.product-controls{align-items:center}.product-qty{align-self:flex-start}
  .gallery-arrow{width:36px;height:36px}
}
@media(max-width:1100px){.card .details,.card .buy{font-size:12px}}
@media(max-width:600px){.card .details,.card .buy{font-size:11px;padding:8px}}
