/* =========================
   PRODUCT DETAIL
========================= */

.product-detail-page {
    padding: 45px 0 80px;
    background: #f8f8f8;
}

.product-detail-container {
    width: calc(100% - 80px);
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 12px;
    padding: 40px 40px 60px;
    background: #fff;
}


/* =========================
   BREADCRUMB
========================= */

.product-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 30px;

    color: #8a8f99;
    font-size: 13px;
}

.product-breadcrumb a {
    color: #606570;
    text-decoration: none;
    transition: .2s ease;
}

.product-breadcrumb a:hover {
    color: #F63D37;
}

.product-breadcrumb span {
    color: #a7abb3;
}


/* =========================
   PRODUCT TOP
========================= */

.product-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 60px;
    align-items: start;
}


/* =========================
   PRODUCT GALLERY
========================= */

.product-gallery {
    min-width: 0;
}

.product-main-image {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    aspect-ratio: 1 / 1;

    padding: 35px;

    overflow: hidden;

    background: #fff;

    border: 1px solid #e7e9ee;
    border-radius: 12px;
}

.product-main-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.product-no-image {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    color: #c1c5cd;

    font-size: 32px;
    font-weight: 700;
}


/* =========================================================
   PRODUCT THUMBNAIL
========================================================= */

.product-thumb-wrap {
    position: relative;

    width: 100%;
    margin-top: 12px;

    padding: 0 42px;
}

.productThumbSwiper {
    width: 100%;
    overflow: hidden;
}

.productThumbSwiper .swiper-wrapper {
    align-items: stretch;
}

.productThumbSwiper .swiper-slide {
    height: auto;
}

.product-thumbnail {
    display: block;

    width: 100%;
    aspect-ratio: 1 / 1;

    padding: 0;

    overflow: hidden;

    background: #fff;

    border: 1px solid #e7e9ee;
    border-radius: 8px;

    cursor: pointer;
}

.product-thumbnail img {
    display: block;

    width: 100%;
    height: 100%;

    padding: 6px;

    object-fit: contain;
}

.product-thumbnail.active {
    border-color: #0c186a;
}


/* Navigation */

.product-thumb-prev,
.product-thumb-next {
    position: absolute;

    top: 50%;

    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    padding: 0;

    color: #09134F;

    background: #fff;

    border: 1px solid #e0e3e9;
    border-radius: 50%;

    transform: translateY(-50%);

    cursor: pointer;
}

.product-thumb-prev {
    left: 2px;
}

.product-thumb-next {
    right: 2px;
}

.product-thumb-prev:hover,
.product-thumb-next:hover {
    color: #fff;

    background: #09134F;
    border-color: #09134F;
}

.product-thumb-prev.swiper-button-disabled,
.product-thumb-next.swiper-button-disabled {
    opacity: 0;
    pointer-events: none;
}


/* =========================
   MOBILE
========================= */
@media (max-width: 600px) {

    .product-thumb-wrap {
        margin-top: 10px;
        padding: 0 34px;
    }

    .product-thumb-prev,
    .product-thumb-next {
        width: 28px;
        height: 28px;

        font-size: 18px;
    }

    .product-thumb-prev {
        left: 0;
    }

    .product-thumb-next {
        right: 0;
    }
}


/* =========================
   PRODUCT INFO
========================= */

.product-info {
    padding-top: 5px;
}

.product-category {
    display: inline-block;

    margin-bottom: 12px;

    color: #F63D37;

    font-size: 13px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: .5px;
}

.product-info h1 {
    margin: 0 0 15px;

    color: #09134F;

    font-size: 34px;
    font-weight: 600;
    line-height: 1.35;
}


/* =========================
   PRODUCT CODE
========================= */

.product-code {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 20px;

    color: #858a94;

    font-size: 13px;
}

.product-code strong {
    color: #454a54;
    font-weight: 500;
}


/* =========================
   SHORT DESCRIPTION
========================= */

.product-short-description {
    margin-bottom: 25px;

    color: #5d626c;

    font-size: 15px;
    line-height: 1.8;
}


/* =========================
   PRICE
========================= */

.product-detail-price {
    padding: 20px 0;
    border-bottom: 1px solid #eceef1;
    color: #F63D37;
    font-size: 28px;
    font-weight: 600;
}

.product-detail-price.contact-price {
    font-size: 20px;
}


/* =========================
   ACTION
========================= */

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 25px;
}

/* =========================
   PRODUCT ACTION BUTTONS
========================= */

.product-btn-primary,
.product-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 12px 24px;

    border-radius: 8px;

    font-family: 'Prompt', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;

    text-decoration: none;
    white-space: nowrap;

    cursor: pointer;
    appearance: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


/* =========================
   PRIMARY
========================= */

.product-btn-primary {
    border: 1px solid #F63D37;
    background: #F63D37;
    color: #ffffff;
}

.product-btn-primary:hover {
    border-color: #d92f2a;
    background: #d92f2a;
    color: #ffffff;
}

.product-btn-primary:active {
    transform: translateY(1px);
}

.product-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}


/* =========================
   SECONDARY
========================= */

.product-btn-secondary {
    border: 1px solid #09134F;
    background: #ffffff;
    color: #09134F;
}

.product-btn-secondary:hover {
    border-color: #09134F;
    background: #09134F;
    color: #ffffff;
}

.product-btn-secondary:active {
    transform: translateY(1px);
}


/* =========================
   PRODUCT DESCRIPTION
========================= */

.product-description-section {
    margin-top: 65px;
    padding-top: 40px;
}

.product-description-title {
    position: relative;

    margin: 0 0 30px;
    padding-bottom: 14px;

    color: #09134F;

    font-size: 24px;
    font-weight: 600;
}

.product-description-title::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 45px;
    height: 3px;

    background: #F63D37;
}

.product-description {
    max-width: 1000px;

    color: #4f545e;
    font-size: 15px;
    line-height: 1.9;
}

.product-description p {
    margin: 0 0 18px;
}

.product-description h2 {
    margin: 35px 0 15px;

    color: #09134F;

    font-size: 23px;
}

.product-description h3 {
    margin: 28px 0 12px;

    color: #09134F;

    font-size: 19px;
}

.product-description ul,
.product-description ol {
    margin: 15px 0 20px;
    padding-left: 25px;
}

.product-description img {
    max-width: 100%;
    height: auto;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {

    .product-detail-container {
        width: calc(100% - 40px);
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .product-main-image {
        max-width: 600px;
        margin: 0 auto;
    }

    .product-info h1 {
        font-size: 29px;
    }
}


@media (max-width: 600px) {

    .product-description-section {
        margin-top: 40px;
        padding: 35px 0;
    }

    .product-description-section .product-detail-container {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .product-description-main {
        width: 100%;
    }

    .product-description {
        width: 100%;
        padding: 20px 15px;
    }

    .product-description img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 20px auto;
    }

    .related-products {
        padding: 20px 15px;
    }

    .related-products-list {
        grid-template-columns: 1fr;
    }
}

/* =========================
   PRODUCT DESCRIPTION LAYOUT
========================= */

.product-description-section {
    margin-top: 70px;
    padding: 70px 0;
}

.product-content-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) 340px;

    gap: 45px;

    align-items: start;
}


/* =========================
   DESCRIPTION
========================= */

.product-description-main {
    min-width: 0;
}

.product-description-title {
    position: relative;

    margin: 0 0 30px;
    padding-bottom: 14px;

    color: #09134F;
}

.product-description-title::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 45px;
    height: 3px;

    background: #F63D37;
}

.product-description {
    padding: 45px 50px;

    background: #ffffff;

    border: 1px solid #e7e9ee;
    border-radius: 12px;

    line-height: 1.9;
}

.product-description img {
    display: block;

    max-width: 100%;
    height: auto;

    margin: 25px auto;
}


/* =========================
   RELATED PRODUCTS
========================= */

.related-products {
    position: sticky;
    top: 110px;

    padding: 28px;

    background: #ffffff;

    border: 1px solid #e7e9ee;
    border-radius: 12px;
}

.related-products-title {
    position: relative;

    margin: 0 0 25px;
    padding-bottom: 12px;

    color: #09134F;
}

.related-products-title::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 35px;
    height: 3px;

    background: #F63D37;
}


/* =========================
   RELATED ITEM
========================= */

.related-products-list {
    display: flex;
    flex-direction: column;
}

.related-product-card {
    display: grid;

    grid-template-columns:
        90px minmax(0, 1fr);

    gap: 16px;

    align-items: center;

    padding: 18px 0;

    border-bottom: 1px solid #eceef2;

    text-decoration: none;
}

.related-product-card:first-child {
    padding-top: 0;
}

.related-product-card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}


/* =========================
   IMAGE
========================= */

.related-product-image {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 90px;
    aspect-ratio: 1 / 1;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e7e9ee;
    border-radius: 8px;
}

.related-product-image img {
    width: 100%;
    height: 100%;

    padding: 8px;

    object-fit: contain;

    transition: transform .25s ease;
}

.related-product-card:hover .related-product-image img {
    transform: scale(1.06);
}

.related-product-no-image {
    color: #9ca3af;
}


/* =========================
   INFO
========================= */

.related-product-info {
    min-width: 0;
}

.related-product-info h3 {
    margin: 0 0 6px;

    color: #09134F;
}

.related-product-info span {
    color: #8a8f99;
}

.related-product-card:hover .related-product-info h3 {
    color: #F63D37;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1050px) {

    .product-content-layout {
        grid-template-columns: 1fr;
    }

    .related-products {
        position: static;
    }

    .related-products-list {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 20px;
    }

    .related-product-card,
    .related-product-card:first-child,
    .related-product-card:last-child {
        padding: 15px;

        border: 1px solid #eceef2;
        border-radius: 8px;
    }

}


@media (max-width: 600px) {

    .product-description-section {
        margin-top: 50px;
        padding: 45px 0;
    }

    .product-description {
        padding: 28px 22px;
    }

    .related-products {
        padding: 22px;
    }

    .related-products-list {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   PRODUCT VARIANTS
========================================================= */

.product-variant-selector {
    margin-top: 24px;
    padding-top: 22px;
}

.product-option-group+.product-option-group {
    margin-top: 20px;
}

.product-option-title {
    margin-bottom: 10px;
    color: #09134F;
    font-weight: 600;
}

.product-option-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-option-value {
    min-width: 64px;
    min-height: 42px;

    padding: 9px 18px;

    background: #ffffff;
    color: #09134F;

    border: 1px solid #d9dde5;
    border-radius: 8px;

    cursor: pointer;

    transition:
        border-color .2s ease,
        background .2s ease,
        color .2s ease,
        box-shadow .2s ease;
}

.product-option-value:hover {
    border-color: #0c186a;
}

.product-option-value.active {
    background: #09134F;
    border-color: #09134F;
    color: #ffffff;

    box-shadow:
        0 3px 10px rgba(9, 19, 79, .12);
}


/* =========================
   PRODUCT QUANTITY
========================= */

.product-price-box {
    margin-top: 24px;
}

.product-unit-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
    color: #6b7280;
}

.product-unit-price strong {
    font-size: 30px;
    font-weight: 700;
    color: #F63D37;
}

.product-quantity-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.quantity-label {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.quantity-btn {
    width: 44px;
    height: 44px;
    border: 0;
    background: #fff;
    color: #0c186a;
    font-size: 24px;
    cursor: pointer;
    transition: 0.2s ease;
}

.quantity-btn:hover {
    background: #f3f4f6;
}

.quantity-input {
    width: 60px;
    height: 44px;
    border: 0;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    outline: none;

    -moz-appearance: textfield;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.product-total-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.product-total-price span {
    color: #6b7280;
}

.product-total-price strong {
    font-size: 28px;
    font-weight: 700;
    color: #F63D37;
}

@media (max-width: 576px) {

    .product-unit-price strong {
        font-size: 26px;
    }

    .product-total-price strong {
        font-size: 24px;
    }

}

/* เพิ่มท้าย /assets/css/product-detail.css */

.product-btn-primary {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.product-btn-primary:disabled {
    opacity: .6;
    cursor: wait;
}

.product-cart-message {
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.product-cart-message.success {
    background: #ecfdf3;
    color: #166534;
}

.product-cart-message.error {
    background: #fff1f2;
    color: #be123c;
}