.product-detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 34px 24px 80px;
    color: #000;
}

.product-detail-page .site-breadcrumb {
    margin: 0 0 24px;
    padding: 0;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 278px minmax(0, 1fr);
    gap: 70px;
}

.product-side-bar {
    min-width: 0;
}

.product-menu-bar,
.line-contact,
.detail-panel,
.detail2-panel {
    border: 1px solid #f1f1f1;
    border-radius: 10px;
    background: #fff;
}

.product-menu-title {
    display: block;
    padding: 13px 16px;
    background: #ff431b;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
}

.product-menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-menu-row {
    border-top: 1px solid #c2c2c2a1;
}

.product-side-row {
    display: block;
    padding: 12px 15px;
    color: #000;
    font-size: 14px;
    text-decoration: none;
}

.product-side-row:hover,
.product-menu-row.is-active .product-side-row {
    color: #ff3a00;
    background: #fff8f6;
}

.product-side-row:hover {
    font-weight: 500;
}

.product-side-row::before {
    content: "\2022";
    margin-right: 8px;
    color: #d9d9d9;
}

.product-side-row:hover::before {
    content: "\2022";
    margin-right: 8px;
    color: #ff3a00;
}

.product-menu-row.is-active .product-side-row::before {
    color: #ff3a00;
}

.line-contact {
    margin-top: 28px;
    padding: 22px 12px;
    text-align: center;
    color: #4fba58;
    font-size: 14px;
}

.line-contact img {
    width: 138px;
    height: 138px;
    object-fit: contain;
}

.line-contact p {
    margin: 10px 0;
    font-size: 16px;
    color: #000;
}

.line-contact p i {
    padding: 0.5px 4px;
    font-size: 14px;
    color: #fff;
    background: #4fba58;
    border-radius: 5px;
}

.product-main {
    min-width: 0;
    overflow-x: visible;
}

.product-hero {
    display: grid;
    grid-template-columns: 287px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.product-gallery {
    position: relative;
    width: 287px;
    height: 287px;
    margin: 0 auto;
}

.product-gallery-viewport {
    position: relative;
    width: 287px;
    height: 287px;
    overflow: hidden;
}

.product-gallery-track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

.product-gallery-slide {
    display: block;
    flex: 0 0 287px;
    width: 287px;
    height: 287px;
}

.product-gallery-slide img {
    display: block;
    width: 287px;
    height: 287px;
    object-fit: contain;
    border: 1px solid #e5e5e5;
    box-sizing: border-box;
}

.product-gallery-control {
    position: absolute;
    top: 50%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 0;
    border-radius: 50%;
    background: #09090929;
    color: #818181;
    font-size: 24px;
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        background 0.2s ease,
        color 0.2s ease,
        opacity 0.2s ease;
}

.product-gallery-control:hover {
    background: #00000040;
    color: #ffffff;
}

.product-gallery-control[hidden] {
    display: none;
}

.product-gallery-control-prev {
    left: -25px;
}

.product-gallery-control-next {
    right: -25px;
}

.product-gallery-dots {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 10px;
}

.product-gallery-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d9d9d9;
    cursor: pointer;
}

.product-gallery-dot.is-active {
    background: #ea9f69;
}

.product-gallery-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d8d8d8;
}

.product-gallery-dots span:first-child {
    background: #f4a261;
}

.product-summary .product-eyebrow {
    margin: 4px 0 8px;
    color: #ff431b;
    font-size: 14px;
    font-weight: 400;
}

.product-summary h1 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 600;
}

.product-summary .product-details {
    margin: 0;
    color: #9f9c9c;
    font-size: 14px;
    line-height: 1.7;
}

.product-price-box {
    margin: 20px 0 15px;
    padding: 14px;
    border: 1px solid #ffd2c5;
    border-radius: 5px;
    background: #fff8f6;
}

.product-price-box span {
    display: block;
    color: #6b6b6b;
    font-size: 14px;
}

.product-price-box strong {
    display: block;
    margin: 3px 0;
    color: #ff431b;
    font-size: 24px;
    font-weight: 600;
}

.product-price-box strong label {
    color: #000;
    font-size: 14px;
    font-weight: 400;
}

.product-price-box small {
    color: #9f9c9c;
    font-size: 12px;
}

.product-actions {
    display: flex;
    gap: 20px;
}

.product-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 39px;
    padding: 0 18px;
    border-radius: 5px;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0px 4px 7px 0px #00000021;
}

.product-action-primary {
    background: #16ae4e;
    color: #fff;
    box-shadow: 0px 4px 7px 0px #00000021;
    transition: background 0.3s;
}

.product-action-secondary {
    border: 1px solid #ca7b55;
    color: #ca7b55;
    box-shadow: 0px 4px 7px 0px #00000021;
    transition:
        background 0.3s,
        color.3s;
}

.product-action-primary:hover {
    background: #00923c;
}

.product-action-secondary:hover {
    border: 1px solid #ca7b55;
    background: #d94300;
    color: #fff;
}

.product-tabs {
    position: relative;
    display: flex;
    gap: 0;
    margin-top: 40px;
    padding-top: 10px;
    border-top: 1px solid #d9d8d4;
    border-bottom: 1px solid #d9d8d4;
}

.product-tab {
    position: relative;
    padding: 10px 22px;
    border: 0;
    background: none;
    color: #000;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
}

.product-tab.is-active {
    color: #fd3a00;
    font-weight: 400;
}

.product-tabs-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: #fd3a00;
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.3s ease,
        width 0.3s ease,
        opacity 0.2s ease;
}

.product-tabs-indicator.is-ready {
    opacity: 1;
}

.product-tabs-indicator.is-instant {
    transition: none;
}

.product-tab-panel {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-top: 20px;
}

.product-tab-panel.details.is-active {
    display: grid;
}

.product-tab-panel.spec.is-active {
    display: flex;
}

.product-tab-panel.design.is-active {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-panel,
.detail2-panel {
    padding: 20px;
}

.detail-panel h2,
.detail2-panel h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 400;
}

.detail-panel p,
.detail-panel li,
.detail2-panel p,
.detail2-panel li {
    color: #9f9c9c;
    font-size: 16px;
    line-height: 1.8;
}

.detail-panel ul,
.detail2-panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.detail-panel li,
.detail2-panel li {
    position: relative;
    padding-left: 20px;
}

.detail-panel li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #ff603e;
    font-weight: 700;
}

.detail2-panel li::before {
    content: "\2666";
    position: absolute;
    left: 0;
    color: #ffd600;
    font-weight: 700;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
}

.spec-table th,
.spec-table td {
    padding: 10px 20px;
    border: 1px solid #000;
    color: #000;
    vertical-align: top;
}

.spec-table th {
    background: #dddddd;
    font-weight: 500;
    font-size: 14px;
    text-align: left;
}

.spec-table td {
    font-size: 16px;
}

.spec-table tbody tr:nth-child(odd) {
    background: #fefefe;
}

.spec-table tbody tr:nth-child(even) {
    background: #f6f6f6;
}

.spec-table td:first-child {
    width: 20%;
}

.product-examples {
    padding: 0;
}

.product-examples .section-title {
    margin-bottom: 16px;
}

.product-examples .section-title small {
    color: #000;
    font-size: 18px;
    font-weight: 400;
}

.product-examples .section-title h1 {
    display: none;
}

.product-examples .gallery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, 183px);
    justify-content: space-between;
    gap: 25px;
}

.product-examples .gallery-card {
    width: 183px;
    height: 183px;
}

.product-examples .gallery-image {
    width: 183px;
    height: 183px;
    aspect-ratio: auto;
    position: relative;
}

.product-examples .gallery-image img {
    max-height: 183px;
    border-radius: 5px;
}

.gallery-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #d9d9d941;
    opacity: 0;
    pointer-events: none;
}

.gallery-card:hover .gallery-image::after {
    animation: gallery-flash 0.6s ease;
}

@keyframes gallery-flash {
    0% {
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.color-selection {
    margin-top: 34px;
}

.color-selection h2 {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 400;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 35px;
}

.color-swatch,
.color-add {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.color-swatch {
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px #d7d7d7;
    cursor: pointer;
}

.color-swatch:hover,
.color-swatch.is-selected {
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 3px #555;
}

.color-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #000;
    background: #fff;
    color: #000;
    font-size: 17px;
    cursor: pointer;
}

.color-selection p {
    margin: 14px 0 0;
    color: #9f9c9c;
    font-size: 16px;
}

/* ================= COLOR MODAL (ตัวอย่างสีจาก color-swatch) ================= */

/* repo นี้ไม่มี global box-sizing reset — กัน padding บวกความกว้างจนล้นจอ */
.color-modal,
.color-modal *,
.color-modal *::before,
.color-modal *::after {
    box-sizing: border-box;
}

.color-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow: hidden;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.color-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.color-modal-dialog {
    /* ใช้ inset:0 แทน width/height:100% — กัน padding ดันกล่องเกินจอ (repo ไม่มี global box-sizing: border-box) */
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 64px 24px 40px;
}

.color-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    padding: 0;
    border: 2px solid #c5c5c5;
    border-radius: 50%;
    background: #fff;
    color: #000;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.color-modal-stage {
    /* ไม่ตั้ง position — ให้ปุ่มลูกศร (.color-modal-nav) อ้างอิงกล่อง dialog เต็มจอ ระยะขอบจึงตรงกับดีไซน์ */
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 0;
}

.color-modal-viewport {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.color-modal-track {
    display: flex;
    transition: transform 0.45s ease;
    will-change: transform;
}

.color-modal-track.is-instant {
    transition: none;
}

.color-modal-slide {
    flex: 0 0 100%;
    min-width: 0;
    /* <figure> มี margin เริ่มต้นจาก browser (40px ข้าง) — ต้องล้าง ไม่งั้นสไลด์กว้างเกิน viewport เลื่อนแล้วเพี้ยน */
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 76px;
    box-sizing: border-box;
    pointer-events: none;
}

.color-modal-imgbox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(560px, 100%);
}

.color-modal-imgbox img {
    display: block;
    max-width: 100%;
    max-height: 58vh;
    object-fit: contain;
    pointer-events: auto;
}

.color-modal-caption {
    margin: 0;
    color: #9f9c9c;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
    pointer-events: auto;
}

.color-modal-nav {
    position: absolute;
    top: 50%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    padding: 0;
    border: 2px solid #c5c5c5;
    border-radius: 50%;
    background: #fff;
    color: #000;
    cursor: pointer;
    transform: translateY(-50%);
}

.color-modal-nav[hidden] {
    display: none;
}

.color-modal-nav-prev {
    left: 26px;
}

.color-modal-nav-next {
    right: 26px;
}

/* กดปุ่มหรือ hover — ลูกศรเดิมเลื่อนออกตามทิศทางที่กด แล้วลูกศรใหม่เลื่อนเข้ามาแทน */
.color-modal-nav-icon {
    position: relative;
    width: 18px;
    height: 18px;
    overflow: hidden;
}

.color-modal-nav-icon .bi {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    line-height: 1;
}

.color-modal-nav-icon .bi:not(.is-current) {
    opacity: 0;
}

@keyframes color-modal-arrow-out-next {
    from {
        transform: translate(-50%, -50%);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -50%) translateX(150%);
        opacity: 0;
    }
}

@keyframes color-modal-arrow-in-next {
    from {
        transform: translate(-50%, -50%) translateX(-150%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes color-modal-arrow-out-prev {
    from {
        transform: translate(-50%, -50%);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -50%) translateX(-150%);
        opacity: 0;
    }
}

@keyframes color-modal-arrow-in-prev {
    from {
        transform: translate(-50%, -50%) translateX(150%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.color-modal-nav.is-anim-next .bi.is-current {
    animation: color-modal-arrow-out-next 0.3s ease forwards;
}

.color-modal-nav.is-anim-next .bi:not(.is-current) {
    animation: color-modal-arrow-in-next 0.3s ease forwards;
}

.color-modal-nav.is-anim-prev .bi.is-current {
    animation: color-modal-arrow-out-prev 0.3s ease forwards;
}

.color-modal-nav.is-anim-prev .bi:not(.is-current) {
    animation: color-modal-arrow-in-prev 0.3s ease forwards;
}

@media (max-width: 800px) {
    .color-modal-dialog {
        padding: 60px 14px 28px;
    }

    .color-modal-close {
        width: 41px;
        height: 41px;
    }

    .color-modal-slide {
        padding: 0 58px;
    }

    .color-modal-imgbox img {
        max-height: 48vh;
    }

    .color-modal-nav {
        width: 55px;
        height: 55px;
    }

    .color-modal-nav-prev {
        left: 12px;
    }

    .color-modal-nav-next {
        right: 12px;
    }

    /* ---------- หน้า product details ---------- */
    .product-detail-page {
        padding: 15px 16px 30px;
    }

    .product-detail-layout,
    .product-hero {
        grid-template-columns: 1fr;
    }

    .product-side-bar {
        order: 0;
    }

    .product-main {
        order: 1;
    }

    .product-menu-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .product-menu-title {
        grid-column: 1 / -1;
        font-size: 16px;
    }

    .product-side-row {
        font-size: 16px;
    }

    .product-summary h1 {
        font-size: 27px;
    }

    .product-summary .product-details {
        font-size: 16px;
    }

    .product-price-box span {
        font-size: 16px;
    }

    .product-price-box small {
        font-size: 14px;
    }

    .product-actions {
        flex-direction: column;
        gap: 10px;
    }

    .spec-table td:first-child {
        width: 30%;
    }

    .product-tabs {
        justify-content: space-around;
    }

    .product-tab {
        padding: 13px 10px;
    }

    .product-examples .gallery-list {
        gap: 10px;
        grid-template-columns: repeat(auto-fill, 152px);
        justify-content: space-around;
    }

    .product-examples .gallery-card {
        width: 152px;
        height: 152px;
    }

    .product-examples .gallery-image {
        width: 152px;
        height: 152px;
    }
}

@media (max-width: 520px) {
    .product-tab-panel {
        grid-template-columns: 1fr;
    }

    .product-menu-list {
        grid-template-columns: 1fr;
    }

    .product-actions > * {
        flex: 1;
    }
}
