.product-overview {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.product-overview-photo { width: 144px; max-width: 100%; }
.product-overview-info { min-width: 0; overflow-wrap: anywhere; }
.product-zoom {
    display: grid; place-items: center; width: 100%; aspect-ratio: 1;
    padding: 8px; border: 0; background: transparent; cursor: zoom-in;
}
.product-zoom:disabled { opacity: 1; cursor: default; }
.product-zoom img { display: block; width: auto; height: auto; max-width: 100%; max-height: 128px; object-fit: contain; }
.product-overview-placeholder {
    display: grid; place-items: center; aspect-ratio: 1; color: #495869;
    background: #f6f8fa; border-radius: 4px; font-size: .8rem;
}
.product-lightbox[hidden] { display: none; }
.product-lightbox {
    width: min(92vw, 42rem); max-height: 90vh; border: none; border-radius: .5rem;
    margin: auto; padding: 0; color: #172b45; background: #fff; text-align: center; overflow: auto;
}
.product-lightbox::backdrop { background: rgba(9, 19, 33, .78); }
.product-lightbox.is-fallback {
    display: block; position: fixed; inset: 0; width: 100%; height: 100%;
    max-width: none; max-height: none; z-index: 1100; background: rgba(9, 19, 33, .78); border-radius: 0;
}
.product-lightbox.is-fallback .product-lightbox-panel { width: min(92vw, 42rem); margin: 5vh auto; border-radius: .5rem; }
.product-lightbox-panel { background: #fff; padding: 1rem; }
.product-lightbox-panel h2 { font-size: 1rem; margin: .6rem 0; overflow-wrap: anywhere; }
.product-lightbox-close { padding: .45rem .75rem; min-height: 44px; cursor: pointer; }
.product-lightbox img {
    display: block; width: min(100%, 32rem); height: auto; max-height: 65vh;
    object-fit: contain; margin: auto;
}
.catalog-comparison .shop-purchase-button {
    display: inline-flex; align-items: center; min-height: 44px; gap: .35rem; padding: .45rem .75rem;
    border-radius: .35rem; background: #174f8e; color: #fff; font-weight: 650; white-space: nowrap; text-decoration: none;
}
.catalog-comparison .shop-purchase-button:hover { background: #103e72; }
.shop-purchase-button:focus-visible, .product-zoom:focus-visible, .product-lightbox-close:focus-visible {
    outline: 2px solid #175899; outline-offset: 2px;
}
@media (max-width: 540px) {
    .product-overview { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .product-overview-photo { justify-self: center; }
}


/* ONEDAN DETAIL UI V3 */

.product-detail-summary {
    padding: 28px;
}

.product-overview {
    grid-template-columns: minmax(180px, 32%) minmax(0, 1fr);
    gap: 30px;
}

.product-overview-photo {
    width: 100%;
    max-width: 340px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: white;
}

.product-zoom {
    padding: 24px;
    background: white;
}

.product-zoom img {
    max-height: 290px;
}

.product-detail-title {
    font-size: clamp(19px, 2vw, 26px);
    line-height: 1.5;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.catalog-identifiers {
    font-size: 13px;
    margin: 20px 0;
    gap: 8px 16px;
}

.catalog-identifiers dd {
    font-weight: 600;
}

.detail-price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.detail-price-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 17px;
    border: 1px solid #eadce0;
    border-radius: 12px;
    background: #fff6f7;
}

.detail-total-panel {
    background: #f0f6ff;
    border-color: #d9e5f6;
}

.detail-price-label {
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 650;
}

.detail-main-price {
    color: #d62f45;
    font-size: clamp(20px, 2.3vw, 32px);
    line-height: 1.4;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.detail-total-panel .detail-main-price {
    color: #174f9e;
}

.detail-stock-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.detail-stock-summary span {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    background: #edf3fb;
    color: #315783;
    font-weight: 650;
}

.detail-updated {
    margin: 14px 0;
    font-size: 11px;
    color: var(--text-sub);
}

.detail-compare-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 45px;
    padding: 10px 20px;
    border-radius: 9px;
    background: #1658b4;
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.detail-compare-button:hover {
    background: #10458e;
}

.product-detail-comparison {
    scroll-margin-top: 150px;
}

.detail-comparison-note {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 9px;
}

.detail-disclosure {
    padding: 12px;
    background: #f4f7fb;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-sub);
    margin: 12px 0;
}

.catalog-comparison {
    margin-top: 20px;
}

.catalog-comparison table {
    min-width: 840px;
}

.catalog-comparison th:first-child,
.catalog-comparison td:first-child {
    min-width: 130px;
    max-width: 190px;
    white-space: normal;
    overflow-wrap: anywhere;
    z-index: 1;
}

.catalog-comparison th:first-child {
    background: #edf3fa;
}

.catalog-comparison tbody tr:hover td {
    background: #f5f8fc;
}

.detail-table-price {
    font-size: 16px;
    font-weight: 750;
    color: #d62f45;
    font-variant-numeric: tabular-nums;
}

.detail-stock-status {
    display: inline-block;
    background: #eef1f5;
    color: #52647a;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 12px;
}

.detail-stock-status.is-in-stock {
    background: #e7f5ed;
    color: #226542;
}

.catalog-comparison .shop-purchase-button {
    background: #1658b4;
    border-radius: 8px;
    font-size: 12px;
    padding: 9px 14px;
}

@media (max-width: 900px) {
    .product-detail-layout > .sidebar {
        grid-row: 2;
    }
}

@media (max-width: 680px) {
    .product-detail-summary {
        padding: 18px;
    }

    .product-overview {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .product-overview-photo {
        max-width: 260px;
        justify-self: center;
    }

    .product-zoom {
        padding: 18px;
    }

    .product-zoom img {
        max-height: 220px;
    }

    .product-detail-title {
        font-size: 19px;
    }

    .detail-price-grid {
        gap: 8px;
    }

    .detail-price-panel {
        padding: 12px;
    }

    .detail-main-price {
        font-size: 23px;
    }

    .detail-compare-button {
        width: 100%;
    }

    .catalog-comparison th:first-child,
    .catalog-comparison td:first-child {
        min-width: 100px;
        max-width: 130px;
    }

    .product-detail-comparison {
        scroll-margin-top: 160px;
    }
}


/* ONEDAN DETAIL UI V4 */

.catalog-comparison .best-total-row td {
    background: #f1f7ff;
}

.best-price-label {
    display: block;
    width: fit-content;
    font-size: 10px;
    line-height: 1.5;
    padding: 3px 7px;
    margin-bottom: 5px;
    border-radius: 5px;
    color: #b7263d;
    background: #fce5e9;
    font-weight: 700;
}

.best-price-label.total {
    color: #174f9e;
    background: #dceaff;
}

.detail-shop-name {
    font-weight: 650;
}

.detail-table-total {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .catalog-comparison {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .catalog-comparison table {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .catalog-comparison thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .catalog-comparison tbody {
        display: grid;
        gap: 14px;
        width: 100%;
    }

    .catalog-comparison tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 14px;
        gap: 8px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: white;
    }

    .catalog-comparison tbody tr.best-total-row {
        border-color: #8ab1e9;
        background: #f1f7ff;
    }

    .catalog-comparison tbody tr td {
        display: block;
        position: static;
        min-width: 0;
        max-width: none;
        padding: 6px 0;
        border: 0;
        box-shadow: none;
        background: transparent !important;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .catalog-comparison td::before {
        display: block;
        content: attr(data-label);
        font-size: 11px;
        font-weight: 500;
        color: var(--text-sub);
        margin-bottom: 4px;
    }

    .catalog-comparison td.detail-shop-name {
        grid-column: 1 / -1;
        font-size: 16px;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 10px;
    }

    .catalog-comparison td.detail-table-date {
        font-size: 11px;
    }

    .catalog-comparison td.detail-table-purchase {
        grid-column: 1 / -1;
    }

    .detail-table-purchase::before {
        display: none !important;
    }

    .catalog-comparison .shop-purchase-button {
        display: flex;
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }
}


/* ONEDAN SHOP UI V5 */

.shop-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.shop-logo-wrap {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border: 1px solid #dce6f3;
    border-radius: 9px;
    background: #edf3fb;
    color: #1658b4;
    overflow: hidden;
}

.shop-logo-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 3px;
    object-fit: contain;
    background: #fff;
}

.shop-logo-image[hidden] {
    display: none;
}

.shop-identity-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.shop-display-name {
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.shop-mall-label {
    color: #a62332;
    font-size: 11px;
    font-weight: 500;
}

.catalog-comparison th:first-child,
.catalog-comparison td:first-child {
    min-width: 180px;
    max-width: 240px;
}

@media (max-width: 900px) {
    .catalog-comparison tbody tr td.detail-shop-name {
        min-width: 0;
        max-width: none;
    }

    .shop-logo-wrap {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
    }

    .shop-display-name {
        font-size: 15px;
    }
}


/* ONEDAN DETAIL UI V9 */

.product-overview-photo {
    align-self: start;
    aspect-ratio: 1 / 1;
}

.product-overview-photo .product-zoom {
    width: 100%;
    height: 100%;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.product-overview-photo .product-zoom img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (max-width: 680px) {
    .product-overview-photo {
        max-width: 280px;
    }

    .product-overview-photo .product-zoom {
        padding: 12px;
    }
}
