/* ============================================================================
   RÈM CỬA TIẾN ĐẠT — PRODUCT DETAIL PAGE (single-san-pham.php)
   Pure CSS — thêm vào cuối style.css của theme (hoặc file CSS riêng rồi enqueue).
   Class prefix: product-*, rem-*, gallery-*
   ============================================================================ */

:root{
    --rem-primary: #0f7a3d;       /* xanh lá thương hiệu Tiến Đạt */
    --rem-primary-dark: #0b5c2d;
    --rem-primary-light: #eaf6ee;
    --rem-text: #1f2937;
    --rem-text-muted: #6b7280;
    --rem-border: #e5e7eb;
    --rem-radius: 12px;
    --rem-radius-sm: 8px;
    --rem-shadow: 0 4px 18px rgba(15,122,61,.08);
    --rem-shadow-lg: 0 10px 30px rgba(15,122,61,.12);
}

/* ---------- Hero breadcrumb ---------- */
.narrow-page-hero{
    background: linear-gradient(135deg, var(--rem-primary) 0%, var(--rem-primary-dark) 100%);
    padding: 40px 0 56px;
    color:#fff;
}
.narrow-page-hero h1{
    margin: 10px 0 0;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    color:#fff;
}
.product-hero-cats{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.breadcrumb-sep{ opacity:.6; }
.news-badge{
    display:inline-block;
    padding:5px 14px;
    border-radius:999px;
    background:rgba(255,255,255,.18);
    color:#fff;
    font-size:13px;
    font-weight:600;
    text-decoration:none;
    transition:background .2s ease;
}
.news-badge:hover{ background:rgba(255,255,255,.32); }
.news-badge--light{ background:#fff; color:var(--rem-primary-dark); }
.rem-brand-badge{
    display:inline-block; margin-left:6px; padding:4px 12px; border-radius:999px;
    background:var(--rem-primary-light); color:var(--rem-primary-dark); font-size:12.5px; font-weight:600;
}

.rem-breadcrumb{ font-size:13.5px; color:var(--rem-text-muted); margin:18px 0 24px; }
.rem-breadcrumb a{ color:var(--rem-text-muted); text-decoration:none; }
.rem-breadcrumb a:hover{ color:var(--rem-primary); }

/* ---------- Layout tổng ---------- */
.product-detail{
    display:grid;
    grid-template-columns: minmax(0,1.05fr) minmax(0,1fr);
    gap: 44px;
    align-items:start;
    margin-bottom: 48px;
}

/* ---------- Gallery (bên trái) ---------- */
.product-gallery{ position:sticky; top:24px; }
.product-gallery__main{
    border-radius: var(--rem-radius);
    overflow:hidden;
    background:#f7f9f8;
    box-shadow: var(--rem-shadow);
    aspect-ratio: 1 / 1;
    display:flex; align-items:center; justify-content:center;
}
.product-gallery__main-img{
    width:100%; height:100%; object-fit:cover; display:block;
}
.product-gallery__thumbs{
    display:flex; gap:10px; margin-top:14px; overflow-x:auto; padding-bottom:4px;
    scrollbar-width: thin;
}
.gallery-thumb-btn{
    flex:0 0 auto; width:72px; height:72px; padding:0; border-radius:var(--rem-radius-sm);
    border:2px solid transparent; background:#f2f2f2; overflow:hidden; cursor:pointer;
    transition: border-color .18s ease, transform .18s ease;
}
.gallery-thumb-btn img{ width:100%; height:100%; object-fit:cover; display:block; }
.gallery-thumb-btn:hover{ transform: translateY(-2px); }
.gallery-thumb-btn.is-active{ border-color: var(--rem-primary); }

.gallery-placeholder{
    aspect-ratio:1/1; border-radius:var(--rem-radius); background:#f7f9f8;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
    color:var(--rem-text-muted); border:1px dashed var(--rem-border);
}
.gallery-placeholder__icon{ font-size:40px; }

/* ---------- Summary (bên phải) ---------- */
.product-summary__cat{ margin:0 0 14px; }
.product-summary__cat .news-badge{ background:var(--rem-primary-light); color:var(--rem-primary-dark); }
.product-summary__cat .news-badge--light{ background:#fff; border:1px solid var(--rem-border); }

.product-summary__price{
    font-size: clamp(26px, 3vw, 34px);
    font-weight:800;
    color: var(--rem-primary-dark);
    margin-bottom: 18px;
    display:flex; align-items:baseline; gap:12px; flex-wrap:wrap;
}
.product-old-price{
    font-size:16px; font-weight:500; color:#9ca3af; text-decoration:line-through;
}
.product-price-contact{ font-size:22px; color:var(--rem-primary); }

/* ---------- Swatch màu ---------- */
.product-swatches{
    display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    margin-bottom:20px; padding:14px 16px; background:var(--rem-primary-light); border-radius:var(--rem-radius-sm);
}
.product-swatches__label{ font-weight:600; color:var(--rem-primary-dark); font-size:14px; }
.product-swatches__list{ display:flex; gap:8px; flex-wrap:wrap; }
.product-swatch{
    width:32px; height:32px; border-radius:50%; border:2px solid #fff;
    background: var(--swatch-color, #ccc);
    box-shadow: 0 0 0 1px var(--rem-border);
    cursor:pointer; transition: transform .15s ease, box-shadow .15s ease;
    padding:0;
}
.product-swatch:hover{ transform: scale(1.1); }
.product-swatch.is-active{ box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--rem-primary); }
.product-swatches__current{ font-size:13.5px; color:var(--rem-text-muted); margin-left:auto; }

/* ---------- Specs table ---------- */
.product-specs{
    border:1px solid var(--rem-border); border-radius:var(--rem-radius-sm); overflow:hidden; margin-bottom:22px;
}
.product-spec{
    display:flex; justify-content:space-between; gap:12px;
    padding:11px 16px; font-size:14.5px;
    border-bottom:1px solid var(--rem-border);
}
.product-spec:last-child{ border-bottom:none; }
.product-spec:nth-child(even){ background:#fafbfa; }
.product-spec__label{ color:var(--rem-text-muted); font-weight:500; }
.product-spec__value{ color:var(--rem-text); font-weight:600; text-align:right; }

/* ---------- CTA buttons ---------- */
.product-actions{ display:flex; gap:12px; flex-wrap:wrap; margin-bottom:22px; }
.button-solid, .button-outline{
    flex:1 1 auto; min-width:150px; text-align:center;
    padding:13px 20px; border-radius:999px; font-weight:700; font-size:14.5px;
    text-decoration:none; transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.button-solid{
    background: var(--rem-primary); color:#fff; box-shadow: var(--rem-shadow);
}
.button-solid:hover{ background:var(--rem-primary-dark); transform: translateY(-2px); box-shadow: var(--rem-shadow-lg); }
.product-zalo-button{ background:#0068ff; }
.product-zalo-button:hover{ background:#0052cc; }
.button-outline{
    background:#fff; color:var(--rem-primary); border:2px solid var(--rem-primary);
}
.button-outline:hover{ background:var(--rem-primary-light); transform: translateY(-2px); }

/* ---------- Trust badges ---------- */
.product-trust-badges{ display:flex; gap:10px; flex-wrap:wrap; }
.product-trust-badge{
    font-size:13px; padding:6px 12px; border-radius:999px;
    background:#fff; border:1px solid var(--rem-border); color:var(--rem-text-muted);
}

/* ---------- Mô tả sản phẩm ---------- */
.product-description-box{
    background:#fff; border:1px solid var(--rem-border); border-radius:var(--rem-radius);
    padding: 32px clamp(20px,4vw,40px); margin-bottom:40px;
}
.product-description-box__title{
    font-size:22px; font-weight:700; color:var(--rem-primary-dark); margin:0 0 18px;
}
.product-description-content{ color:var(--rem-text); line-height:1.75; font-size:15.5px; }
.product-description-content img{ max-width:100%; height:auto; border-radius:var(--rem-radius-sm); }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 992px){
    .product-detail{ grid-template-columns: 1fr; gap:28px; }
    .product-gallery{ position:static; }
}

@media (max-width: 600px){
    .narrow-page-hero{ padding:28px 0 40px; }
    .product-actions{ flex-direction:column; }
    .button-solid, .button-outline{ width:100%; }
    .product-swatches__current{ margin-left:0; width:100%; order:99; }
    .gallery-thumb-btn{ width:60px; height:60px; }
    .product-spec{ font-size:13.5px; padding:9px 14px; }
    .product-description-box{ padding:22px 18px; }
}
