/* ================= PRODUCT DETAIL PAGE ================= */

.product-detail-page {
    margin: 0;
    background: #fbf4e8;
    color: #302720;
    font-family: Arial, Helvetica, sans-serif;
    padding-bottom: clamp(84px, 7vw, 126px);
    overflow-x: hidden;
}

.product-detail-hero {
    display: none;
}

.detail-section {
    padding: clamp(24px, 3vw, 48px) 0 clamp(48px, 5vw, 88px);
    background:
        radial-gradient(circle at top left, rgba(216, 173, 97, 0.14), transparent 32%),
        linear-gradient(180deg, #fff8ec 0%, #f8f1e6 100%);
}

.detail-wrap {
    width: min(96%, 1520px);
    margin: 0 auto;
}

.product-panel {
    padding: clamp(22px, 2.2vw, 36px);
    border: 1.5px solid rgba(184, 137, 73, 0.42);
    border-radius: 24px;
    background: rgba(255, 253, 247, 0.92);
    box-shadow: 0 18px 38px rgba(110, 78, 34, 0.1);
}

.product-top {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.35fr) minmax(250px, 0.9fr);
    gap: clamp(24px, 2.8vw, 44px);
    align-items: start;
}

.detail-sidebar {
    min-width: 0;
}

.gallery-main {
    position: relative;
    border: 1.5px solid rgba(184, 137, 73, 0.38);
    border-radius: 20px;
    overflow: hidden;
    background: #f4ead8;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.gallery-nav:hover {
    transform: translateY(-50%) scale(1.06);
}

.gallery-prev {
    left: 12px;
    background: rgba(6, 76, 61, 0.92);
    color: #fff;
}

.gallery-next {
    right: 12px;
    background: linear-gradient(180deg, #f5d98b 0%, #d8a63a 100%);
    color: #064c3d;
}

.gallery-thumbs-wrap {
    margin-top: 12px;
    overflow: hidden;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.gallery-thumbs .thumb {
    flex: 0 0 clamp(68px, 12vw, 92px);
    scroll-snap-align: center;
    aspect-ratio: 1 / 1;
    border: 1.3px solid rgba(184, 137, 73, 0.35);
    border-radius: 12px;
    background: rgba(255, 248, 236, 0.82);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    transition: 0.22s ease;
}

.thumb.active,
.thumb:hover {
    border-color: #9b1117;
    transform: translateY(-2px);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-summary h2 {
    margin: 0 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(24px, 2.2vw, 40px);
    line-height: 1.18;
    color: #064c3d;
}

.product-category {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(155, 17, 23, 0.08);
    color: #8b1b1e;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.detail-price {
    margin: 0 0 clamp(10px, 1vw, 16px);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(22px, 1.9vw, 34px);
    font-weight: 800;
    color: #9b1117;
}

.variant-picker {
    margin: 0 0 clamp(14px, 1.4vw, 22px);
}

.variant-label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #6b4f2a;
    letter-spacing: 0.3px;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant-option {
    min-width: 88px;
    padding: 10px 18px;
    border: 1.5px solid rgba(184, 137, 73, 0.45);
    border-radius: 999px;
    background: #fffaf2;
    color: #4f3b24;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.variant-option small {
    font-size: 12px;
    font-weight: 600;
    color: #9b1117;
}

.variant-option:hover {
    border-color: rgba(155, 17, 23, 0.55);
    background: #fff4e4;
}

.variant-option.active {
    border-color: #9b1117;
    background: linear-gradient(180deg, #b61d24 0%, #8f1419 100%);
    color: #fff8ef;
    box-shadow: 0 8px 18px rgba(155, 17, 23, 0.22);
}

.variant-option.active small {
    color: #ffe2a9;
}

.summary-box {
    padding: clamp(14px, 1.2vw, 20px);
    border-radius: 16px;
    background: rgba(255, 248, 236, 0.72);
    border: 1px solid rgba(184, 137, 73, 0.22);
}

.summary-box + .summary-box {
    margin-top: 14px;
}

.summary-box h3,
.info-block h3 {
    margin: 0 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(18px, 1.4vw, 24px);
    color: #8b1b1e;
}

.summary-list,
.detail-list {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.summary-list li,
.detail-list li {
    position: relative;
    padding-left: 22px;
    color: #4f4a43;
    font-size: clamp(14px, 0.98vw, 16px);
    line-height: 1.55;
}

.summary-list li::before,
.detail-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: clamp(14px, 1vw, 18px);
    height: clamp(14px, 1vw, 18px);
    background: url("https://res.cloudinary.com/ln22f4im/image/upload/f_auto,q_auto,w_600/v1783077775/logo_z4ndms.png") center / contain no-repeat;
}

.detail-purchase-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    margin-top: clamp(18px, 1.6vw, 26px);
}

.detail-qty {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: clamp(108px, 8vw, 128px);
    height: clamp(42px, 3.2vw, 54px);
    border: 1.5px solid rgba(184, 137, 73, 0.48);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.detail-qty button {
    width: clamp(34px, 2.6vw, 42px);
    height: 100%;
    border: none;
    background: rgba(255, 248, 236, 0.9);
    color: #5c4a36;
    font-size: clamp(18px, 1.2vw, 22px);
    line-height: 1;
    cursor: pointer;
    transition: 0.2s ease;
}

.detail-qty button:hover {
    background: rgba(245, 217, 139, 0.45);
    color: #8b1b1e;
}

.detail-qty input {
    width: clamp(36px, 2.8vw, 44px);
    height: 100%;
    border: none;
    border-left: 1px solid rgba(184, 137, 73, 0.28);
    border-right: 1px solid rgba(184, 137, 73, 0.28);
    background: #fff;
    color: #302720;
    text-align: center;
    font-size: clamp(14px, 1vw, 17px);
    font-weight: 700;
    appearance: textfield;
    -moz-appearance: textfield;
}

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

.detail-buy,
.detail-cart {
    flex: 1 1 0;
    min-width: 0;
    min-height: clamp(42px, 3.2vw, 54px);
    height: auto;
    padding: 0 clamp(12px, 1vw, 20px);
    border-radius: 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(14px, 1vw, 17px);
    font-weight: 700;
    cursor: pointer;
    transition: 0.24s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
}

.detail-buy {
    border: 1.5px solid #b88949;
    background: linear-gradient(180deg, #f5d98b, #e8c56a 45%, #c99334);
    color: #4b0000;
}

.detail-cart {
    border: 1.5px solid #064c3d;
    background: #064c3d;
    color: #fff;
}

.detail-buy:hover,
.detail-cart:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.info-block {
    margin-top: clamp(24px, 2.4vw, 40px);
    padding-top: clamp(20px, 1.8vw, 32px);
    border-top: 1px solid rgba(184, 137, 73, 0.24);
}

.info-block p {
    margin: 0 0 12px;
    color: #4f4a43;
    font-size: clamp(15px, 1.02vw, 17px);
    line-height: 1.72;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 14px;
}

.spec-table th,
.spec-table td {
    border: 1px solid rgba(184, 137, 73, 0.28);
    padding: 11px 14px;
    text-align: left;
    vertical-align: top;
    font-size: clamp(14px, 0.98vw, 16px);
    line-height: 1.5;
}

.spec-table th {
    width: 34%;
    color: #064c3d;
    background: rgba(216, 173, 97, 0.16);
    font-family: Georgia, "Times New Roman", serif;
}

.product-content-html h3 {
    margin: 18px 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    color: #8b1b1e;
    font-size: clamp(18px, 1.35vw, 22px);
}

.product-content-html p,
.product-content-html li {
    color: #4f4a43;
    font-size: clamp(15px, 1.02vw, 17px);
    line-height: 1.72;
}

.product-content-html ul {
    margin: 0 0 14px;
    padding-left: 22px;
}

.side-card {
    margin-bottom: 16px;
    padding: clamp(16px, 1.4vw, 24px);
    border-radius: 20px;
    border: 1.4px solid rgba(184, 137, 73, 0.36);
    background: rgba(255, 253, 247, 0.9);
    box-shadow: 0 14px 30px rgba(110, 78, 34, 0.08);
}

.side-card h3 {
    margin: 0 0 14px;
    font-family: Georgia, "Times New Roman", serif;
    color: #064c3d;
    font-size: clamp(18px, 1.35vw, 24px);
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 88px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 248, 236, 0.72);
    border: 1px solid rgba(184, 137, 73, 0.22);
    transition: 0.24s ease;
}

.related-card:hover {
    transform: translateY(-2px);
    border-color: rgba(155, 17, 23, 0.35);
    background: rgba(255, 251, 244, 0.95);
}

.related-card-img {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f4ead8;
    border: 1px solid rgba(184, 137, 73, 0.18);
}

.related-card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 72px;
}

.related-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: #064c3d;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.related-card-price {
    display: block;
    margin-top: auto;
    color: #9b1117;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.1;
}

.related-empty {
    margin: 0;
    padding: 12px 4px;
    color: #64574d;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* Legacy selectors */
.related-card strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    color: #064c3d;
    font-size: 14px;
    line-height: 1.3;
}

.related-card span {
    display: block;
    margin-top: 4px;
    color: #9b1117;
    font-weight: 700;
    font-size: 13px;
}

.consult-box {
    background: linear-gradient(180deg, rgba(132, 8, 12, 0.96), rgba(83, 0, 0, 0.96));
    color: #fff4dc;
    text-align: center;
}

.consult-box h3 {
    color: #f8dfad;
}

.consult-box p {
    line-height: 1.55;
    margin-bottom: 16px;
    font-size: 14px;
}

.consult-box a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(180deg, #f5d98b, #c99334);
    color: #721014;
    text-decoration: none;
    font-weight: 800;
}

@media (max-width: 1180px) {
    .detail-section {
        padding-top: 20px;
    }

    .product-panel {
        display: flex;
        flex-direction: column;
    }

    .product-top {
        display: contents;
    }

    .product-gallery {
        order: 1;
    }

    .product-summary {
        order: 2;
    }

    .info-block {
        order: 3;
    }

    .detail-sidebar {
        order: 10;
        grid-column: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .detail-sidebar .side-card {
        margin-bottom: 0;
    }

    .consult-box {
        background: linear-gradient(180deg, rgba(132, 8, 12, 0.96), rgba(83, 0, 0, 0.96)) !important;
        color: #fff4dc !important;
    }

    .consult-box h3 {
        color: #f8dfad !important;
    }

    .consult-box p {
        color: #fff8ec !important;
    }

    .consult-box a {
        color: #721014 !important;
    }

    .detail-purchase-row {
        gap: 10px;
    }

    .detail-buy,
    .detail-cart {
        font-size: clamp(12px, 1.1vw, 14px);
        padding: 0 10px;
    }

    .spec-table th,
    .spec-table td {
        display: block;
        width: 100%;
    }

    .spec-table th {
        border-bottom: none;
        padding-bottom: 4px;
    }

    .spec-table td {
        padding-top: 4px;
        border-top: none;
    }

    .info-block h3,
    .product-content-html h3 {
        color: #8b1b1e;
    }

    .info-block p,
    .product-content-html p,
    .product-content-html li {
        color: #4f4a43;
    }

    .related-list {
        gap: 10px;
    }

    .related-card {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 10px;
        min-height: 84px;
        padding: 10px;
    }

    .related-card-img {
        width: 64px;
        height: 64px;
    }

    .related-card-body {
        min-height: 64px;
        gap: 4px;
    }

    .related-card-title,
    .related-card strong {
        font-size: 12px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }

    .related-card-price,
    .related-card span {
        font-size: 13px;
    }
}

@media (max-width: 980px) {
    .detail-sidebar {
        display: flex;
        flex-direction: column;
    }

    .detail-sidebar .side-card {
        margin-bottom: 0;
    }

    .gallery-main {
        max-width: 480px;
        margin: 0 auto;
    }

    .detail-purchase-row {
        flex-wrap: wrap;
    }

    .detail-qty {
        width: 100%;
        justify-content: center;
    }

    .detail-buy,
    .detail-cart {
        flex: 1 1 calc(50% - 6px);
        min-width: calc(50% - 6px);
        min-height: 42px;
    }
}
