/* Product details and the persistent purchase controls share the storefront palette. */
body:has(.product-page) {
    padding-bottom: calc(var(--purchase-bar-height, 110px) + 20px);
}

html:has(.product-page) {
    scroll-padding-bottom: calc(var(--purchase-bar-height, 110px) + 24px);
}

.product-page [hidden] { display: none !important; }
.product-page .breadcrumbs { flex-wrap: wrap; line-height: 1.8; }
.product-page .detail-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 100px);
    align-items: start;
    padding-block: 32px 72px;
}
.product-page .product-media { position: sticky; top: 28px; min-width: 0; }
.product-page .detail-photo {
    position: relative;
    aspect-ratio: 4 / 5;
    width: 100%;
    overflow: hidden;
    background: #f0eee7;
    border: 1px solid #e8e5dc;
    border-radius: 3px;
}
.product-page .detail-photo > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: clamp(24px, 4vw, 64px);
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
.product-page .detail-photo .product-image {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    height: 100%;
    background: transparent;
}
.product-page .product-media-badge {
    position: absolute;
    top: 20px;
    inset-inline-start: 20px;
    font-size: 10px;
    letter-spacing: .16em;
    padding: 9px 12px;
    background: #fbfaf7e8;
    border: 1px solid #deddd6;
}
.product-page .product-media-caption {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    color: var(--muted);
    font-size: 11px;
}
.product-page .product-media-caption [dir="ltr"] { font-size: 9px; letter-spacing: .1em; }
.product-page .detail-info { min-width: 0; padding: 6px 0 0; }
.product-page .product-heading-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.product-page .product-category-link { font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.product-page .detail-info h1 { font-size: clamp(28px, 2.7vw, 42px); line-height: 1.35; font-weight: 400; margin-bottom: 14px; overflow-wrap: anywhere; }
.product-page .product-stock { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; white-space: nowrap; }
.product-page .product-stock--available { color: #496447; }
.product-page .product-stock--empty { color: #8b4b3e; }
.product-page .product-stock-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.product-page .product-price-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.product-page .detail-price { display: flex; align-items: baseline; gap: 6px; margin: 0; font-size: 27px; font-weight: 400; }
.product-page .product-price-prefix, .product-page .product-price-caption { font-size: 12px; font-weight: 300; color: var(--muted); }
.product-page .detail-description { font-size: 14px; line-height: 1.9; margin-bottom: 24px; overflow-wrap: anywhere; }
.product-page .product-options { margin: 0 0 22px; padding: 24px 0; }
.product-page .product-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.product-page .product-section-heading h2 { font-size: 17px; font-weight: 500; margin: 0; }
.product-page .product-section-heading > span { font-size: 11px; color: var(--muted); }
.product-page .product-option-field { margin-bottom: 22px; min-width: 0; }
.product-page .form-label { display: flex; align-items: center; gap: 8px; float: none; font-size: 13px; font-weight: 500; margin-bottom: 10px; }
.product-page .option-requirement { border-radius: 3px; background: #eeece6; padding: 3px 7px; color: #68685f; font-size: 10px; font-weight: 400; }
.product-page .form-select { min-height: 48px; border-color: var(--line); border-radius: 3px; background-color: #fff; font-size: 14px; padding-block: 12px; }
.product-page .form-select:focus { border-color: var(--ink); box-shadow: 0 0 0 2px #e8e4da; }
.product-page .store-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product-page .store-option-card {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    gap: 10px;
    align-items: center;
    min-height: 78px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s, background-color .18s;
}
.product-page .store-option-card:hover { border-color: #8c8b81; }
.product-page .store-option-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.product-page .store-option-visual { display: grid; place-items: center; width: 40px; height: 44px; overflow: hidden; border-radius: 3px; background: #f5f3ed; }
.product-page .store-option-visual img { width: 100%; height: 100%; object-fit: cover; }
.product-page .store-option-color { width: 24px; height: 24px; border-radius: 50%; background: var(--option-color); border: 3px solid #fff; box-shadow: 0 0 0 1px #deddd6; }
.product-page .store-option-placeholder { color: var(--muted); font-size: 16px; }
.product-page .store-option-content { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.product-page .store-option-name { font-size: 12px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.product-page .store-option-price { font-size: 11px; color: var(--muted); text-align: start; }
.product-page .store-option-check { width: 20px; height: 20px; border: 1px solid #c6c5bc; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: transparent; }
.product-page .store-option-card:has(:checked) { background: #f4f3ed; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.product-page .store-option-card:has(:checked) .store-option-check { background: var(--ink); border-color: var(--ink); color: white; }
.product-page .store-option-card:has(:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.product-page .store-option-card.option-disabled { opacity: .45; cursor: not-allowed; }
.product-page .store-option-help { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; color: var(--muted); font-size: 11px; }
.product-page .store-option-counter { direction: ltr; white-space: nowrap; }
.product-page .product-clear-options { color: inherit; border: 0; padding: 0; background: none; text-decoration: underline; text-underline-offset: 3px; }
.product-page .product-option-error { color: #a13b32; font-size: 12px; margin: 8px 0 0; }
.product-page .product-quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.product-page .product-quantity-row .form-label { margin: 0 0 5px; }
.product-page .product-quantity-hint { margin: 0; font-size: 11px; color: var(--muted); }
.product-page .product-stepper { display: flex; align-items: center; flex-shrink: 0; border: 1px solid var(--line); background: #fff; border-radius: 3px; height: 46px; }
.product-page .product-stepper button { width: 40px; height: 44px; border: 0; background: none; font-size: 19px; color: var(--ink); }
.product-page .product-stepper input { width: 42px; padding: 0; height: 44px; border: 0; background: transparent; text-align: center; font-size: 16px; color: var(--ink); appearance: textfield; -moz-appearance: textfield; }
.product-page .product-stepper input::-webkit-inner-spin-button, .product-page .product-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.product-page .product-stepper input:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.product-page button:disabled { opacity: .4; cursor: not-allowed; }
.product-page .product-order-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.product-page .product-order-summary > div { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.product-page .product-order-summary small { color: var(--muted); font-size: 10px; }
.product-page .product-order-summary strong { font-size: 23px; font-weight: 500; }
.product-page .product-add-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; width: 100%; border-radius: 3px; font-size: 14px; font-weight: 500; letter-spacing: 0; }
.product-page .secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--muted); margin: 14px 0 24px; }
.product-page .product-service-info details { border-top: 1px solid var(--line); padding: 18px 0; }
.product-page .product-service-info summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; font-size: 13px; list-style: none; }
.product-page .product-service-info summary::-webkit-details-marker { display: none; }
.product-page .product-service-info summary > span { display: flex; align-items: center; gap: 10px; }
.product-page .product-service-info details[open] summary > .bi { transform: rotate(45deg); }
.product-page .product-service-info details > div { padding-top: 14px; font-size: 12px; line-height: 1.9; color: var(--muted); }
.product-page .product-service-info a { text-decoration: underline; text-underline-offset: 3px; }
.product-page .product-meta { font-size: 11px; color: var(--muted); margin: 12px 0 0; }
.product-page .related-products { border-top: 1px solid var(--line); padding-top: 36px; }
.product-page .product-purchase-bar {
    position: fixed;
    z-index: 1030;
    bottom: 0;
    inset-inline: 0;
    padding: 15px 4% calc(15px + env(safe-area-inset-bottom, 0px));
    background: rgba(251, 250, 247, .97);
    border-top: 1px solid #d9d7ce;
    box-shadow: 0 -8px 32px #24241f08;
    backdrop-filter: blur(16px);
}
.product-page .product-purchase-bar-inner { display: flex; align-items: center; gap: 28px; max-width: 1440px; margin-inline: auto; }
.product-page .purchase-bar-product { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.product-page .purchase-bar-product img { object-fit: contain; background: #eeece6; padding: 4px; border-radius: 3px; }
.product-page .purchase-bar-product > div { min-width: 0; }
.product-page .purchase-bar-product strong { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-page .purchase-bar-product span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-page .purchase-bar-total { min-width: 100px; }
.product-page .purchase-bar-total small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.product-page .purchase-bar-total small > span { font-size: 9px; }
.product-page .purchase-bar-total strong { display: block; width: max-content; font-size: 23px; font-weight: 500; }
.product-page .product-purchase-bar .product-add-button { width: 230px; flex-shrink: 0; }

@media (max-width: 991.98px) {
    .product-page .detail-layout { gap: 32px; }
    .product-page .store-option-grid { grid-template-columns: 1fr; }
    .product-page .product-purchase-bar-inner { gap: 18px; }
    .product-page .product-purchase-bar .product-add-button { width: 200px; }
    .product-page .purchase-bar-product img { display: none; }
}
@media (max-width: 767.98px) {
    .product-page .detail-layout { grid-template-columns: 1fr; gap: 26px; padding-block: 20px 40px; }
    .product-page .product-media { position: static; }
    .product-page .detail-photo { aspect-ratio: 1 / 1; max-height: 520px; }
    .product-page .detail-photo > img { padding: 36px; }
    .product-page .product-media-caption { padding-top: 12px; font-size: 10px; }
    .product-page .detail-info h1 { font-size: 29px; }
    .product-page .product-heading-meta { margin-bottom: 12px; }
    .product-page .store-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-page .product-purchase-bar { padding: 12px 5% calc(12px + env(safe-area-inset-bottom, 0px)); }
    .product-page .product-purchase-bar-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; }
    .product-page .purchase-bar-product { display: none; }
    .product-page .purchase-bar-quantity { grid-row: 2; grid-column: 1; }
    .product-page .purchase-bar-total { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .product-page .purchase-bar-total small { margin: 0; }
    .product-page .purchase-bar-total strong { font-size: 20px; line-height: 1.25; }
    .product-page .product-purchase-bar .product-add-button { grid-row: 2; grid-column: 2; width: 100%; min-height: 46px; padding: 10px; }
}
@media (max-width: 420px) {
    .product-page .store-option-grid { grid-template-columns: 1fr; }
    .product-page .product-stepper button { width: 36px; }
    .product-page .product-stepper input { width: 36px; }
    .product-page .product-purchase-bar-inner { column-gap: 12px; }
    .product-page .product-section-heading > span { font-size: 10px; }
}
@media print {
    body:has(.product-page) { padding-bottom: 0; }
    .product-page .product-purchase-bar { display: none; }
    .product-page .product-media { position: static; }
}
