/* ============================================================
   product-detail.css — Vietnamese product detail page styles
   ============================================================ */

:root {
    --color-orange:  #f5a623;
    --color-price:   #e8722a;
    --color-text:    #222222;
    --color-muted:   #666666;
    --color-border:  #e0e0e0;
    --color-bg:      #ffffff;
    --color-label:   #333333;
    --font-main:     'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --radius:        4px;
    --shadow-sm:     0 1px 4px rgba(0,0,0,0.08);
}

.tnc-hero {
    position: relative;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: start;
    justify-content: center;
    overflow: hidden;
}

/* Lớp phủ màu tối phủ lên ảnh nền */
.tnc-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Độ tối của ảnh nền */
    display: flex;
    align-items: center;
}

.tnc-hero-title {
    color: #ff9800; /* Màu cam chủ đạo */
    font-size: clamp(3rem, 5vw, 5rem);;
    font-weight: 700;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Thanh đứng màu trắng bên trái chữ */
.vertical-line {
    display: inline-block;
    width: 8px;
    height: 60px; /* Chiều cao thanh đứng */
    background-color: #ffffff;
    margin-right: 20px;
}

/* Responsive cho điện thoại */
@media (max-width: 768px) {
    .tnc-hero {
        /* height: 250px; */
    }
    .tnc-hero-title {
        font-size: 2.5rem;
    }
    .vertical-line {
        height: 40px;
        width: 5px;
    }
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb-bar {
    margin-top: 1rem;
    padding: 9px 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--color-muted);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb .sep { color: #aaa; }
.breadcrumb .current { color: var(--color-text); }

/* ── Product Detail Layout ──────────────────────────────────── */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 24px 0 16px;
}

@media (max-width: 640px) {
    .product-detail { grid-template-columns: 1fr; gap: 20px; }
}

/* ── Gallery ────────────────────────────────────────────────── */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.main-image-wrap {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.main-image-wrap img {
    width: 100%;
    max-height: 380px;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.thumb-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    background: #f9f9f9;
    transition: border-color 0.15s;
}

.thumb-item:hover,
.thumb-item.active {
    border-color: var(--color-orange);
}

.thumb-item img {
    width: 100%;
    height: 58px;
    object-fit: contain;
    display: block;
    padding: 4px;
}

/* ── Product Info ───────────────────────────────────────────── */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.product-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.35;
    margin-bottom: 8px;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-price);
    margin-bottom: 12px;
}

.divider {
    height: 1px;
    background: var(--color-border);
    margin: 10px 0;
}

/* Status row */
.product-meta .meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    padding: 4px 0;
}

.meta-label { color: var(--color-muted); }

.status-instock {
    color: #2e7d32;
    font-weight: 500;
}

/* Attributes */
.product-attrs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 18px;
}

.attr-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: 13.5px;
    line-height: 1.7;
}

.attr-label {
    color: var(--color-label);
    font-weight: 600;
    min-width: 110px;
    flex-shrink: 0;
}

.attr-value { color: var(--color-text); }

/* CTA Button */
.btn-contact-product {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: var(--color-orange);
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-decoration: none;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: auto;
}

.btn-contact-product:hover {
    background: #e0941a;
}

.btn-contact-product:active {
    transform: scale(0.98);
}

/* ── Product Description ────────────────────────────────────── */
.product-description {
    padding: 28px 0 10px;
    border-top: 2px solid var(--color-border);
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    text-transform: uppercase;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

.desc-attrs {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.desc-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: 13.5px;
    line-height: 1.8;
}

.desc-label {
    font-weight: 600;
    color: var(--color-label);
    min-width: 120px;
    flex-shrink: 0;
}

.desc-value { color: var(--color-text); }

/* ── Related Products ───────────────────────────────────────── */
.related-products {
    padding: 28px 0 32px;
    border-top: 2px solid var(--color-border);
    margin-top: 20px;
}

.related-slider-wrap {
    position: relative;
    overflow: hidden;
}

.related-track {
    display: flex;
    gap: 16px;
    transition: transform 0.35s ease;
}

.related-card {
    flex: 0 0 calc(33.333% - 11px);
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.related-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.related-image-link {
    display: block;
    background: #f5f5f5;
    overflow: hidden;
}

.related-image-link img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    display: block;
    padding: 10px;
    transition: transform 0.25s;
}

.related-card:hover .related-image-link img {
    transform: scale(1.04);
}

.related-info {
    padding: 10px 12px 14px;
}

.related-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    margin-bottom: 4px;
    line-height: 1.4;
}
.related-name:hover { color: var(--color-orange); }

.related-price {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-price);
}

/* Slider button */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 20px;
    cursor: pointer;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s, color 0.15s;
    z-index: 2;
    line-height: 1;
}

.slider-btn:hover {
    background: var(--color-orange);
    color: #fff;
    border-color: var(--color-orange);
}

.slider-next { right: -4px; }

/* Dots */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.15s;
}

.dot.active,
.dot:hover {
    background: var(--color-orange);
    transform: scale(1.15);
}

/* ============================================================
   product-carousel.css
   Styles for the reusable ProductCarousel component.

   HOW SCOPING WORKS:
   Every carousel instance gets a unique prefix  pc-{id}-
   set via the CSS custom property  --pc-prefix  on the
   section element.  Because CSS can't use custom properties
   inside selectors, we instead use a  data-pc-id  attribute
   on the section and write attribute selectors below.

   In practice the PHP outputs  data-pc-id="new"  and every
   class is  pc-{id}-*  so the attribute selector
   [data-pc-id="new"]  gives you full scoping with zero
   duplication.

   If you prefer a single global stylesheet (no scoping),
   just use the  .pc-*  base classes and don't pass a
   section_id — they map 1-to-1.
   ============================================================ */

/* ── Reset / base ──────────────────────────────────────────── */
.pc-section {
    padding: 60px 0;
}

/* ── CSS variables (overridden per-instance via inline style) ── */
.pc-carousel {
    --pc-primary : #ff9800;
    --pc-border  : #f0f0f0;
    --pc-text    : #333;
    --pc-muted   : #777;

    width    : calc(100% - 100px);
    padding  : 10px 10px 60px !important;
    overflow : hidden;
    position : relative;
}

/* ── Card ──────────────────────────────────────────────────── */
.pc-card {
    background    : #fff;
    border        : 1px solid var(--pc-border);
    border-radius : 4px;
    height        : 100%;
    display       : flex;
    flex-direction: column;
    position      : relative;
    overflow      : hidden;
    border-radius : 20px;
    transition    : box-shadow 0.3s cubic-bezier(.25, .46, .45, .94),
                    border-color 0.3s ease;
}

.pc-card:hover {
    box-shadow  : 0 15px 30px rgba(0, 0, 0, .12);
    border-color: transparent;
}

/* ── Badge / ribbon ────────────────────────────────────────── */
.pc-badge {
    position      : absolute;
    top           : 12px;
    left          : -1px;
    background    : var(--pc-primary);
    color         : #fff;
    font-size     : 11px;
    font-weight   : 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding       : 3px 10px 3px 8px;
    z-index       : 3;
    clip-path     : polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%);
}

/* ── Thumbnail ─────────────────────────────────────────────── */
.pc-thumb {
    position    : relative;
    overflow    : hidden;
    aspect-ratio: 1 / 1;
    background  : #f9f9f9;
}

.pc-thumb img {
    width      : 100%;
    height     : 100%;
    object-fit : contain;
    padding    : 10px;
    transition : transform 0.6s ease;
}

.pc-card:hover .pc-thumb img {
    transform: scale(1.08);
}

/* ── Overlay ───────────────────────────────────────────────── */
.pc-overlay {
    position        : absolute;
    inset           : 0;
    background      : rgba(0, 0, 0, .4);
    display         : flex;
    align-items     : center;
    justify-content : center;
    opacity         : 0;
    transition      : opacity 0.3s ease;
    z-index         : 2;
}

.pc-card:hover .pc-overlay {
    opacity: 1;
}

/* ── CTA button ────────────────────────────────────────────── */
.pc-cta {
    background     : var(--pc-primary);
    color          : #fff;
    padding        : 10px 20px;
    text-decoration: none;
    font-weight    : 600;
    font-size      : 13px;
    border-radius  : 4px;
    text-transform : uppercase;
    letter-spacing : .05em;
    white-space    : nowrap;
    transform      : translateY(20px);
    transition     : transform 0.35s ease;
}

.pc-card:hover .pc-cta {
    transform: translateY(0);
}

/* ── Info block ────────────────────────────────────────────── */
.pc-info {
    padding        : 16px 14px;
    text-align     : center;
    flex-grow      : 1;
    display        : flex;
    flex-direction : column;
    justify-content: space-between;
}

.pc-name {
    font-size          : 14px;
    color              : var(--pc-text);
    margin             : 0 0 10px;
    font-weight        : 500;
    line-height        : 1.45;
    text-transform     : lowercase;
    display            : -webkit-box;
    -webkit-line-clamp : 2;
    -webkit-box-orient : vertical;
    overflow           : hidden;
    height             : 41px; /* 2 lines × 14px × 1.45 */
}

.pc-price {
    color      : var(--pc-primary);
    font-weight: 700;
    font-size  : 17px;
    margin     : 0;
    margin-top : auto;
}

/* ── Swiper navigation buttons ─────────────────────────────── */
.pc-nav-next,
.pc-nav-prev {
    color        : #fff !important;
    background   : var(--pc-primary);
    width        : 44px !important;
    height       : 44px !important;
    border-radius: 50%;
    box-shadow   : 0 4px 12px rgba(0, 0, 0, .18);
    transition   : transform 0.2s ease;
}

.pc-nav-next:hover,
.pc-nav-prev:hover {
    transform: scale(1.08);
}

.pc-nav-next::after,
.pc-nav-prev::after {
    font-size  : 17px !important;
    font-weight: 700;
}

/* ── Swiper pagination ─────────────────────────────────────── */
.pc-dots .swiper-pagination-bullet {
    width        : 28px !important;
    height       : 4px !important;
    border-radius: 2px !important;
    background   : #ccc !important;
    opacity      : 1 !important;
    transition   : all 0.3s ease;
}

.pc-dots .swiper-pagination-bullet-active {
    background: var(--pc-primary) !important;
    width     : 48px !important;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .pc-carousel {
        width        : 100%;
        padding-right: 0 !important;
        padding-left : 0 !important;
    }

    .pc-nav-next,
    .pc-nav-prev {
        display: none;
    }
}