.sp-pdp { padding: .6rem 0 1rem; }
.sp-pdp__layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }

/* ---- Gallery ---- */
.sp-gallery { position: sticky; top: 96px; display: grid; grid-template-columns: 76px 1fr; gap: .8rem; }
.sp-gallery__thumbs { display: grid; align-content: start; gap: .6rem; max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: none; }
.sp-gallery__thumb { padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: var(--sp-card); cursor: pointer; aspect-ratio: 4 / 5; }
.sp-gallery__thumb[hidden] { display: none; }
.sp-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-gallery__thumb.is-active { border-color: var(--sp-maroon); }
.sp-gallery__main { position: relative; aspect-ratio: 4 / 5; border-radius: 24px; overflow: hidden; background: var(--sp-card); cursor: zoom-in; }
.sp-gallery__main img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.sp-gallery__main.is-zoom img { transform: scale(1.8); }
.sp-gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .1); }
.sp-gallery__nav--prev { left: .8rem; }
.sp-gallery__nav--next { right: .8rem; }
.sp-gallery__zoom { position: absolute; right: .9rem; bottom: .9rem; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .85); color: var(--sp-ink); font-size: .8rem; pointer-events: none; }
.sp-gallery__main.is-zoom .sp-gallery__nav, .sp-gallery__main.is-zoom .sp-gallery__zoom { opacity: 0; }

/* ---- Buy box ---- */
.sp-buy { display: grid; gap: 1.1rem; }
.sp-buy .sp-crumbs { margin: 0; }
.sp-buy__title { font-size: clamp(2.2rem, 4vw, 3.2rem); margin: 0; }
.sp-buy__price { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.sp-buy__amount { font-size: 1.5rem; font-weight: 600; }
.sp-buy__compare { color: var(--sp-muted); font-size: 1.1rem; }
.sp-buy__save { padding: .2rem .6rem; border-radius: 999px; background: var(--sp-maroon); color: #fff; font-size: .75rem; font-weight: 600; }
.sp-buy__save[hidden], .sp-buy__compare[hidden] { display: none; }
.sp-buy__lead { margin: 0; color: var(--sp-muted); }
.sp-buy__hint { margin: 0; font-size: .88rem; color: var(--sp-muted); text-align: center; }

.sp-mode { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.sp-mode__btn { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; text-align: left; border: 1.5px solid var(--sp-line); border-radius: 16px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.sp-mode__btn i { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--sp-card); color: var(--sp-maroon); flex-shrink: 0; }
.sp-mode__btn span { display: grid; line-height: 1.25; }
.sp-mode__btn b { font-weight: 600; font-size: .92rem; }
.sp-mode__btn small { color: var(--sp-muted); font-size: .76rem; }
.sp-mode__btn.is-active { border-color: var(--sp-maroon); background: #fdf7f8; }
.sp-mode__btn.is-active i { background: var(--sp-maroon); color: #fff; }

.sp-panel { display: grid; gap: 1.1rem; }
.sp-panel[hidden] { display: none; }
.sp-opt { display: grid; gap: .6rem; border-radius: 14px; transition: box-shadow .2s; }
.sp-opt.has-error, .sp-mfield.has-error input { box-shadow: 0 0 0 2px var(--sp-danger); }
.sp-opt.has-error { padding: .5rem; }
.sp-opt__head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; font-size: .9rem; }
.sp-opt__head b { font-weight: 600; }
.sp-opt__values { display: flex; flex-wrap: wrap; gap: .45rem; }
.sp-swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--sp-line); cursor: pointer; position: relative; }
.sp-swatch.is-active { box-shadow: 0 0 0 2px var(--sp-ink); }
.sp-swatch.is-out::after { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; background: rgba(255, 255, 255, .9); transform: rotate(45deg); }
.sp-size, .sp-choice { min-width: 54px; min-height: 44px; padding: 0 1rem; border: 1px solid var(--sp-line); border-radius: 999px; background: #fff; cursor: pointer; font-size: .88rem; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; transition: border-color .12s, background .12s; }
.sp-size:hover, .sp-choice:hover { border-color: var(--sp-ink); }
.sp-size.is-active, .sp-choice.is-active { border-color: var(--sp-maroon); background: var(--sp-maroon); color: #fff; }
.sp-size.is-out { color: #b5aaa7; text-decoration: line-through; background: #faf8f7; }
.sp-size.is-out.is-active { background: #8a7a7e; border-color: #8a7a7e; color: #fff; }
.sp-choice small { opacity: .75; font-size: .75rem; }
.sp-choice i { width: 14px; height: 14px; border-radius: 50%; }
.sp-plus { color: var(--sp-maroon); font-weight: 600; }
.sp-stock { margin: -.3rem 0 0; font-size: .88rem; font-weight: 500; min-height: 1.3em; }
.sp-stock.is-ok { color: var(--sp-success); }
.sp-stock.is-low { color: #b45309; }
.sp-stock.is-out { color: var(--sp-danger); }
.sp-buy__actions { display: flex; gap: .6rem; }
.sp-buy__add { flex: 1; }
.sp-qty input::-webkit-outer-spin-button, .sp-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-qty input { -moz-appearance: textfield; }

/* ---- Custom stitching ---- */
.sp-custom-note { display: flex; gap: .8rem; padding: .9rem 1rem; border-radius: 14px; background: var(--sp-peach-soft); color: var(--sp-maroon-deep); font-size: .86rem; }
.sp-custom-note i { margin-top: .2rem; color: var(--sp-maroon); }
.sp-custom-note p { margin: 0; }
.sp-textopt { position: relative; }
.sp-textopt input { width: 100%; min-height: 46px; padding: .6rem 4rem .6rem 1rem; border: 1px solid var(--sp-line); border-radius: 12px; font: inherit; }
.sp-textopt input:focus { outline: none; border-color: var(--sp-maroon); }
.sp-textopt small { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--sp-muted); font-size: .75rem; }
.sp-fileopt { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.sp-fileopt .sp-btn { min-height: 42px; cursor: pointer; }
.sp-fileopt small { flex-basis: 100%; }
.sp-measure { display: grid; gap: .8rem; padding: 1.1rem; border-radius: 18px; background: var(--sp-card); }
.sp-measure__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.sp-mfield { display: grid; gap: .3rem; font-size: .82rem; font-weight: 600; }
.sp-mfield i { color: var(--sp-muted); cursor: help; margin-left: .2rem; }
.sp-mfield input { min-height: 44px; padding: .5rem .8rem; border: 1px solid var(--sp-line); border-radius: 10px; font: inherit; font-weight: 400; background: #fff; width: 100%; }
.sp-mfield input:focus { outline: none; border-color: var(--sp-maroon); }
.sp-measure .sp-field textarea { min-height: 64px; }
.sp-summary { display: grid; gap: .4rem; padding: 1rem 1.1rem; border: 1px dashed rgba(130, 8, 44, .35); border-radius: 16px; font-size: .9rem; }
.sp-summary__row { display: flex; justify-content: space-between; gap: 1rem; }
.sp-summary__total { padding-top: .4rem; margin-top: .2rem; border-top: 1px solid var(--sp-line); font-size: 1rem; }
.sp-form-error { margin: 0; padding: .7rem .9rem; border-radius: 12px; background: #fdf0f0; color: #8f1d22; font-size: .88rem; font-weight: 600; }

/* ---- Trust, help, accordion ---- */
.sp-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .2rem 0 0; padding: 0; list-style: none; }
.sp-trust li { display: grid; justify-items: center; gap: .35rem; padding: .8rem .4rem; border-radius: 14px; background: var(--sp-card); text-align: center; font-size: .78rem; font-weight: 500; }
.sp-trust i { color: var(--sp-maroon); font-size: 1.1rem; }
.sp-help { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border: 1px solid var(--sp-line); border-radius: 14px; text-decoration: none; font-size: .88rem; }
.sp-help .fa-whatsapp { font-size: 1.4rem; color: #25d366; }
.sp-help span { flex: 1; }
.sp-help .fa-chevron-right { color: var(--sp-muted); font-size: .75rem; }
.sp-accordion details { border-bottom: 1px solid var(--sp-line); }
.sp-accordion summary { display: flex; justify-content: space-between; padding: 1.05rem 0; cursor: pointer; list-style: none; font-family: var(--sp-font-display); font-size: 1.35rem; }
.sp-accordion summary::-webkit-details-marker { display: none; }
.sp-accordion summary::after { content: "+"; font-family: var(--sp-font-body); color: var(--sp-muted); }
.sp-accordion details[open] summary::after { content: "−"; }
.sp-accordion details > div, .sp-accordion details > dl { padding-bottom: 1.1rem; }
.sp-prose { color: var(--sp-muted); font-size: .94rem; }
.sp-prose p { margin: 0 0 .7rem; }
.sp-specs { display: grid; grid-template-columns: 130px 1fr; gap: .5rem 1rem; margin: 0; font-size: .92rem; }
.sp-specs dt { color: var(--sp-muted); }
.sp-specs dd { margin: 0; }

@media (max-width: 900px) {
    .sp-pdp__layout { grid-template-columns: 1fr; }
    .sp-gallery { position: static; grid-template-columns: 1fr; }
    .sp-gallery__thumbs { order: 2; display: flex; overflow-x: auto; max-height: none; }
    .sp-gallery__thumb { width: 64px; flex-shrink: 0; }
    .sp-gallery__main { border-radius: 18px; cursor: default; }
}
@media (max-width: 520px) {
    .sp-mode { grid-template-columns: 1fr; }
    .sp-measure__grid { grid-template-columns: 1fr 1fr; gap: .55rem; }
    .sp-trust li { font-size: .72rem; }
}

/* Responsive fixes */
.sp-pdp__layout > *, .sp-gallery, .sp-gallery__main, .sp-buy { min-width: 0; }
@media (max-width: 900px) { .sp-gallery__thumbs { max-width: 100%; } }

/* Mobile sticky buy bar */
.sp-stickybuy { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 70; display: flex; align-items: center; gap: .8rem; padding: .6rem .6rem .6rem 1rem; border-radius: 18px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(20px) saturate(170%); -webkit-backdrop-filter: blur(20px) saturate(170%); border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 18px 40px -12px rgba(42, 10, 20, .45); }
.sp-stickybuy__info { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.sp-stickybuy__info b { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-stickybuy__info span { font-size: .85rem; color: var(--sp-maroon); font-weight: 600; }
.sp-stickybuy .sp-btn { min-height: 44px; padding: 0 1.1rem; }
@media (min-width: 901px) { .sp-stickybuy { display: none !important; } }
body.page-product .sp-wa-float { bottom: 84px; }
.sp-trust li span { line-height: 1.25; }
.sp-measure__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sp-mfield, .sp-mfield input, .sp-panel, .sp-panel > *, .sp-measure, .sp-opt, .sp-textopt input { min-width: 0; }
.sp-choice { max-width: 100%; white-space: normal; text-align: left; }
.sp-buy__actions > * { min-width: 0; }
.sp-buy__add { white-space: normal; }
.sp-accordion, .sp-accordion details, .sp-accordion details > div { min-width: 0; max-width: 100%; }
.sp-chart { max-width: 100%; }

/* Tablet: keep the gallery a comfortable size so the buy box is close */
@media (min-width: 560px) and (max-width: 900px) {
    .sp-gallery { max-width: 520px; margin: 0 auto; width: 100%; }
}
