/* ==========================================================================
   Product page
   ========================================================================== */

/* ---------- Gallery ---------- */
.product-gallery { position: sticky; top: calc(var(--header-height) + 70px); }
.gallery-main { border-radius: 22px; overflow: hidden; background: var(--cream); border: 1px solid var(--line); position: relative; }
.gallery-main .swiper-slide { aspect-ratio: 1 / 1; cursor: zoom-in; overflow: hidden; }
.gallery-main .swiper-slide img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease-out; transform-origin: center; }
.gallery-main .swiper-slide.is-zooming img { transform: scale(1.9); }
.gallery-main .product-card__badges { top: 16px; inset-inline-start: 16px; }
.gallery-main .gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; }
.gallery-main .gallery-nav.is-prev { inset-inline-start: 14px; }
.gallery-main .gallery-nav.is-next { inset-inline-end: 14px; }
.gallery-thumbs { margin-top: 12px; }
.gallery-thumbs .swiper-slide { width: 86px; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; cursor: pointer; border: 2px solid transparent; opacity: .6; transition: all .25s var(--ease); }
.gallery-thumbs .swiper-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs .swiper-slide-thumb-active { border-color: var(--brand); opacity: 1; }

/* ---------- Summary ---------- */
.product-summary .product-category { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: .25rem .9rem; border-radius: 999px; font-size: .85rem; }
.product-summary h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: .8rem 0 .6rem; }
.product-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.product-meta .divider { width: 4px; height: 4px; border-radius: 50%; background: #cbbcc2; }
.product-price { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 1.2rem 0; padding: 1rem 1.2rem; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand-soft), var(--gold-soft)); }
.product-price .current { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1.2; }
.product-price .old { font-size: 1.1rem; color: var(--muted); text-decoration: line-through; }
.product-price .save { padding: .2rem .8rem; border-radius: 999px; background: #d63939; color: #fff; font-weight: 800; font-size: .85rem; }
.product-price .price-note { width: 100%; font-size: .82rem; color: var(--muted); font-weight: 600; }
.product-price .current.is-updated { animation: pricePop .4s var(--ease); }
@keyframes pricePop { 50% { transform: scale(1.08); } }

.stock-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; }
.stock-state.in-stock { color: var(--success); }
.stock-state.low-stock { color: #b7791f; }
.stock-state.out-of-stock { color: #d63939; }

/* ---------- Options ---------- */
.options-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; margin-bottom: 1.2rem; }
.options-panel__title { font-size: 1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 1.1rem; }
.options-panel__title i { color: var(--gold); }
.option-group + .option-group { margin-top: 1.3rem; padding-top: 1.3rem; border-top: 1px dashed var(--line); }
.option-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; margin-bottom: .7rem; }
.option-label .chosen { font-weight: 600; color: var(--muted); font-size: .88rem; }

.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch input, .choice input { position: absolute; opacity: 0; pointer-events: none; }
.swatch { position: relative; cursor: pointer; }
.swatch .dot { display: block; width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); transition: all .2s var(--ease); }
.swatch:hover .dot { transform: scale(1.08); }
.swatch input:checked + .dot { box-shadow: 0 0 0 2px var(--brand), var(--shadow-sm); transform: scale(1.06); }
.swatch input:focus-visible + .dot { outline: 3px solid rgba(139, 30, 70, .35); outline-offset: 3px; }
.swatch .tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); background: var(--ink); color: #fff; font-size: .75rem; font-weight: 700; white-space: nowrap; padding: .25rem .6rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: all .2s var(--ease); }
.swatch:hover .tip { opacity: 1; transform: translateX(-50%) translateY(0); }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; cursor: pointer; margin: 0; }
.choice span { display: inline-flex; flex-direction: column; align-items: center; min-width: 86px; padding: .55rem 1.1rem; border-radius: 12px; border: 2px solid var(--line); font-weight: 700; background: #fff; transition: all .2s var(--ease); line-height: 1.4; }
.choice span small { font-size: .72rem; font-weight: 700; color: var(--gold); }
.choice:hover span { border-color: #d9b8c5; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.choice input:focus-visible + span { outline: 3px solid rgba(139, 30, 70, .3); outline-offset: 2px; }

.char-counter { font-size: .78rem; color: var(--muted); font-weight: 600; }
.char-counter.is-limit { color: #d63939; }

.upload-box { position: relative; display: flex; align-items: center; gap: 14px; padding: 1rem; border: 2px dashed #d9c4cc; border-radius: 14px; background: var(--cream); cursor: pointer; transition: all .25s var(--ease); }
.upload-box:hover, .upload-box.is-dragover { border-color: var(--brand); background: var(--brand-soft); }
.upload-box input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box .upload-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--brand); font-size: 1.5rem; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.upload-box .upload-text strong { display: block; }
.upload-box .upload-text small { color: var(--muted); }
.upload-preview { display: none; align-items: center; gap: 12px; margin-top: 10px; padding: .6rem; border-radius: 14px; border: 1px solid var(--line); }
.upload-preview.is-visible { display: flex; }
.upload-preview img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.upload-preview .name { font-weight: 700; font-size: .88rem; word-break: break-all; }
.upload-preview .remove-upload { margin-inline-start: auto; }

.option-error { display: none; color: #d63939; font-weight: 700; font-size: .85rem; margin-top: .5rem; }
.option-group.has-error .option-error { display: block; }
.option-group.has-error .choice span, .option-group.has-error .upload-box { border-color: #e7a2a2; }

/* ---------- Quantity + actions ---------- */
.qty-control { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty-control button { width: 44px; height: 46px; border: 0; background: transparent; color: var(--ink); font-size: 1.1rem; }
.qty-control button:hover { background: var(--brand-soft); color: var(--brand); }
.qty-control input { width: 54px; text-align: center; border: 0; font-weight: 800; font-size: 1.05rem; -moz-appearance: textfield; appearance: textfield; background: transparent; }
.qty-control input::-webkit-outer-spin-button, .qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-control input:focus { outline: none; }
.purchase-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.purchase-actions .btn { flex: 1 1 200px; }

/* ---------- Quick order (COD form) ---------- */
.quick-order { margin-top: 1.5rem; border-radius: 22px; overflow: hidden; border: 2px solid var(--brand); box-shadow: 0 16px 40px rgba(139, 30, 70, .12); }
.quick-order__head { background: linear-gradient(135deg, var(--brand), #a62a58); color: #fff; padding: 1rem 1.4rem; display: flex; align-items: center; gap: 12px; }
.quick-order__head i { font-size: 1.6rem; color: #f5dea8; }
.quick-order__head h2 { color: #fff; font-size: 1.15rem; margin: 0; }
.quick-order__head p { margin: 0; color: #f3dbe4; font-size: .85rem; }
.quick-order__body { padding: 1.4rem; background: #fff; }
.order-summary-mini { border-radius: 14px; background: var(--cream); padding: 1rem 1.2rem; }
.order-summary-mini .row-line { display: flex; justify-content: space-between; gap: 10px; padding: .3rem 0; font-weight: 600; }
.order-summary-mini .row-line.total { border-top: 1px dashed #dccbd2; margin-top: .4rem; padding-top: .7rem; font-weight: 800; font-size: 1.1rem; color: var(--brand); }

.trust-badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 1.4rem; }
.trust-badges div { display: flex; align-items: center; gap: 10px; padding: .75rem; border-radius: 12px; background: var(--cream); font-weight: 700; font-size: .85rem; }
.trust-badges i { color: var(--brand); font-size: 1.3rem; }

/* ---------- Tabs ---------- */
.product-tabs-nav { border-bottom: 2px solid var(--line); gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.product-tabs-nav::-webkit-scrollbar { display: none; }
.product-tabs-nav .nav-link { border: 0; color: var(--muted); font-weight: 800; padding: .9rem 1.2rem; position: relative; white-space: nowrap; background: transparent; }
.product-tabs-nav .nav-link::after { content: ""; position: absolute; bottom: -2px; inset-inline: 0; height: 3px; background: var(--brand); transform: scaleX(0); transition: transform .25s var(--ease); }
.product-tabs-nav .nav-link.active { color: var(--brand); }
.product-tabs-nav .nav-link.active::after { transform: scaleX(1); }
.description-content { white-space: pre-line; line-height: 2; }

.rating-summary { text-align: center; padding: 1.5rem; border-radius: var(--radius); background: var(--cream); }
.rating-summary .big { font-size: 3.2rem; font-weight: 800; line-height: 1; color: var(--ink); }
.rating-bars .bar-row { display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 700; margin-bottom: .45rem; }
.rating-bars .progress { flex: 1; height: 8px; border-radius: 8px; background: #efe6ea; }
.rating-bars .progress-bar { background: #f0b429; border-radius: 8px; }
.review-item { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-item .avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; flex-shrink: 0; }
.verified { color: var(--success); font-size: .8rem; font-weight: 700; }
.review-photo { position: relative; display: inline-block; margin-top: .8rem; border-radius: 12px; overflow: hidden; }
.review-photo img { width: 120px; height: 120px; object-fit: cover; transition: transform .4s var(--ease); }
.review-photo span { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(29, 18, 23, .35); color: #fff; font-size: 1.4rem; opacity: 0; transition: opacity .25s var(--ease); }
.review-photo:hover img { transform: scale(1.08); }
.review-photo:hover span { opacity: 1; }
.review-form { padding: 1.3rem; border-radius: var(--radius); border: 1px dashed #d9c4cc; background: #fff; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 1.6rem; color: #e3d7dc; cursor: pointer; transition: color .15s, transform .15s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f0b429; }
.star-input input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 4px; }
.star-input label:hover { transform: scale(1.15); }

/* ---------- Photo crop modal ---------- */
.crop-stage { max-height: 65vh; background: #1d1217; border-radius: 14px; overflow: hidden; }
.crop-stage img { display: block; max-width: 100%; }
.crop-toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.crop-toolbar .btn { padding: .4rem .9rem; }
.quick-order.is-highlighted { animation: highlightPulse 1.6s var(--ease) 2; }
@keyframes highlightPulse { 50% { box-shadow: 0 0 0 10px rgba(139, 30, 70, .18); } }

/* ---------- Sticky mobile buy bar ---------- */
.mobile-buy-bar { position: fixed; bottom: 0; inset-inline: 0; z-index: 1035; background: #fff; border-top: 1px solid var(--line); padding: .7rem 1rem; display: flex; align-items: center; gap: 12px; box-shadow: 0 -8px 24px rgba(36, 22, 28, .08); transform: translateY(110%); transition: transform .3s var(--ease); }
.mobile-buy-bar.is-visible { transform: translateY(0); }
.mobile-buy-bar .price .current { font-size: 1.1rem; }
.mobile-buy-bar .btn { flex: 1; }
@media (min-width: 992px) { .mobile-buy-bar { display: none; } }
@media (max-width: 991.98px) {
    .product-gallery { position: static; }
    body.has-buy-bar .floating-whatsapp, body.has-buy-bar .back-to-top { bottom: 90px; }
}
.order-summary-mini .summary-row { display: flex; justify-content: space-between; gap: 10px; padding: .3rem 0; font-weight: 600; }
.order-summary-mini .summary-row.total { border-top: 1px dashed #dccbd2; margin-top: .4rem; padding-top: .7rem; font-weight: 800; font-size: 1.1rem; color: var(--brand); }
