/* 212 XP — conversion features: delivery, COD, reviews, gallery, WhatsApp */

:root { --whatsapp: #25d366; --whatsapp-ink: #04240f; --gold: #ffd36b; --warn: #ffcf8a; }

/* ---------- Stock urgency & ratings ---------- */
.stock.is-low { border-color: #8a6a35; background: #3a2c16; color: var(--warn); }
.stock.is-low::before { animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot { 50% { opacity: .35; } }
.stars { position: relative; display: inline-block; line-height: 1; letter-spacing: 1px; font-size: .95rem; }
.stars-base { color: #3d4b6d; }
.stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: var(--gold); }
.rating-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #5a5033; border-radius: 7px; background: #2b2717; color: #ffe7b0; font-size: .82rem; line-height: 1.3; }

/* ---------- Store guide (4 items) ---------- */
.store-guide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.store-guide-icon { font-size: 1rem; }
@media (max-width: 980px) { .store-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .store-guide { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Product page ---------- */
.detail-gallery { display: grid; gap: 10px; align-content: start; min-width: 0; }
.detail-gallery > .product-image {
  min-width: 0; margin: 0; padding: clamp(15px, 4vw, 50px); border-radius: 12px; aspect-ratio: 1;
  background: radial-gradient(ellipse at 50% 24%, #f8faff, var(--item-studio, #d5e4ff));
}
.detail-gallery > .product-image img { width: 100%; height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.detail-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.detail-thumb {
  flex: 0 0 72px; height: 72px; padding: 6px; border: 2px solid #33456f; border-radius: 10px;
  background: #eef3ff; cursor: pointer;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.detail-thumb[aria-pressed="true"] { border-color: var(--action-bg); box-shadow: 0 0 0 2px #3cc9ff55; }
.detail-social { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.detail-rating { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.detail-rating > span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.detail-sold { padding: 4px 9px; border-radius: 7px; background: #3b1f22; color: #ffc2b3; font-size: .85rem; font-weight: 600; }
.detail-buy { flex-direction: column; align-items: stretch; }
.detail-price-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.detail-price-row .stock { margin: 0 0 6px; }
.detail-actions { display: flex; gap: 10px; }
.detail-actions .detail-add { flex: 1; min-height: 52px; font-size: 1.05rem; }
.detail-quantity {
  display: inline-grid; grid-template-columns: 44px 40px 44px; align-items: center; min-height: 52px;
  border: 1px solid #4b628f; border-radius: 10px; background: #0d1630; overflow: hidden;
}
.detail-quantity button { height: 100%; border: 0; background: transparent; color: var(--text); font-size: 1.3rem; cursor: pointer; }
.detail-quantity button:hover:not(:disabled) { background: #22355d; }
.detail-quantity button:disabled { opacity: .35; cursor: default; }
.detail-quantity output { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.whatsapp-button {
  display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 10px 18px;
  border-radius: 10px; background: var(--whatsapp); color: var(--whatsapp-ink); font-weight: 700;
  box-shadow: 0 6px 18px #25d36633; transition: transform .15s ease, filter .15s ease;
}
.whatsapp-button::before {
  content: ""; width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2Zm4.5 12.1c-.2-.1-1.5-.7-1.7-.8-.2-.1-.4-.1-.6.1l-.8 1c-.1.2-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.3-.4.2-.4.7-1.4.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5c-.2 0-.4.1-.7.3-.2.3-.9.9-.9 2.2s.9 2.5 1 2.7c.1.2 1.8 2.8 4.4 3.9 1.6.7 2.3.8 3.1.6.5-.1 1.5-.6 1.7-1.2.2-.6.2-1.1.2-1.2-.1-.1-.3-.2-.5-.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2Zm4.5 12.1c-.2-.1-1.5-.7-1.7-.8-.2-.1-.4-.1-.6.1l-.8 1c-.1.2-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.3-.4.2-.4.7-1.4.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5c-.2 0-.4.1-.7.3-.2.3-.9.9-.9 2.2s.9 2.5 1 2.7c.1.2 1.8 2.8 4.4 3.9 1.6.7 2.3.8 3.1.6.5-.1 1.5-.6 1.7-1.2.2-.6.2-1.1.2-1.2-.1-.1-.3-.2-.5-.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.whatsapp-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.detail-perks { display: grid; gap: 2px; align-self: stretch; list-style: none; margin: 14px 0 0; padding: 0; }
.detail-perks li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid #25355a; }
.detail-perks li:last-child { border-bottom: 0; }
.perk-icon { flex: none; width: 24px; text-align: center; font-size: 1.15rem; }
.perk-copy { display: grid; gap: 2px; }
.perk-copy strong { font-size: .95rem; }
.perk-copy span { color: var(--muted); font-size: .86rem; }
.detail-about { align-self: stretch; margin-top: 20px; }
.detail-about h2 { margin: 0; font: 700 1.5rem/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.detail-about .detail-description { margin-top: 8px; }

/* ---------- Reviews ---------- */
.reviews {
  margin-top: 28px; padding: clamp(16px, 3vw, 32px); border: 1px solid #3b4e7c; border-radius: 19px;
  background: #11192e;
}
.reviews-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.reviews-head h2 { margin: 0; font: 800 clamp(2rem, 4vw, 3rem)/1 var(--display); text-transform: uppercase; }
.review-summary { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.review-summary .stars { font-size: 1.25rem; }
.review-average { color: var(--text); font: 800 2.2rem/1 var(--display); }
.reviews-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 36px); margin-top: 20px; align-items: start; }
.review-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.review-list:empty { display: none; }
.review { padding: 14px 16px; border: 1px solid #2c3d63; border-radius: 12px; background: #151f38; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.review-head time { margin-left: auto; color: var(--muted); font-size: .82rem; }
.review p { margin: 8px 0 0; color: #d4def3; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.review-verified { padding: 2px 7px; border-radius: 6px; background: #15383b; color: #a5f1d7; font-size: .75rem; font-weight: 600; }
.review-form { display: grid; gap: 12px; padding: 16px; border: 1px solid #3a5080; border-radius: 14px; background: linear-gradient(150deg, #1a2a4d, #111a33); }
.review-form h3 { margin: 0; }
.review-form label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; }
.review-form :is(input:not([type=radio]), textarea) {
  width: 100%; padding: 10px 12px; border: 1px solid #405683; border-radius: 9px; background: #0b1328; color: var(--text); font: inherit;
}
.review-form .primary { justify-self: start; }
.rating-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin: 0; padding: 0; border: 0; }
.rating-input legend { width: 100%; margin-bottom: 4px; color: var(--muted); font-size: .9rem; float: left; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input label { display: block; color: #3d4b6d; font-size: 1.9rem; line-height: 1; cursor: pointer; transition: color .1s; }
.rating-input label:hover, .rating-input label:hover ~ label, .rating-input input:checked ~ label { color: var(--gold); }
.rating-input input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.form-status.is-error { color: #ffc1c6; }
.checkout-note { margin: 0; color: var(--muted); font-size: .82rem; }

/* ---------- Sticky buy bar (mobile) ---------- */
.sticky-buy {
  position: fixed; z-index: 20; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 16px; border: 1px solid #4b6496; border-radius: 14px;
  background: #121c36ee; backdrop-filter: blur(10px); box-shadow: 0 12px 30px #0009;
}
.sticky-buy > div { display: grid; min-width: 0; flex: 1; }
.sticky-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: .85rem; }
.sticky-price { font-size: 1.1rem; }
.sticky-buy .primary { min-height: 46px; white-space: nowrap; }
@media (min-width: 801px) { .sticky-buy { display: none !important; } }

/* ---------- Cart: free shipping, totals, COD ---------- */
.free-shipping { margin-top: 14px; padding: 12px 14px; border: 1px solid #3a5080; border-radius: 11px; background: #142142; }
.free-shipping p { margin: 0 0 8px; font-size: .9rem; font-weight: 600; }
.free-shipping-track { height: 7px; border-radius: 99px; background: #26365c; overflow: hidden; }
.free-shipping-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--action-fill); transition: width .35s ease; }
.free-shipping.is-done { border-color: #3c756c; background: #13302f; }
.free-shipping.is-done .free-shipping-track span { background: #4fe0b0; }
.checkout-summary { display: grid; gap: 6px; margin-top: 14px; padding: 12px 14px; border: 1px solid #2c3d63; border-radius: 11px; background: #101a33; }
.checkout-summary > div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.checkout-summary > div span:last-child { color: var(--text); font-weight: 600; }
.cod-badge { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 11px 13px; border: 1px solid #3c756c; border-radius: 11px; background: #13302f; color: #c9f5e6; font-size: .86rem; line-height: 1.45; }
.cod-badge strong { display: block; color: #e9fff7; font-size: .95rem; }
.confirmation-next { color: var(--muted); }
.order-confirmation dt { flex: none; overflow-wrap: normal; }
#order-reference { font-size: .85em; }
.order-confirmation .whatsapp-button { margin-bottom: 12px; }

/* ---------- Toast & floating WhatsApp ---------- */
.cart-toast {
  position: fixed; z-index: 30; top: 16px; left: 50%; display: flex; align-items: center; gap: 12px;
  width: min(460px, calc(100% - 24px)); padding: 10px 10px 10px 14px; transform: translateX(-50%);
  border: 1px solid #3c756c; border-radius: 13px; background: #102a2a; color: #dffcf1; box-shadow: 0 14px 34px #000a;
  animation: toast-in .25s ease;
}
.cart-toast > span:first-child { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: #4fe0b0; color: #062118; font-weight: 800; }
.cart-toast > span:nth-child(2) { flex: 1; min-width: 0; font-size: .9rem; }
.cart-toast strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cart-toast button { flex: none; padding: 8px 12px; border: 1px solid #5fcfab; border-radius: 9px; background: transparent; color: #dffcf1; font: inherit; font-weight: 700; cursor: pointer; }
.cart-toast button:hover { background: #1d4740; }
.cart-toast.is-leaving { opacity: 0; transform: translate(-50%, -8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } }
.whatsapp-float {
  position: fixed; z-index: 19; right: 18px; bottom: 18px; display: grid; place-items: center; width: 58px; height: 58px;
  border-radius: 50%; background: var(--whatsapp); color: #fff; box-shadow: 0 10px 26px #25d36655, 0 4px 10px #0007;
  transition: transform .15s ease;
}
.whatsapp-float:hover { transform: scale(1.06); }
body:has(#sticky-buy:not([hidden])) .whatsapp-float { bottom: 92px; }

@media (max-width: 740px) {
  .reviews-body { grid-template-columns: minmax(0, 1fr); }
  .detail-gallery > .product-image { max-height: 480px; }
  .detail-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .stock.is-low::before, .cart-toast { animation: none; }
  .whatsapp-button, .whatsapp-float, .free-shipping-track span { transition: none; }
}

/* Fix: cart thumbnails overflowed the drawer */
.cart-thumbnail { overflow: hidden; }
.cart-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.reviews-body:has(.review-list:empty) { grid-template-columns: minmax(0, 560px); }

/* ---------- Order tracking ---------- */
.tracking-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; list-style: none; margin: 18px 0; padding: 0; counter-reset: step; }
.tracking-steps li { position: relative; padding: 34px 4px 0; color: var(--muted); text-align: center; font-size: .9rem; counter-increment: step; }
.tracking-steps li::before { content: counter(step); position: absolute; top: 0; left: 50%; display: grid; place-items: center; width: 26px; height: 26px; transform: translateX(-50%); border: 2px solid #3b4e7c; border-radius: 50%; background: #11192e; font-weight: 700; }
.tracking-steps li.is-done { color: var(--text); }
.tracking-steps li.is-done::before { content: "✓"; border-color: #4fe0b0; background: #4fe0b0; color: #062118; }
.tracking-steps.is-cancelled li { opacity: .45; }
.tracking-items { display: grid; gap: 6px; list-style: none; margin: 0 0 12px; padding: 12px 0; border-block: 1px solid #2c3d63; }
.tracking-items li { display: flex; justify-content: space-between; gap: 12px; }
