/* ============================================================
   SUPERGIRL PRODUCT DETAIL V5.1
   Independent detail-page stylesheet.
   It is loaded after the user's latest supergirl-v4.css and does
   not reset homepage/header/footer customizations.
   ============================================================ */

body.sg-product-detail-page {
    background: #000 !important;
    color: #fff;
    overflow-x: hidden;
    font-family: Inter, "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}

body.sg-product-detail-page .ec-layoutRole,
body.sg-product-detail-page .ec-layoutRole__contents,
body.sg-product-detail-page .ec-layoutRole__main,
body.sg-product-detail-page .ec-layoutRole__mainWithColumn,
body.sg-product-detail-page .ec-layoutRole__mainBetweenColumn,
body.sg-product-detail-page .ec-layoutRole__contentBottom {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    background: #000;
}

body.sg-product-detail-page .ec-layoutRole__contents {
    display: block !important;
}

body.sg-product-detail-page .ec-layoutRole__left,
body.sg-product-detail-page .ec-layoutRole__right {
    display: none !important;
}

body.sg-product-detail-page .sg-detail-main,
body.sg-product-detail-page .sg-detail-main * {
    box-sizing: border-box;
}

body.sg-product-detail-page .sg-detail-main a {
    text-decoration: none;
}

.sg-detail-container {
    width: min(90%, 1440px);
    margin: 0 auto;
}

.sg-detail-container--wide {
    width: min(90%, 1320px);
}

/* ---------- Title banner ---------- */
.sg-detail-title-banner {
    position: relative;
    isolation: isolate;
    display: grid;
    width: 100%;
    height: clamp(150px, 16.6667vw, 320px);
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
}

.sg-detail-title-banner__image {
    position: absolute;
    inset: 0;
    z-index: -2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center;
}

.sg-detail-title-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(0,0,0,.38), rgba(0,0,0,.08), rgba(0,0,0,.32));
    pointer-events: none;
}

.sg-detail-title-banner__content {
    display: grid;
    place-items: center;
    width: min(90%, 1320px);
    height: 100%;
    margin: 0 auto;
}

.sg-detail-title-banner h1 {
    margin: 0;
    color: #fff;
    font-family: "Maven Pro", Inter, "Noto Sans JP", sans-serif;
    font-size: clamp(31px, 2vw, 52px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .03em;
    text-align: center;
    text-shadow: 0 3px 18px rgba(0,0,0,.42);
}

/* ---------- Main product ---------- */
.sg-detail-main {
    background: #000;
    color: #fff;
}

.sg-detail-product {
    padding: clamp(42px, 5vw, 82px) 0 clamp(54px, 6vw, 100px);
    background: #000;
}

.sg-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    gap: clamp(34px, 4.6vw, 76px);
    align-items: start;
}

/* ---------- Gallery ---------- */
.sg-detail-gallery,
.sg-detail-info {
    min-width: 0;
}

.sg-detail-gallery__inner {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sg-detail-gallery__inner.is-single {
    grid-template-columns: 1fr;
}

.sg-detail-gallery__inner.is-single .sg-detail-thumb-slider {
    display: none !important;
}

.sg-detail-main-slider {
    min-width: 0;
    overflow: hidden;
    border-radius: 7px;
    background: #f5f5f5;
}

.sg-detail-main-slider:not(.slick-initialized) .sg-detail-main-image:not(:first-child) {
    display: none;
}

.sg-detail-main-image {
    min-width: 0;
    background: #f5f5f5;
}

.sg-detail-main-image img {
    display: block;
    width: 100%;
    height: clamp(480px, 43vw, 700px);
    margin: 0 auto;
    padding: clamp(12px, 1.4vw, 24px);
    object-fit: contain;
    object-position: center;
}

.sg-detail-main-slider .slick-list,
.sg-detail-main-slider .slick-track,
.sg-detail-main-slider .slick-slide,
.sg-detail-main-slider .slick-slide > div {
    height: 100%;
}

/* Native thumbnail list: deliberately not initialized as Slick. */
.sg-detail-thumb-slider {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 92px;
    max-height: clamp(480px, 43vw, 700px);
    padding-right: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ef6440 #1d1d1d;
}

.sg-detail-thumb-slider::-webkit-scrollbar {
    width: 5px;
}

.sg-detail-thumb-slider::-webkit-scrollbar-track {
    background: #1d1d1d;
    border-radius: 999px;
}

.sg-detail-thumb-slider::-webkit-scrollbar-thumb {
    background: #ef6440;
    border-radius: 999px;
}

.sg-detail-thumb {
    display: block;
    flex: 0 0 104px;
    width: 86px;
    height: 104px;
    margin: 0;
    padding: 6px;
    overflow: hidden;
    border: 1px solid #3b3b3b;
    border-radius: 6px;
    background: #f5f5f5;
    cursor: pointer;
    opacity: .62;
    transition: opacity .22s ease, border-color .22s ease, transform .22s ease;
}

.sg-detail-thumb:hover,
.sg-detail-thumb.is-active,
.sg-detail-thumb[aria-current="true"] {
    border-color: #ef6440;
    opacity: 1;
    transform: translateX(2px);
}

.sg-detail-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}

/* ---------- Product information ---------- */
.sg-detail-info {
    padding: 0;
    color: #fff;
}

.sg-detail-product-name {
    margin: 0 0 17px;
    color: #fff;
    font-family: "Maven Pro", Inter, "Noto Sans JP", sans-serif;
    font-size: clamp(25px, 2vw, 30px);
    font-weight: 600;
    line-height: 1.42;
    letter-spacing: .01em;
}

.sg-detail-rating {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
    margin: 0 0 24px;
    color: #fff !important;
}

.sg-detail-rating:hover .sg-detail-rating__text {
    color: #ef6440;
}

.sg-detail-rating__stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    font-family: Arial, "Noto Sans JP", sans-serif;
    font-size: 19px;
    line-height: 1;
    letter-spacing: 1px;
    white-space: nowrap;
}

.sg-detail-rating__stars .is-active {
    color: #ef6440;
}

.sg-detail-rating__stars .is-inactive {
    color: #6b6b6b;
}

.sg-detail-rating__text {
    color: #d2d2d2;
    font-size: 14px;
    transition: color .22s ease;
}

.sg-detail-price-block {
    display: grid;
    gap: 7px;
    margin-bottom: 20px;
}

.sg-detail-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 9px;
    color: #fff;
    line-height: 1.55;
}

.sg-detail-price > span {
    min-width: 78px;
    color: #bcbcbc;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.detail_custom_price{
    display: flex;
    align-items: center;
}

.sg-detail-price del {
    color: red;
    font-size: 16px;
}

.sg-detail-price strong {
    color: #fff;
    font-size: clamp(25px, 2vw, 35px);
    font-weight: 600;
    letter-spacing: .01em;
}

.sg-detail-price small {
    color: #aaa;
    font-size: 12px;
}

.sg-detail-price--member strong,
.sg-detail-points {
    color: #ef6440;
}

.sg-detail-member-note,
.sg-detail-points {
    margin: 5px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.sg-detail-lead {
    margin: 0 0 19px;
    color: #c9c9c9;
    font-size: 15px;
    line-height: 1.8;
    display: none;
}

.sg-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.sg-detail-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 13px;
    border: 1px solid rgba(239,100,64,.5);
    border-radius: 999px;
    background: rgba(239,100,64,.13);
    color: #fff;
    font-size: 13px;
}

.detail_custom_review_tag {
    display: flex;
    align-items: center;
}
.detail_custom_review{
    margin-right: 30px;
}

.sg-detail-categories {
    display: grid;
    gap: 8px;
    margin-bottom: 17px;
}

.sg-detail-category-path {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #8c8c8c;
    font-size: 14px;
}
.sg-detail-category-path:has(~ .sg-detail-category-path) {
    display: none !important;
}

.sg-detail-category-path a {
    color: #ddd !important;
    transition: color .22s ease;
}

.sg-detail-category-path a:hover {
    color: #ef6440 !important;
}

.sg-detail-category-path i {
    color: #ef6440;
    font-size: 9px;
}

.sg-detail-code {
    margin: 0 0 21px;
    color: #8f8f8f;
    font-size: 12px;
}

/* ---------- Options / quantity / actions ---------- */
.sg-detail-form {
    margin-top: 8px;
}

.sg-detail-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.sg-detail-field {
    min-width: 0;
}

.sg-detail-field label,
.sg-detail-field-label {
    display: block;
    margin: 0 0 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.sg-detail-field select,
.sg-detail-field input,
.sg-detail-extra-fields select,
.sg-detail-extra-fields input[type="text"],
.sg-detail-extra-fields input[type="number"],
.sg-detail-extra-fields textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #454545;
    border-radius: 5px;
    background: #111;
    color: #fff;
    outline: none;
    box-shadow: none;
}

.sg-detail-field select:focus,
.sg-detail-extra-fields select:focus,
.sg-detail-extra-fields input:focus,
.sg-detail-extra-fields textarea:focus {
    border-color: #ef6440;
}

.sg-detail-field ul,
.sg-detail-extra-fields ul {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    color: #ff8370;
    font-size: 12px;
}

.sg-detail-quantity-field {
    margin: 0 0 19px;
}

.sg-detail-quantity {
    display: inline-grid;
    grid-template-columns: 44px 72px 44px;
    overflow: hidden;
    border: 1px solid #454545;
    border-radius: 5px;
    background: #111;
}

.sg-detail-quantity__button,
.sg-detail-quantity__input {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #fff !important;
    text-align: center;
    box-shadow: none !important;
}

.sg-detail-quantity__button {
    cursor: pointer;
    font-size: 20px;
    transition: background .2s ease, color .2s ease;
}

.sg-detail-quantity__button:hover {
    background: #ef6440 !important;
}

.sg-detail-quantity__input {
    border-right: 1px solid #454545 !important;
    border-left: 1px solid #454545 !important;
    font-size: 15px;
    appearance: textfield;
}

.sg-detail-quantity__input::-webkit-inner-spin-button,
.sg-detail-quantity__input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.sg-detail-extra-fields {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
    color: #fff;
}

.sg-detail-extra-fields input[type="hidden"] {
    display: none;
}

.sg-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin: 0 0 21px;
}

.sg-detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    padding: 13px 18px;
    border: 1px solid #ef6440;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    transition: background .25s ease, border-color .25s ease, color .25s ease, transform .25s ease;
}

.sg-detail-button:hover {
    transform: translateY(-1px);
}

.sg-detail-button--cart {
    background: #ef6440;
    color: #fff !important;
}

.sg-detail-button--cart:hover {
    background: #d94f2d;
    border-color: #d94f2d;
}

.sg-detail-button--custom {
    background: transparent;
    color: #fff !important;
}

.sg-detail-button--custom:hover {
    background: #fff;
    border-color: #fff;
    color: #111 !important;
}

.sg-detail-button--light {
    border-color: #d5d5d5;
    background: #fff;
    color: #111 !important;
}

.sg-detail-secondary-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.sg-detail-secondary-actions form {
    margin: 0;
}

.sg-detail-text-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #d7d7d7 !important;
    font-size: 14px;
    text-decoration: underline !important;
    cursor: pointer;
    transition: color .22s ease;
}

.sg-detail-text-button:hover {
    color: #ef6440 !important;
}

.sg-detail-text-button.is-disabled {
    color: #777 !important;
    cursor: default;
}

.sg-detail-soldout {
    padding: 16px;
    border: 1px solid #444;
    border-radius: 5px;
    color: #aaa;
    text-align: center;
}

/* ---------- Accordions ---------- */
.sg-detail-accordions {
    border-top: 1px solid #333;
}

.sg-detail-accordion {
    margin: 0;
    border-bottom: 1px solid #333;
}

.sg-detail-accordion > summary {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 15px 42px 15px 0;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.sg-detail-accordion > summary::-webkit-details-marker {
    display: none;
}

.sg-detail-accordion > summary::before,
.sg-detail-accordion > summary::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 8px;
    width: 15px;
    height: 1px;
    background: #ef6440;
    transition: transform .25s ease;
}

.sg-detail-accordion > summary::after {
    transform: rotate(90deg);
}

.sg-detail-accordion[open] > summary::after {
    transform: rotate(0deg);
}

.sg-detail-accordion__content {
    padding: 0 0 22px;
    color: #bdbdbd;
    font-size: 14px;
    line-height: 1.9;
    word-break: break-word;
}

.sg-detail-accordion__content img,
.sg-detail-accordion__content iframe,
.sg-detail-accordion__content video {
    max-width: 100%;
    height: auto;
}

/* ---------- Existing ProductReview plugin output ---------- */
body.sg-product-detail-page #product_review_area {
    width: 100%;
    padding: clamp(40px, 5vw, 78px) 0;
    background: #000;
    color: #fff;
    scroll-margin-top: 20px;
}

body.sg-product-detail-page #product_review_area > .ec-role {
    width: min(90%, 1320px);
    max-width: none;
    margin: 0 auto;
    padding: clamp(24px, 3vw, 42px);
    border: 1px solid #2f2f2f;
    border-radius: 8px;
    background: #111;
    color: #fff;
}

body.sg-product-detail-page #product_review_area .ec-rectHeading {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    background: transparent;
}

body.sg-product-detail-page #product_review_area .ec-rectHeading h4 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0 0 18px;
    border-bottom: 1px solid #333;
    color: #fff;
    font-family: "Maven Pro", Inter, "Noto Sans JP", sans-serif;
    font-size: clamp(25px, 2vw, 36px);
    font-weight: 600;
    line-height: 1.35;
    background: transparent;
}

body.sg-product-detail-page #product_review_area .recommend_average,
body.sg-product-detail-page #product_review_area .recommend_level {
    color: #ef6440;
    letter-spacing: 1px;
}

body.sg-product-detail-page #product_review_area .chevron {
    margin-left: auto;
    color: #ef6440;
}

body.sg-product-detail-page #product_review_area #reviewContent {
    color: #fff;
}

body.sg-product-detail-page #product_review_area .review_list {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.sg-product-detail-page #product_review_area .review_list > li {
    padding: 21px 0;
    border-bottom: 1px solid #2f2f2f;
}

body.sg-product-detail-page #product_review_area .review_date {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 11px;
    color: #999;
    font-size: 13px;
}

body.sg-product-detail-page #product_review_area .recommend_name {
    color: #ddd;
}

body.sg-product-detail-page #product_review_area .recommend_level {
    margin-left: auto;
    font-size: 16px;
}

body.sg-product-detail-page #product_review_area .review_list strong {
    display: block;
    margin-bottom: 7px;
    color: #fff;
    font-size: 16px;
}

body.sg-product-detail-page #product_review_area .review_list p:not(.review_date) {
    margin: 0;
    color: #bdbdbd;
    font-size: 14px;
    line-height: 1.8;
}

body.sg-product-detail-page #product_review_area .ec-inlineBtn--action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 46px;
    margin-top: 22px;
    padding: 11px 20px;
    border: 1px solid #ef6440;
    border-radius: 4px;
    background: #ef6440;
    color: #fff !important;
    font-weight: 600;
}

body.sg-product-detail-page #product_review_area .ec-inlineBtn--action:hover {
    background: #d94f2d;
    border-color: #d94f2d;
}

body.sg-product-detail-page #RelatedProduct-product_area {
    display: none !important;
}

/* ---------- Existing content-bottom blocks ---------- */
body.sg-product-detail-page .custom_return {
    width: 100%;
    margin: 0;
    padding: 0 0 clamp(40px, 5vw, 76px);
    background: #000;
    text-align: center;
}

body.sg-product-detail-page .custom_return > p {
    margin: 0;
}

body.sg-product-detail-page .custom_return img {
    display: block;
    width: min(82%, 1160px) !important;
    max-width: 100%;
    height: auto;
    margin: 0 auto 24px;
}

body.sg-product-detail-page .sg-products-section {
    background: #000;
}

body.sg-product-detail-page .sg-products-section + .sg-products-section {
    padding-top: 34px;
}

/* ---------- Cart success modal ---------- */
.sg-detail-cart-modal {
    position: fixed;
    inset: 0;
    z-index: 12050;
    display: grid;
    place-items: center;
    padding: 20px;
    visibility: hidden;
    pointer-events: none;
}

.sg-detail-cart-modal.is-open {
    visibility: visible;
    pointer-events: auto;
}

.sg-detail-cart-modal__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0,0,0,.72);
    opacity: 0;
    transition: opacity .25s ease;
}

.sg-detail-cart-modal.is-open .sg-detail-cart-modal__overlay {
    opacity: 1;
}

.sg-detail-cart-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    padding: 32px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #111;
    color: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.42);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .25s ease, transform .25s ease;
}

.sg-detail-cart-modal.is-open .sg-detail-cart-modal__dialog {
    opacity: 1;
    transform: translateY(0);
}

.sg-detail-cart-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #222;
    color: #fff;
    cursor: pointer;
}

.sg-detail-cart-modal__dialog h2 {
    margin: 0 30px 24px 0;
    color: #fff;
    font-size: 22px;
    line-height: 1.45;
    text-align: center;
}

.sg-detail-cart-modal__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.sg-detail-modal-open {
    overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .sg-detail-grid {
        gap: 34px;
    }

    .sg-detail-gallery__inner {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 13px;
    }

    .sg-detail-thumb-slider {
        width: 76px;
    }

    .sg-detail-thumb {
        flex-basis: 88px;
        width: 72px;
        height: 88px;
    }
}

@media (max-width: 900px) {
    .sg-detail-grid {
        grid-template-columns: 1fr;
    }

    .sg-detail-gallery,
    .sg-detail-info {
        width: min(100%, 720px);
        margin: 0 auto;
    }

    .sg-detail-main-image img {
        height: min(78vw, 680px);
    }

    .sg-detail-thumb-slider {
        max-height: min(78vw, 680px);
    }
}

@media (max-width: 640px) {
    .sg-detail-container,
    .sg-detail-container--wide {
        width: calc(100% - 32px);
    }

    .sg-detail-title-banner {
        height: 118px;
    }

    .sg-detail-title-banner__image {
        object-fit: cover;
    }

    .sg-detail-title-banner h1 {
        font-size: 29px;
    }

    .sg-detail-product {
        padding-top: 34px;
    }

    .sg-detail-gallery__inner {
        display: flex;
        flex-direction: column-reverse;
        gap: 12px;
    }

    .sg-detail-main-image img {
        height: min(116vw, 580px);
        padding: 9px;
    }

    .sg-detail-thumb-slider {
        display: flex;
        flex-direction: row;
        gap: 8px;
        width: 100%;
        max-height: none;
        padding: 0 0 4px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .sg-detail-thumb {
        flex: 0 0 70px;
        width: 70px;
        height: 80px;
        transform: none !important;
    }

    .sg-detail-product-name {
        font-size: 24px;
    }

    .sg-detail-form-grid,
    .sg-detail-actions,
    .sg-detail-cart-modal__actions {
        grid-template-columns: 1fr;
    }

    .sg-detail-secondary-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    body.sg-product-detail-page #product_review_area > .ec-role {
        width: calc(100% - 32px);
        padding: 22px 18px;
    }

    body.sg-product-detail-page #product_review_area .ec-rectHeading h4 {
        font-size: 24px;
    }

    body.sg-product-detail-page #product_review_area .recommend_level {
        width: 100%;
        margin-left: 0;
    }

    body.sg-product-detail-page .custom_return img {
        width: calc(100% - 32px) !important;
        margin-bottom: 16px;
    }

    .sg-detail-cart-modal__dialog {
        padding: 28px 20px 22px;
    }
}

/* ========================================================================
   V5.2 mobile containment + bottom carousel parity
   - Prevents product/gallery/Slick tracks from expanding the mobile viewport.
   - Keeps recommended and recently-viewed products identical to homepage cards.
   - Forces one product per view on phones and keeps swipe navigation enabled.
   ======================================================================== */

html:has(body.sg-product-detail-page),
body.sg-product-detail-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

body.sg-product-detail-page #main-wrapper,
body.sg-product-detail-page .ec-layoutRole,
body.sg-product-detail-page .ec-layoutRole__header,
body.sg-product-detail-page .ec-layoutRole__contents,
body.sg-product-detail-page .ec-layoutRole__main,
body.sg-product-detail-page .ec-layoutRole__mainWithColumn,
body.sg-product-detail-page .ec-layoutRole__mainBetweenColumn,
body.sg-product-detail-page .ec-layoutRole__mainBottom,
body.sg-product-detail-page .ec-layoutRole__contentBottom,
body.sg-product-detail-page .ec-layoutRole__footer,
body.sg-product-detail-page .sg-detail-main,
body.sg-product-detail-page .sg-detail-product,
body.sg-product-detail-page .sg-detail-container,
body.sg-product-detail-page .sg-detail-grid,
body.sg-product-detail-page .sg-detail-gallery,
body.sg-product-detail-page .sg-detail-gallery__inner,
body.sg-product-detail-page .sg-detail-main-slider,
body.sg-product-detail-page .sg-detail-main-image,
body.sg-product-detail-page .sg-detail-info,
body.sg-product-detail-page .sg-products-section,
body.sg-product-detail-page .sg-products-section .sg-shell,
body.sg-product-detail-page .sg-products-section .sg-slider-shell,
body.sg-product-detail-page .sg-products-section .sg-product-slider {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.sg-product-detail-page img,
body.sg-product-detail-page video,
body.sg-product-detail-page iframe,
body.sg-product-detail-page svg {
    max-width: 100%;
}

/* The supplied banner is 1920 x 160. Preserve that visual proportion instead
   of enlarging it into a tall hero. */
body.sg-product-detail-page .sg-detail-title-banner {
    height: clamp(72px, 8.333333vw, 160px) !important;
    min-height: 0 !important;
    max-height: 160px !important;
}

body.sg-product-detail-page .sg-detail-title-banner__image {
    object-fit: fill !important;
    object-position: center !important;
}

/* Main gallery must clip Slick's intentionally wide track. */
body.sg-product-detail-page .sg-detail-main-slider,
body.sg-product-detail-page .sg-detail-main-slider .slick-list {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

body.sg-product-detail-page .sg-detail-main-slider .slick-track {
    display: flex !important;
    align-items: stretch !important;
}

body.sg-product-detail-page .sg-detail-main-slider .slick-slide,
body.sg-product-detail-page .sg-detail-main-slider .slick-slide > div,
body.sg-product-detail-page .sg-detail-main-image {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.sg-product-detail-page .sg-detail-main-image {
    display: grid !important;
    place-items: center !important;
    aspect-ratio: 1 / 1.12;
    overflow: hidden;
}

body.sg-product-detail-page .sg-detail-main-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

/* If a cached V5.0 script initialized the thumbnail list as Slick, keep the
   generated track contained until V5.2 JavaScript removes that instance. */
body.sg-product-detail-page .sg-detail-thumb-slider,
body.sg-product-detail-page .sg-detail-thumb-slider .slick-list,
body.sg-product-detail-page .sg-detail-thumb-slider .slick-track {
    max-width: 100% !important;
}

/* Bottom blocks use the exact homepage card markup but are strictly contained
   so negative Slick margins or wide tracks cannot widen the detail page. */
body.sg-product-detail-page .sg-products-section {
    width: 100% !important;
    overflow: hidden !important;
}

body.sg-product-detail-page .sg-products-section .sg-slider-shell {
    width: 100% !important;
}

body.sg-product-detail-page .sg-products-section .sg-product-slider,
body.sg-product-detail-page .sg-products-section .sg-product-slider.slick-initialized {
    width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

body.sg-product-detail-page .sg-products-section .slick-list {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

body.sg-product-detail-page .sg-products-section .slick-track {
    display: flex !important;
    align-items: stretch !important;
}

body.sg-product-detail-page .sg-products-section .slick-slide,
body.sg-product-detail-page .sg-products-section .slick-slide > div,
body.sg-product-detail-page .sg-products-section .sg-product-card {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.sg-product-detail-page .sg-products-section .slick-slide {
    height: auto !important;
    padding-right: 8px !important;
    padding-left: 8px !important;
}

body.sg-product-detail-page .sg-products-section .slick-slide > div,
body.sg-product-detail-page .sg-products-section .sg-product-card {
    height: 100% !important;
}

@media (max-width: 900px) {
    body.sg-product-detail-page .sg-detail-grid {
        width: 100% !important;
    }

    body.sg-product-detail-page .sg-detail-gallery,
    body.sg-product-detail-page .sg-detail-info {
        width: 100% !important;
        max-width: 720px !important;
    }
}

@media (max-width: 640px) {
    body.sg-product-detail-page .sg-detail-container,
    body.sg-product-detail-page .sg-detail-container--wide {
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
    }

    body.sg-product-detail-page .sg-detail-title-banner {
        height: 72px !important;
    }

    body.sg-product-detail-page .sg-detail-title-banner h1 {
        font-size: 24px !important;
    }

    body.sg-product-detail-page .sg-detail-product {
        padding-top: 26px !important;
        padding-bottom: 52px !important;
    }

    body.sg-product-detail-page .sg-detail-gallery__inner {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.sg-product-detail-page .sg-detail-main-slider {
        border-radius: 5px;
    }

    body.sg-product-detail-page .sg-detail-main-image {
        width: 100% !important;
        aspect-ratio: 1 / 1.08;
    }

    body.sg-product-detail-page .sg-detail-main-image img {
        padding: 8px !important;
    }

    body.sg-product-detail-page .sg-detail-thumb-slider {
        width: 100% !important;
        max-width: 100% !important;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    body.sg-product-detail-page .sg-detail-thumb-slider::-webkit-scrollbar {
        display: none;
    }

    body.sg-product-detail-page .sg-detail-thumb {
        flex: 0 0 64px !important;
        width: 64px !important;
        height: 74px !important;
        padding: 4px !important;
    }

    body.sg-product-detail-page .sg-detail-info {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    body.sg-product-detail-page .sg-detail-product-name {
        margin-bottom: 13px;
        font-size: 21px !important;
        line-height: 1.5 !important;
    }

    body.sg-product-detail-page .sg-detail-rating {
        gap: 8px;
        margin-bottom: 18px;
    }

    body.sg-product-detail-page .sg-detail-rating__stars {
        font-size: 16px;
    }

    body.sg-product-detail-page .sg-detail-rating__text {
        font-size: 12px;
    }

    body.sg-product-detail-page .sg-detail-price {
        gap: 6px 8px;
    }

    body.sg-product-detail-page .sg-detail-price > span {
        min-width: 68px;
        font-size: 12px;
    }

    body.sg-product-detail-page .sg-detail-price strong {
        font-size: 25px;
    }

    body.sg-product-detail-page .sg-detail-form-grid,
    body.sg-product-detail-page .sg-detail-actions {
        width: 100%;
    }

    body.sg-product-detail-page .sg-detail-button {
        width: 100%;
    }

    /* Same behavior as homepage mobile sliders: one card per swipe. */
    body.sg-product-detail-page .sg-products-section .sg-shell,
    body.sg-product-detail-page .sg-products-section .sg-shell--content {
        width: calc(100% - 32px) !important;
        max-width: calc(100% - 32px) !important;
    }

    body.sg-product-detail-page .sg-products-section .sg-section-heading {
        margin-bottom: 28px;
    }

    body.sg-product-detail-page .sg-products-section .sg-section-heading--row {
        align-items: center;
    }

    body.sg-product-detail-page .sg-products-section .sg-product-slider:not(.slick-initialized) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0 !important;
        width: 100% !important;
    }

    body.sg-product-detail-page .sg-products-section .sg-product-slider.slick-initialized {
        padding-bottom: 4px !important;
    }

    body.sg-product-detail-page .sg-products-section .slick-slide {
        width: auto;
        padding-right: 6px !important;
        padding-left: 6px !important;
    }

    body.sg-product-detail-page .sg-products-section .sg-slider-arrow {
        display: none !important;
    }
}
