/* ==========================================================
   Rak Siam Coin & Art - Master Luxury Editorial Stylesheet
   Inspired by Essentialized / Modern Minimalist Aesthetic
   ========================================================== */

/* ฟอนต์ทั้งเว็บ: Kanit (ไทย + อังกฤษ) */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800;900&display=swap');
/* ฟอนต์เฉพาะชื่อแบรนด์: Playfair Display (อังกฤษ) + Charmonman (ไทย) — ตัวเขียนหรูแบบป้ายร้าน */
@import url('https://fonts.googleapis.com/css2?family=Charmonman:wght@400;700&family=Playfair+Display:ital,wght@0,700;0,800;1,700;1,800&display=swap');

:root {
    --font-heading: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-thai: 'Kanit', sans-serif;
    /* ฟอนต์ชื่อแบรนด์ (โลโก้): อังกฤษใช้ Playfair Display, ไทยใช้ Charmonman */
    --font-brand: 'Playfair Display', 'Charmonman', 'Kanit', serif;
    --font-brand-th: 'Charmonman', 'Kanit', cursive;

    /* ------------------------------------------------------
       ชุดสีแบรนด์: Deep Olive + Brass + Ivory / Light Natural Stone
       เน้น: Oxblood | ตกแต่ง: ทองเหลือง (Brass) | พื้น: ไอวอรี่-หินธรรมชาติ
       ------------------------------------------------------ */

    /* Brass — ทองเหลืองแปรง (กรอบ / เส้นเน้น / โลโก้) */
    --brass-dark: #7a5c28;
    --brass: #a8823f;
    --brass-light: #d8bd86;
    --brass-pale: #ece0c6;
    --brass-sheen: linear-gradient(115deg, #8a6a33 0%, #a8823f 20%, #d4ab5e 44%, #e3c489 52%, #bd9247 68%, #a8823f 84%, #8a6a33 100%);
    --brass-sheen-v: linear-gradient(180deg, #b58a3c 0%, #d4ab5e 26%, #e3c489 48%, #c2954a 64%, #a8823f 84%, #8a6a33 100%);

    /* Deep Olive — สีหลักของแบรนด์ */
    --olive-deep: #2f3a22;
    --olive: #46532f;
    --olive-mid: #67744b;
    --olive-sage: #8d9a74;
    --olive-soft: #eceee3;
    --olive-line: #cdd4bd;

    /* Oxblood — สีเน้น (CTA / ป้ายลดราคา) */
    --oxblood: #8c0205;
    --oxblood-deep: #5d0103;
    --oxblood-soft: #f7eae8;

    /* Neutral — Light Natural Stone / Ivory / Champagne / Espresso */
    --stone: #ded9d0;
    --stone-light: #efece6;
    --champagne: #d9c4b1;
    --ivory: #f7f2e8;
    --espresso: #372713;

    /* ชื่อเดิมที่ใช้ทั่วเว็บ — ชี้มาที่พาเลตต์ใหม่ */
    --green-primary: #46532f;
    --green-deep: #2f3a22;
    --green-forest: #3c472a;
    --green-soft: #eceee3;
    --green-line: #cdd4bd;

    --red-accent: #8c0205;
    --red-oxblood: #5d0103;
    --red-soft: #f7eae8;

    --gold-primary: #a8823f;
    --gold-warm: #c9a86a;
    --gold-light: #ece0c6;
    --amber-bg: #c9a86a;
    --silver-primary: #c3bdb2;

    --bg-main: #f7f2e8;
    --bg-surface: #fffdf8;
    --bg-ivory: #f0e8d9;
    --bg-dark: #2f3a22;
    --bg-dark-surface: #3d4a2c;
    --text-main: #2e2619;
    --text-muted: #6a6151;
    --text-light: #9b9284;
    --text-white: #ffffff;

    --border-color: #e3dbcb;
    --border-dark: #4b5833;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    
    --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.04);
    --shadow-card: 0 14px 40px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
}

.container {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================
   NAVIGATION BAR (Essentialized Style)
   ========================================================== */
.site-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 32px;
}

/* ==========================================================
   ชื่อแบรนด์ (โลโก้) — ใช้ตัวอักษรจริง สีเขียว + แดงตามโลโก้ จึงคมทุกขนาด
   ========================================================== */
:root {
    --brand-green: #2b4437;
    --brand-red: #5c0102;
}

.brand-center-logo {
    display: inline-flex;
    align-items: baseline;
    flex-shrink: 0;
    font-family: var(--font-brand);
    font-size: 30px;
    font-weight: 800;
    font-style: italic;
    letter-spacing: -0.01em;
    white-space: nowrap;
    line-height: 1.1;
    padding: 0.12em 0 0.08em;
}

.brand-a { color: var(--brand-green); }
.brand-b { color: var(--brand-red); }

/* ดอกประจำยามทองมุมขวาบนของชื่อ */
.brand-mark {
    display: inline-block;
    width: 0.3em;
    margin-left: 0.08em;
    color: var(--brass);
    align-self: flex-start;
}
.brand-mark svg { width: 100%; height: auto; display: block; }

/* ภาษาไทยใช้ตัวเขียนไทย ซึ่งสระบนและหางยาวเกินกรอบบรรทัด จึงเว้นที่ด้านบนเพิ่ม */
html[lang="th"] .brand-center-logo {
    font-family: var(--font-brand-th);
    font-style: normal;
    font-weight: 700;
    font-size: 28px;
    line-height: 1.2;
    padding: 0.6em 0 0.08em;
}


/* ตัวเขียนไทย (Charmonman) มีสระบนและหางยาวเกินกรอบบรรทัดปกติ
   ต้องขยายกรอบด้วย padding (พื้นทองจะได้คลุมถึง) แล้วหักกลับด้วย margin ลบ เพื่อไม่ให้เลย์เอาต์ขยับ */
html[lang="th"] .hero-giant-title {
    font-family: var(--font-brand-th);
    font-style: normal;
    font-weight: 700;
    line-height: 1.25;
    /* ตัวเขียนไทยมีหางตวัดสูง ต้องเว้นที่ด้านบนไม่ให้ชนแถบเมนู */
    padding: 0.42em 0 0.12em;
}

/* หางตัวอักษรไทยทอดสูงกว่าตัวอักษรมาก ต้องเว้นที่ด้านบนไม่ให้ไปซ้อนใต้แถบเมนู */
html[lang="th"] .hero-editorial { padding-top: 60px; }
/* ภาษาไทยไม่แยกตัวอักษร (ดู splitTitleChars ใน app.js) จึงไม่ต้องขยายกรอบรายตัว */
html[lang="th"] .hero-giant-title .char,
html[lang="th"] .hero-giant-title .word {
    padding: 0;
    margin: 0;
    background: none;
    -webkit-text-fill-color: inherit;
}

.nav-links-main {
    display: flex;
    align-items: center;
    gap: 36px;
    list-style: none;
    margin: 0;
}

.nav-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
    position: relative;
    padding: 6px 0;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    font-weight: 700;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--green-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Language Switcher */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    background: #ece6da;
    border-radius: var(--radius-pill);
    padding: 3px;
    font-size: 12px;
    font-weight: 700;
}

.lang-btn {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    color: #666;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn.active {
    background: var(--green-primary);
    color: #ffffff;
}

.cart-counter {
    background: var(--gold-warm);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

/* ==========================================================
   EDITORIAL HERO SECTION (Matching Mockup)
   ========================================================== */
.hero-editorial {
    padding-top: 28px;
    padding-bottom: 24px;
}

.hero-giant-title {
    font-family: var(--font-brand);
    font-size: clamp(3.2rem, 9vw, 8.2rem);
    font-weight: 800;
    font-style: italic;
    letter-spacing: -0.01em;
    line-height: 1.05;
    margin-bottom: 18px;
    text-align: left;
    text-transform: capitalize;
    padding: 0.12em 0 0.1em;
}

.hero-giant-title .brand-a { color: var(--brand-green); }
.hero-giant-title .brand-b { color: var(--brand-red); }
.hero-giant-title .brand-mark { width: 0.2em; vertical-align: 0.62em; }

.hero-subtitles-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 28px;
}

.hero-sub-text {
    font-size: 15px;
    color: #444444;
    line-height: 1.45;
    max-width: 420px;
    font-weight: 500;
}

.hero-sub-text.right {
    text-align: right;
    max-width: 400px;
}

/* Hero Banner Container */
.hero-banner-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #2b1a12;
    box-shadow: var(--shadow-card);
}

.hero-poster-track {
    position: absolute;
    inset: 0;
}

.hero-poster {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    transition: opacity 0.9s ease;
}

.hero-poster.is-active { opacity: 1; }

.hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* จุดบอกตำแหน่งสไลด์ */
.hero-poster-dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    gap: 9px;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
    background: rgba(26, 16, 10, 0.45);
    backdrop-filter: blur(6px);
}

.hero-poster-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(246, 236, 210, 0.45);
    cursor: pointer;
    transition: var(--transition);
}

.hero-poster-dot:hover { background: rgba(246, 236, 210, 0.75); }
.hero-poster-dot.is-active { background: var(--brass-light); width: 24px; border-radius: var(--radius-pill); }
.hero-poster-dot:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(227, 196, 137, 0.55); }

/* ปุ่มเลื่อนซ้าย-ขวา */
.hero-poster-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 7;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(227, 196, 137, 0.45);
    border-radius: 50%;
    background: rgba(26, 16, 10, 0.5);
    backdrop-filter: blur(6px);
    color: var(--brass-light);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, background 0.25s, transform 0.25s;
}

.hero-banner-card:hover .hero-poster-nav,
.hero-poster-nav:focus-visible { opacity: 1; }

.hero-poster-nav:hover { background: rgba(26, 16, 10, 0.78); color: #fff6e0; }
.hero-poster-nav:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(227, 196, 137, 0.5); }
.hero-poster-nav.prev { left: 28px; }
.hero-poster-nav.next { right: 28px; }
.hero-poster-nav.prev:hover { transform: translateY(-50%) translateX(-3px); }
.hero-poster-nav.next:hover { transform: translateY(-50%) translateX(3px); }

/* จอสัมผัสไม่มี hover — แสดงปุ่มไว้ตลอด */
@media (hover: none) {
    .hero-poster-nav { opacity: 1; width: 38px; height: 38px; }
    .hero-poster-nav.prev { left: 12px; }
    .hero-poster-nav.next { right: 12px; }
}

.hero-banner-cta-pill {
    background: var(--red-accent);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6; /* เผื่อสระบน-ล่างของภาษาไทยไม่ให้ถูกตัด */
    transition: var(--transition);
}

.hero-banner-cta-pill:hover {
    background: var(--red-oxblood);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Floating Micro Category Cards on Banner */

/* ==========================================================
   FILTER & SEARCH BAR (Essentialized Mockup Style)
   ========================================================== */
.filter-search-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin: 32px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow-soft);
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    margin-right: 8px;
}

.filter-dropdown {
    position: relative;
}

.filter-select {
    appearance: none;
    background: #f1ece1;
    border: 1px solid transparent;
    padding: 8px 32px 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover, .filter-select:focus {
    background: #e5ded0;
    outline: none;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 10px;
    color: #777;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.search-right {
    display: flex;
    align-items: center;
    position: relative;
    min-width: 260px;
}

.search-input {
    width: 100%;
    background: #f1ece1;
    border: 1px solid transparent;
    padding: 10px 40px 10px 18px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--text-main);
    transition: var(--transition);
}

.search-input:focus {
    background: #fff;
    border-color: var(--text-main);
    outline: none;
}

.search-icon-btn {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

/* ==========================================================
   SPLIT SHOWCASE SECTION (/02 Amber Glow & Products Grid)
   ========================================================== */
.showcase-split-section {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.showcase-left-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 10px;
}

.showcase-giant-heading {
    font-family: var(--font-heading);
    font-size: 46px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin-bottom: 16px;
    white-space: nowrap;
}

.showcase-desc-text {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 28px;
}

.black-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--green-primary);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 700;
    width: fit-content;
    transition: var(--transition);
}

.black-pill-btn:hover {
    background: var(--green-forest);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* สินค้าแนะนำ: แถวเดียว เลื่อนแนวนอน (เลื่อนอัตโนมัติด้วย initAutoScroll ใน app.js) */
.showcase-products-grid {
    --cards-visible: 3;
    display: flex;
    gap: 24px;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.showcase-products-grid::-webkit-scrollbar { display: none; }
.showcase-products-grid > .product-card {
    flex: 0 0 calc((100% - 24px * (var(--cards-visible) - 1)) / var(--cards-visible));
    scroll-snap-align: start;
}

/* PRODUCT CARD (Essentialized Style) */
.product-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card);
    border-color: #ded6c6;
}

.product-card-thumb-wrap {
    position: relative;
    background: #f0ebe1;
    aspect-ratio: 1/1;
    overflow: hidden;
}

.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-card-img {
    transform: scale(1.06);
}

.product-card-info {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.product-card-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    /* ชื่อสินค้าสูงเท่ากันทุกการ์ด (3 บรรทัด) ให้กรอบสเปกเริ่มตำแหน่งเดียวกัน */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.3em * 3);
}

.product-card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #ece6da;
}

.product-card-price {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.product-card-old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    margin-left: 6px;
}

/* ==========================================================
   PROMO / โปรโมชั่น (สินค้าลดราคา)
   ========================================================== */
.promo-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.promo-all-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--oxblood);
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
    transition: var(--transition);
}
.promo-all-link:hover { color: var(--oxblood-deep); }

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

.promo-card { position: relative; }
.promo-card .product-card-thumb-wrap { position: relative; }

.promo-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: var(--oxblood);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 16px rgba(140, 2, 5, 0.28);
}

.product-card-price.sale { color: var(--oxblood); }

@media (max-width: 1024px) {
    .promo-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .promo-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .promo-head { flex-wrap: wrap; gap: 10px; }
    .promo-all-link { font-size: 13px; }
    .promo-badge { top: 8px; left: 8px; padding: 4px 9px; font-size: 11px; }
}

/* ==========================================================
   HIGH-CONTRAST DARK SECTION (Matching Mockup)
   ========================================================== */

/* ==========================================================
   TRUST & CREDIBILITY BANNER
   ========================================================== */

/* ==========================================================
   PAGE HERO (For Products, Reviews, Contact, Cart)
   ========================================================== */
.page-hero-banner {
    padding: 40px 0 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.page-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--brass);
    margin: 0 -0.06em 10px;
    /* พื้นทองไล่เฉดในตัวอักษร ให้เหมือนหัวข้อหน้าแรก */
    padding: 0.2em 0.06em 0.14em;
    background-image: var(--brass-sheen-v);
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ตัวอักษรที่ถูกแยกกล่องตอนเล่นอนิเมชัน ต้องมีพื้นทองของตัวเอง (กล่องสูงเท่ากัน เฉดจึงต่อเนื่อง) */
.page-hero-title .char,
.page-hero-title .word {
    background-image: inherit;
    background-size: inherit;
    background-position: inherit;
    background-repeat: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0.2em 0 0.14em;
    margin: -0.2em 0 -0.14em;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    .page-hero-title,
    .page-hero-title .char,
    .page-hero-title .word { background-image: none; -webkit-text-fill-color: var(--brass-dark); }
}

.page-hero-subtitle {
    font-size: 16px;
    color: #666;
    max-width: 650px;
}

/* ==========================================================
   REVIEWS PAGE STYLES
   ========================================================== */
.reviews-summary-bar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-soft);
}

.rating-score-box {
    display: flex;
    align-items: center;
    gap: 20px;
}

.huge-score {
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}

/* การ์ดรีวิวขนาดเท่ากันทุกใบ: รูป / ดาว / หัวข้อ 1 บรรทัด / ข้อความ 3 บรรทัด / ชื่อ-วันที่ชิดล่าง */
.reviews-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.review-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

.review-photo {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 16px;
    background: #f3efe6;
}

.review-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.verified-tag {
    font-size: 11px;
    font-weight: 700;
    background: #eceee3;
    color: #46532f;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
}

.review-comment {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    margin: 6px 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.6em * 3);
}

.review-card-foot {
    border-top: 1px solid #ece6da;
    padding-top: 12px;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-author {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}

.review-date {
    font-size: 12px;
    color: #888;
}

/* ==========================================================
   CONTACT US PAGE STYLES
   ========================================================== */
.contact-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.contact-info-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-soft);
}

.contact-item-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.contact-item-icon {
    width: 42px;
    height: 42px;
    background: #f1ece1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.social-links-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.social-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: #f1ece1;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    transition: var(--transition);
}

.social-pill:hover {
    background: var(--green-primary);
    color: #fff;
}

.social-pill.line {
    background: #06c755;
    color: #fff;
}

.contact-form-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-soft);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--green-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

/* ==========================================================
   CART & CHECKOUT & PAYMENT SLIP
   ========================================================== */
.cart-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 36px;
    margin-bottom: 60px;
}

.cart-items-table {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.cart-item-row {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid #ece6da;
}

.cart-item-row:last-child {
    border-bottom: none;
}

.cart-item-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.cart-item-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.qty-btn {
    background: #f1ece1;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-weight: 800;
}

.qty-input {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 14px;
    font-weight: 700;
}

.cart-order-summary {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-soft);
    height: fit-content;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #555;
}

.summary-row.total {
    border-top: 1px solid #eee;
    padding-top: 16px;
    margin-top: 16px;
    font-size: 18px;
    font-weight: 900;
    color: var(--text-main);
}

/* Payment Slip Dropzone */
.slip-dropzone {
    border: 2px dashed #ded6c6;
    background: #f8f4ec;
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin: 20px 0;
}

.slip-dropzone:hover, .slip-dropzone.dragover {
    border-color: var(--green-primary);
    background: #f0ebe1;
}

.slip-preview-container {
    display: none;
    margin-top: 16px;
}

.slip-preview-img {
    max-height: 260px;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
}

.copy-bank-btn {
    background: #ece6da;
    border: none;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

/* ==========================================================
   CART DRAWER & MODALS
   ========================================================== */
.cart-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.cart-drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #ffffff;
    z-index: 999;
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer.active {
    right: 0;
}

.cart-drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.cart-drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: #f8f4ec;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--green-primary);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlide 0.3s forwards;
}

@keyframes toastSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================
   FOOTER (Editorial Modern)
   ========================================================== */
.site-footer {
    background: var(--green-deep);
    color: #ffffff;
    padding: 70px 0 30px;
    border-top: 1px solid var(--border-dark);
}

.footer-top-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-brand-title {
    display: inline-flex;
    align-items: baseline;
    font-family: var(--font-brand);
    font-size: 34px;
    font-weight: 800;
    font-style: italic;
    line-height: 1.1;
    margin-bottom: 18px;
    padding: 0.12em 0 0.08em;
}

/* ท้ายเว็บพื้นเขียวเข้ม — ใช้ครีมและทองแทนเขียว-แดงเพื่อให้อ่านออก */
.footer-brand-title .brand-a { color: #f4eee2; }
.footer-brand-title .brand-b { color: var(--brass-light); }

html[lang="th"] .footer-brand-title {
    font-family: var(--font-brand-th);
    font-style: normal;
    font-weight: 700;
    font-size: 32px;
    line-height: 1.2;
    padding: 0.6em 0 0.08em;
}

.footer-desc {
    color: #999;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    /* จัดข้อความให้ขอบเสมอกันทั้งด้านหน้าและด้านหลัง */
    text-align: justify;
    text-justify: inter-character;
    hyphens: auto;
}

.footer-heading {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    margin-bottom: 18px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #999;
    font-size: 14px;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom-bar {
    border-top: 1px solid var(--border-dark);
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #777;
}

/* ==========================================================
   RESPONSIVE DESIGN (Desktop, Tablet, Mobile)
   ========================================================== */
@media (max-width: 1024px) {
    .showcase-split-section {
        grid-template-columns: 1fr;
    }
    .showcase-products-grid {
        --cards-visible: 2;
    }
    .reviews-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-top-grid {
        grid-template-columns: 1fr 1fr;
    }
    .cart-checkout-grid, .contact-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-subtitles-bar {
        flex-direction: column;
        gap: 12px;
    }
    .hero-sub-text.right {
        text-align: left;
    }
    .hero-banner-card {
        aspect-ratio: 16 / 9;
        max-height: none;
        border-radius: var(--radius-md);
    }
    .hero-poster-dots { bottom: 10px; padding: 5px 9px; gap: 7px; }
    .hero-poster-dot { width: 7px; height: 7px; }
    .hero-poster-dot.is-active { width: 18px; }
    /* มือถือ: ซ่อนเมนูแถวบนและปุ่มภาษา → ใช้ปุ่ม ☰ มุมขวาบนแทน (เมนู + ภาษาอยู่ในแผงเมนู) */
    .nav-links-main,
    .nav-actions > .lang-switcher { display: none; }
    .nav-toggle { display: inline-flex; }
    .filter-search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-right {
        min-width: auto;
    }
    .showcase-products-grid {
        --cards-visible: 1.15;
    }
    .reviews-cards-grid {
        grid-template-columns: 1fr;
    }
    .footer-top-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ==========================================================
   RAKSIAM - MONGKOL PALETTE COMPONENTS
   เขียวเหนี่ยวทรัพย์ + แดงมงคล + ทอง
   ========================================================== */

/* Add-to-cart quick arrow uses the red CTA accent */

.product-card-price {
    color: var(--red-oxblood);
}

.social-pill.line {
    background: #06c755;
    color: #fff;
}

/* --- Gold rule used to frame headings and banners ---------- */
.gold-rule {
    height: 3px;
    width: 72px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
    border-radius: 2px;
    margin: 14px 0 20px;
}

.gold-frame {
    border: 2px solid var(--gold-primary);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    background: linear-gradient(180deg, #ffffff, var(--bg-ivory));
}

/* --- Section heading ---------------------------------------- */
.sec-heading {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 900;
    color: var(--green-deep);
    letter-spacing: -0.02em;
}

.section-block {
    margin: 56px 0;
}

/* --- Category tree (หมวดหมู่สินค้า) -------------------------- */

/* --- Grouped category filter (optgroup) --------------------- */
.filter-select optgroup {
    font-weight: 800;
    color: var(--green-deep);
}

/* --- Product spec chips (สภาพ / ปี / โลหะ / ขนาด / นน.) ------ */
.spec-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.spec-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: var(--green-soft);
    color: var(--green-primary);
    border: 1px solid var(--green-line);
    white-space: nowrap;
}


/* --- Spec table on the product detail page ------------------ */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.spec-table th,
.spec-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.spec-table th {
    width: 38%;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-ivory);
}

.spec-table td {
    font-weight: 700;
    color: var(--text-main);
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
    border-bottom: none;
}

/* --- Buy-back (การรับซื้อ) ---------------------------------- */

.btn-red-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--red-accent);
    color: #fff;
    padding: 14px 30px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-red-cta:hover {
    background: var(--red-oxblood);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(126, 20, 32, 0.28);
}

/* Step cards for the buy-back process */

/* Image dropzone for appraisal photos */

/* --- Payment & shipping tables ------------------------------ */
.bank-card {
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--green-primary);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-surface);
}

.bank-card .bank-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--green-primary);
}

.bank-card .bank-number {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: var(--text-main);
}

/* --- Articles & video clips (บทความและคลิปวิดีโอ) ----------- */

.video-embed-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--green-deep);
}

.video-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Footer readability on the deep-green ground ------------ */
.footer-desc,
.footer-links a,
.site-footer .footer-bottom-bar {
    color: rgba(255, 255, 255, 0.72);
}

.footer-links a:hover {
    color: var(--gold-warm);
}

.footer-heading {
    color: var(--gold-warm);
}


/* --- Responsive --------------------------------------------- */

@media (max-width: 700px) {
    .sec-heading {
        font-size: 24px;
    }
}

/* ==========================================================
   INLINE SVG ICONS (เว็บนี้ไม่ใช้อิโมจิ)
   ========================================================== */
.icon {
    display: inline-block;
    vertical-align: -0.18em;
    flex-shrink: 0;
}

/* ไอคอนที่วางคู่ข้อความในปุ่ม/ลิงก์ */
.icon-inline-gap {
    margin-right: 6px;
}

/* กล่องไอคอนวงกลม (หมวดหมู่ / จุดเด่น / ข้อมูลติดต่อ) */

.contact-item-icon .icon {
    vertical-align: middle;
}

/* --- Star rating ------------------------------------------- */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}

.star-rating .icon {
    vertical-align: middle;
}

.star-rating .star-on {
    color: var(--gold-primary);
}

.star-rating .star-off {
    color: var(--border-color);
}

/* --- Icon-only buttons -------------------------------------- */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--red-accent);
    background: var(--red-soft);
}

/* ปุ่มลูกศรมุมการ์ดสินค้า ให้ไอคอนอยู่กึ่งกลางพอดี */

/* ปุ่มเมนูมือถือ / ปุ่มค้นหา ใช้ไอคอนแทนตัวอักษร */

.search-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* จุดแสดงสถานะ (วงกลมเล็กวาดด้วย CSS) */
.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 7px;
    vertical-align: 0.05em;
}

/* ==========================================================
   LIVE GOLD & SILVER PRICE BOARD (ราคาทอง-เงินวันนี้)
   ========================================================== */
.price-board-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}
.price-live-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
}
.price-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
}
.price-board.is-live .price-live-dot {
    background: #16a34a;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
    animation: price-pulse 2s infinite;
}
.price-board.is-error .price-live-dot { background: var(--red-accent); }
@keyframes price-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .price-board.is-live .price-live-dot { animation: none; }
}

.price-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.price-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.price-card.silver { border-top-color: #a9a294; }
.price-card.world  { border-top-color: var(--green-primary); }
.price-card-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--green-deep);
}
.price-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.price-pair span,
.price-world-list span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}
.price-pair strong{
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    transition: color 0.4s;
}
.price-card-unit {
    margin-top: auto;
    font-size: 11.5px;
    color: var(--text-light);
}
.price-world-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.price-world-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.price-world-list strong {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
    transition: color 0.4s;
}
/* ราคาทอง/ตลาดโลก: จัดตัวเลขให้อยู่กึ่งกลางการ์ด (ความสูงการ์ดเท่ากันทั้งแถว) */
.price-card.gold .price-pair,
.price-card.world .price-world-list { margin-top: auto; margin-bottom: auto; }

/* ราคาเงินต่อกรัมแยกตามเปอร์เซ็นต์ความบริสุทธิ์ */
.silver-purity-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.silver-purity-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 8px;
    border-radius: 7px;
    background: var(--bg-main);
}
.silver-purity-list li span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.silver-purity-list li span em {
    font-style: normal;
    font-size: 10.5px;
    color: var(--text-light);
}
.silver-purity-list li strong {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    transition: color 0.4s;
}
.silver-purity-list li:first-child { background: var(--brass-pale); }
.silver-purity-list li:first-child strong { font-size: 17px; color: var(--brass-dark); }

.price-up   { color: #15803d !important; }
.price-down { color: var(--red-accent) !important; }
.price-up::after   { content: ' ▲'; font-size: 0.55em; vertical-align: middle; }
.price-down::after { content: ' ▼'; font-size: 0.55em; vertical-align: middle; }
.price-board-note {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
}

@media (max-width: 1024px) {
    .price-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .price-card-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   ABOUT RAKSIAM (เกี่ยวกับเรา — หน้าแรก)
   ========================================================== */
.about-block {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
    align-items: start;
}
.about-story p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.85;
    margin-bottom: 14px;
}
.about-pillars {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-self: center; /* อยู่กึ่งกลางแนวตั้งเทียบกับเนื้อหาฝั่งซ้าย */
}
.about-pillar {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--gold-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 22px 24px;
}
.about-pillar-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-primary);
    color: var(--gold-light);
}
.about-pillar h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 800;
    color: var(--green-deep);
    margin-bottom: 4px;
}
.about-pillar p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}
@media (max-width: 1024px) {
    .about-block { grid-template-columns: 1fr; gap: 24px; }
}

/* ==========================================================
   MOTION & EFFECTS (ลูกเล่นการเคลื่อนไหว) — ควบคุมด้วย initMotion() ใน app.js
   ทุกเอฟเฟกต์ปิดเองเมื่อผู้ใช้ตั้งค่า "ลดการเคลื่อนไหว" และถ้า JS ไม่ทำงาน เนื้อหายังแสดงปกติ
   ========================================================== */

/* --- Hero banner: กรอบทองแบบกรอบงานศิลปะ (ภาพนิ่ง ไม่มีแสงกวาด) --- */
.hero-banner-card { isolation: isolate; }

/* เส้นกรอบทองบางด้านใน */
.hero-banner-card::before {
    content: '';
    position: absolute;
    inset: 18px;
    z-index: 4;
    pointer-events: none;
    border: 1px solid rgba(227, 196, 137, 0.5);
    border-radius: calc(var(--radius-lg) - 14px);
}

/* มุมกรอบทองหนา 4 มุม (วาดด้วยเส้นขอบ 2 ชั้นซ้อน) */
.hero-banner-card::after {
    content: '';
    position: absolute;
    inset: 18px;
    z-index: 5;
    pointer-events: none;
    border-radius: calc(var(--radius-lg) - 14px);
    background:
        linear-gradient(var(--brass-light), var(--brass-light)) left top / 46px 2px no-repeat,
        linear-gradient(var(--brass-light), var(--brass-light)) left top / 2px 46px no-repeat,
        linear-gradient(var(--brass-light), var(--brass-light)) right top / 46px 2px no-repeat,
        linear-gradient(var(--brass-light), var(--brass-light)) right top / 2px 46px no-repeat,
        linear-gradient(var(--brass-light), var(--brass-light)) left bottom / 46px 2px no-repeat,
        linear-gradient(var(--brass-light), var(--brass-light)) left bottom / 2px 46px no-repeat,
        linear-gradient(var(--brass-light), var(--brass-light)) right bottom / 46px 2px no-repeat,
        linear-gradient(var(--brass-light), var(--brass-light)) right bottom / 2px 46px no-repeat;
    opacity: 0.85;
}

@media (max-width: 768px) {
    .hero-banner-card::before,
    .hero-banner-card::after { inset: 12px; }
}

/* --- ชื่อ RakSiam: ตัวอักษรลอยขึ้นทีละตัว ------------------------ */
.hero-giant-title .char {
    display: inline-block;
    text-transform: none; /* h1 ใช้ capitalize — ถ้าไม่ปิด ทุกตัวอักษรที่แยกจะกลายเป็นตัวใหญ่ */
    opacity: 0;
    transform: translateY(0.45em) rotate(4deg);
    animation: char-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes char-rise {
    to { opacity: 1; transform: none; }
}
.js-motion .hero-sub-text,
.js-motion .hero-banner-card {
    opacity: 0;
    transform: translateY(18px);
    animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.js-motion .hero-sub-text        { animation-delay: 0.55s; }
.js-motion .hero-sub-text.right  { animation-delay: 0.7s; }
.js-motion .hero-banner-card     { animation-delay: 0.85s; }
@keyframes fade-up {
    to { opacity: 1; transform: none; }
}

/* --- ปุ่มหลัก: ประกายวิ่งผ่าน ------------------------------------ */
.hero-banner-cta-pill {
    position: relative;
    overflow: hidden;
}
.hero-banner-cta-pill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    animation: btn-gleam 3.8s ease-in-out 2.4s infinite;
}
@keyframes btn-gleam {
    0%        { left: -80%; }
    30%, 100% { left: 140%; }
}

/* --- Scroll reveal: ค่อยๆ ลอยขึ้นเมื่อเลื่อนมาเห็น ----------------- */
.js-motion .reveal {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0s);
}
.js-motion .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* เส้นทองใต้หัวข้อ: ยืดออกเมื่อเห็น */
.js-motion .gold-rule {
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}
.js-motion .gold-rule.is-visible { transform: scaleX(1); }

/* --- การ์ดยกตัวเมื่อชี้ ------------------------------------------- */
.price-card,
.about-pillar,
.review-card {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s, opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.price-card:hover,
.about-pillar:hover,
.review-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card);
}
.js-motion .reveal.is-visible.price-card:hover,
.js-motion .reveal.is-visible.about-pillar:hover,
.js-motion .reveal.is-visible.review-card:hover {
    transform: translateY(-6px);
}
.about-pillar-icon { transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.about-pillar:hover .about-pillar-icon { transform: rotate(-10deg) scale(1.1); }

/* ราคาเปลี่ยน: การ์ดเรืองแสงทองสั้นๆ */
.price-card.is-updated { animation: price-flash 1.2s ease-out; }
@keyframes price-flash {
    0%   { box-shadow: 0 0 0 0 rgba(168, 130, 63, 0.55); }
    100% { box-shadow: 0 0 0 14px rgba(168, 130, 63, 0); }
}

/* --- Header: มีเงาเมื่อเลื่อนลง ----------------------------------- */
.site-header { transition: box-shadow 0.3s, background-color 0.3s; }
.site-header.is-scrolled {
    box-shadow: 0 8px 24px rgba(47, 58, 34, 0.08);
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
}

/* --- ปิดทุกเอฟเฟกต์เมื่อผู้ใช้ขอลดการเคลื่อนไหว --------------------- */
@media (prefers-reduced-motion: reduce) {
    .hero-banner-card::before,
    .hero-banner-card::after,
    .hero-banner-cta-pill::after { animation: none; }
    .hero-banner-card::after,
    .hero-banner-cta-pill::after { display: none; }
    .hero-giant-title .char,
    .js-motion .hero-sub-text,
    .js-motion .hero-banner-card { animation: none; opacity: 1; transform: none; }
    .js-motion .reveal,
    .js-motion .gold-rule { opacity: 1; transform: none; transition: none; }
}

/* ซ่อนชื่อ RakSiam ไว้จนกว่า JS จะแยกเป็นตัวอักษร (กันกระพริบ) */
.js-motion .hero-giant-title:not(.is-split) { opacity: 0; }

/* ==========================================================
   QUICK VIEW MODAL (ป๊อปอัพดูสินค้า) — initQuickView() ใน app.js
   ========================================================== */
.product-card.is-clickable { cursor: pointer; }
body.qv-lock { overflow: hidden; }

.qv-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 30, 19, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.qv-backdrop.is-open { opacity: 1; visibility: visible; }

/* กรอบนอกของป๊อปอัพ: ไม่เลื่อน ถือปุ่มปิดไว้ (ปุ่มจึงอยู่นิ่งเสมอ) */
.qv-shell {
    position: relative;
    width: 100%;
    max-width: 1000px;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.qv-backdrop.is-open .qv-shell { transform: none; }

/* ส่วนเนื้อหาที่เลื่อนได้ */
.qv-panel {
    position: relative;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border-top: 4px solid var(--gold-primary);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    outline: none;
}

.qv-close {
    position: absolute;
    top: 18px;
    right: 14px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s, background 0.25s;
}
.qv-close:hover { transform: rotate(90deg); background: var(--bg-ivory); }

.qv-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    padding: 32px;
}
.qv-body > * { min-width: 0; }
.qv-panel { overflow-x: hidden; }
.qv-specs td { overflow-wrap: anywhere; }
.qv-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.qv-main {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-ivory);
}
.qv-main img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    animation: qv-img-in 0.4s ease;
}
@keyframes qv-img-in { from { opacity: 0.4; } to { opacity: 1; } }
.qv-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.qv-thumb {
    width: 68px;
    height: 68px;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: none;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}
.qv-thumb:hover { transform: translateY(-2px); }
.qv-thumb.is-active { border-color: var(--gold-primary); }
.qv-thumb img { width: 100%; height: 100%; object-fit: cover; }

.qv-info { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.qv-category { font-size: 12px; font-weight: 700; color: var(--text-light); }
.qv-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--green-deep);
    padding-right: 40px;
}
.qv-price { display: flex; align-items: baseline; gap: 10px; }
.qv-price strong {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 900;
    color: var(--red-oxblood);
}
.qv-price s { color: var(--text-light); font-size: 16px; }
.qv-stock { font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.qv-stock.in  { color: var(--green-primary); }
.qv-stock.out { color: var(--red-accent); }
.qv-specs {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 13px;
}
.qv-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    max-height: 7.2em;
    overflow-y: auto;
}
.qv-actions { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.qv-actions .qty-control { height: 48px; }
.qv-actions .qty-btn { height: 100%; width: 40px; }
.qv-add { flex-grow: 1; justify-content: center; height: 48px; }
.qv-add[disabled] { opacity: 0.5; cursor: not-allowed; }
.qv-full-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--green-primary);
    align-self: flex-start;
}
.qv-full-link:hover { text-decoration: underline; }

/* มือถือ: ป๊อปอัพเต็มจอ 100% (ล็อกกับขอบจอโดยตรง) — ปุ่มปิดติดมุมบนขวาตลอด,
   รูปสัดส่วน 4:3, แถบจำนวน + เพิ่มลงตะกร้าติดขอบล่างตลอด */
@media (max-width: 768px) {
    .qv-backdrop { padding: 0; }
    .qv-shell {                               /* กรอบนอกเต็มจอ ไม่เลื่อน */
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        transform: translateY(100%);
    }
    .qv-panel {                               /* เนื้อหาเลื่อนอยู่ข้างในกรอบ */
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border-top: 0;
        box-shadow: none;
    }
    .qv-close {                               /* ติดกับกรอบนอก → ไม่เลื่อนหายไปกับเนื้อหา */
        position: absolute;
        top: calc(12px + env(safe-area-inset-top));
        right: 12px;
        margin: 0;
        width: 40px;
        height: 40px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    }
    .qv-body { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: calc(64px + env(safe-area-inset-top)) 16px 0; }   /* เว้นด้านบนให้ปุ่มปิดไม่ทับรูป */
    .qv-main img { aspect-ratio: 4 / 3; }
    .qv-thumbs { margin-top: 10px; gap: 8px; }
    .qv-thumb { width: 54px; height: 54px; }
    .qv-info { gap: 10px; padding-top: 0; }
    .qv-title { font-size: 18px; padding-right: 0; }
    .qv-price strong { font-size: 26px; }
    .qv-desc { max-height: none; }
    .qv-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin: 6px -16px 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--bg-surface);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -8px 20px rgba(47, 58, 34, 0.06);
    }
    .qv-actions .qty-control { height: 46px; }
    .qv-add { height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
    .qv-backdrop, .qv-shell, .qv-panel, .qv-main img { transition: none; animation: none; }
}

/* --- Header บนมือถือ: ไม่ให้ล้นจอ (ซ่อนคำว่า "ตะกร้าของฉัน" เหลือไอคอน + จำนวน) --- */
@media (max-width: 560px) {
    .nav-container { gap: 12px; }
    .nav-actions { gap: 8px; }
    .brand-center-logo img { height: 30px; }
}

/* ช่องกรองหน้าสินค้าบนมือถือ: เต็มความกว้างแต่ไม่ล้นจอ */
@media (max-width: 560px) {
    .filter-left { width: 100%; }
    .filter-dropdown { width: 100%; min-width: 0; }
    .filter-select { width: 100%; max-width: 100%; text-overflow: ellipsis; }
}

/* ปุ่มตะกร้าเด้งเบาๆ เมื่อเพิ่มสินค้า (แทนแถบแจ้งเตือน) */
@keyframes cart-bump {
    0%, 100% { transform: none; }
    40%      { transform: scale(1.08); }
}
@keyframes cart-counter-pop {
    0%, 100% { transform: none; }
    40%      { transform: scale(1.5); }
}

/* ==========================================================
   CUSTOM DROPDOWN (ตัวกรองหน้าสินค้า) — initCustomSelects() ใน app.js
   ========================================================== */
.cselect-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.cselect { position: relative; }
.cselect-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 170px;
    max-width: 320px;
    justify-content: space-between;
    padding: 10px 14px 10px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.cselect-btn:hover { border-color: var(--gold-primary); }
.cselect-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(168, 130, 63, 0.3); }
.cselect-btn.has-value {
    background: var(--green-soft);
    border-color: var(--green-line);
    color: var(--green-deep);
}
.cselect-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-btn .icon { flex-shrink: 0; color: var(--gold-primary); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.cselect.is-open .cselect-btn { border-color: var(--gold-primary); box-shadow: 0 0 0 3px rgba(168, 130, 63, 0.18); }
.cselect.is-open .cselect-btn .icon { transform: rotate(180deg); }

.cselect-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 60;
    min-width: 100%;
    width: max-content;
    max-width: min(420px, 90vw);
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 48px rgba(47, 58, 34, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}
.cselect.is-open .cselect-list { opacity: 1; visibility: visible; transform: none; }

.cselect-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.cselect-item.is-active { background: var(--bg-ivory); }
.cselect-item.is-selected { background: var(--green-soft); color: var(--green-deep); font-weight: 700; }
.cselect-check { display: none; color: var(--gold-primary); }
.cselect-item.is-selected .cselect-check { display: inline-flex; }

.cselect-item.is-all { font-weight: 700; }
.cselect-item.is-group {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 10px 10px;
    font-weight: 800;
    color: var(--green-deep);
}
.cselect-item.is-group.is-active,
.cselect-item.is-group.is-selected { border-radius: 10px; }
.cselect-item.is-child { padding-left: 26px; color: var(--text-muted); }
.cselect-item.is-child::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold-warm);
    margin-right: -8px;
    flex-shrink: 0;
}
.cselect-item.is-child > span:first-of-type { flex-grow: 1; }
.cselect-item.is-child.is-selected { color: var(--green-deep); }
.cselect-heading {
    padding: 12px 12px 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
}

@media (max-width: 560px) {
    .cselect, .cselect-btn { width: 100%; max-width: none; }
    .cselect-list { width: 100%; max-width: none; }
}

/* ==========================================================
   PAGE TRANSITIONS & PAGE HEADERS (หน้าอื่นๆ ให้ดูมีชีวิตแบบพอดีๆ)
   ========================================================== */

/* เปลี่ยนหน้าแบบนุ่มนวล (Chrome/Edge 126+; เบราว์เซอร์อื่นเปลี่ยนหน้าปกติ) */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out 0.22s ease-in both; }
::view-transition-new(root) { animation: vt-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(14px); } }

/* หัวข้อหน้า: ตัวหนังสือเผยขึ้นจากล่าง → คำอธิบาย → เส้นทองลากออก */
.page-hero-banner { position: relative; }
.page-hero-banner::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 140px;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-warm));
    transform-origin: left center;
}
.js-motion .page-hero-title {
    animation: title-reveal 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
.js-motion .page-hero-subtitle {
    animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
.js-motion .page-hero-banner::after {
    animation: line-draw 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}
@keyframes title-reveal {
    from { opacity: 0; transform: translateY(0.5em); clip-path: inset(-30% 0 100% 0); }
    to   { opacity: 1; transform: none;               clip-path: inset(-30% 0 -30% 0); }
}
@keyframes line-draw {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
    .js-motion .page-hero-title,
    .js-motion .page-hero-subtitle,
    .js-motion .page-hero-banner::after { animation: none; }
}

/* หัวข้อทุกหน้า: ตัวอักษรลอยขึ้นทีละตัวแบบเดียวกับหน้าแรก (splitTitleChars ใน app.js) */
.page-hero-title .word,
.hero-giant-title .word { display: inline-block; white-space: nowrap; }
.page-hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.45em) rotate(4deg);
    animation: char-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.js-motion .page-hero-title.is-split { animation: none; }
.js-motion .page-hero-title:not(.is-split) { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
    .page-hero-title .char { animation: none; opacity: 1; transform: none; }
}

/* ==========================================================
   PRODUCT CARD ENTRANCE (การ์ดสินค้าเข้ามาตอนเปิดหน้า / เลื่อนมาเห็น)
   ใช้คู่กับ .reveal ใน initMotion() — เมื่อเข้าเสร็จ JS จะเอาคลาส reveal ออก
   เพื่อให้เอฟเฟกต์ชี้เมาส์ (ยกการ์ด/ซูมรูป) ทำงานตามปกติ
   ========================================================== */
.js-motion .product-card.reveal {
    transform: translateY(60px) scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0s);
}
.js-motion .product-card.reveal.is-visible { transform: none; }

.js-motion .product-card.reveal .product-card-img {
    transform: scale(1.18);
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0s);
}
.js-motion .product-card.reveal.is-visible .product-card-img { transform: scale(1); }

.js-motion .product-card.reveal .product-card-info > * {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-motion .product-card.reveal.is-visible .product-card-info > * { opacity: 1; transform: none; }
.js-motion .product-card.reveal.is-visible .product-card-info > :nth-child(1) { transition-delay: calc(var(--reveal-delay, 0s) + 0.25s); }
.js-motion .product-card.reveal.is-visible .product-card-info > :nth-child(2) { transition-delay: calc(var(--reveal-delay, 0s) + 0.33s); }
.js-motion .product-card.reveal.is-visible .product-card-info > :nth-child(3) { transition-delay: calc(var(--reveal-delay, 0s) + 0.41s); }
.js-motion .product-card.reveal.is-visible .product-card-info > :nth-child(4) { transition-delay: calc(var(--reveal-delay, 0s) + 0.49s); }
.js-motion .product-card.reveal.is-visible .product-card-info > :nth-child(n+5) { transition-delay: calc(var(--reveal-delay, 0s) + 0.57s); }

/* ปุ่มลูกศรบนรูป: เด้งเข้ามาหลังการ์ด */

@media (prefers-reduced-motion: reduce) {
    .js-motion .product-card.reveal,
    .js-motion .product-card.reveal .product-card-img,
    .js-motion .product-card.reveal .product-card-info > *{ opacity: 1; transform: none; transition: none; }
}

/* ตั้งสถานะซ่อนทันที (ไม่มี transition) ก่อนเริ่มเอฟเฟกต์ไล่เข้ามา — ดู initMotion() */
.js-motion .reveal-init,
.js-motion .reveal-init * { transition: none !important; }

/* ==========================================================
   FLOATING CART BUTTON (ปุ่มตะกร้ากลมมุมล่างขวา)
   ========================================================== */
.cart-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 95;              /* อยู่ใต้ลิ้นชักตะกร้า (998+) และป๊อปอัพ (1000) */
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: radial-gradient(circle at 30% 25%, var(--green-primary), var(--green-deep));
    box-shadow: 0 12px 28px rgba(47, 58, 34, 0.35), 0 0 0 3px rgba(168, 130, 63, 0.0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
    animation: cart-fab-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}
.cart-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 16px 34px rgba(47, 58, 34, 0.4), 0 0 0 3px rgba(168, 130, 63, 0.55);
}
.cart-fab:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(168, 130, 63, 0.6); }
.cart-fab .cart-counter {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    border: 2px solid #fff;
    background: var(--gold-warm);
    color: var(--green-deep);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

/* เด้งเมื่อเพิ่มสินค้า */
.cart-fab.is-bumped { animation: cart-fab-bump 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cart-fab.is-bumped .cart-counter { animation: cart-counter-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cart-fab-in {
    from { opacity: 0; transform: scale(0.3); }
    to   { opacity: 1; transform: none; }
}
@keyframes cart-fab-bump {
    0%   { transform: none; }
    30%  { transform: scale(1.18) rotate(-8deg); }
    60%  { transform: scale(0.95) rotate(4deg); }
    100% { transform: none; }
}

/* แถบแจ้งเตือนอื่นๆ (เช่น คัดลอกเลขบัญชี) ขยับขึ้นไม่ให้ทับปุ่ม */
.toast-container { bottom: 100px; }

@media (max-width: 560px) {
    .cart-fab { right: 16px; bottom: 16px; width: 56px; height: 56px; }
    .toast-container { bottom: 86px; }
}
@media (prefers-reduced-motion: reduce) {
    .cart-fab, .cart-fab.is-bumped, .cart-fab.is-bumped .cart-counter { animation: none; }
}

/* ==========================================================
   CONTACT MAP (แผนที่หน้าติดต่อ) — ลอยเข้ามาพร้อมข้อมูล + ค่อยๆ จางเข้าเมื่อโหลดเสร็จ
   ========================================================== */
.contact-map {
    position: relative;
    min-height: 420px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--gold-primary);
    background: var(--bg-ivory);
    box-shadow: var(--shadow-soft);
}
/* แสงวิ่งระหว่างรอแผนที่โหลด */
.contact-map::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.7) 50%, transparent 80%);
    background-size: 200% 100%;
    animation: map-shimmer 1.4s linear infinite;
}
.contact-map iframe {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 420px;
    border: 0;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.9s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.contact-map iframe.is-loaded { opacity: 1; transform: none; }
.contact-map:has(iframe.is-loaded)::before { animation: none; opacity: 0; }
@keyframes map-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}
/* ลอยเข้ามาช้ากว่าข้อมูลฝั่งซ้ายเล็กน้อย */
.js-motion .contact-map.reveal { --reveal-delay: 0.5s; transform: translateY(40px) scale(0.98); }
.js-motion .contact-map.reveal.is-visible { transform: none; }
@media (prefers-reduced-motion: reduce) {
    .contact-map::before { animation: none; }
    .contact-map iframe { transition: none; transform: none; }
}

/* หน้าชำระเงิน: กล่องแนบสลิปยืดเต็มความสูง ช่องวางไฟล์ขยายเต็มพื้นที่ ปุ่มส่งชิดล่าง */
.slip-panel { display: flex; flex-direction: column; }
.slip-panel #slip-upload-form { flex: 1; display: flex; flex-direction: column; }
.slip-panel .slip-dropzone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-height: 220px;
}
.slip-panel #btn-submit-slip { flex-shrink: 0; }

/* ปุ่ม "ใส่ตะกร้า" มุมขวาล่างของการ์ดสินค้า */
.product-card-foot { gap: 10px; }
.card-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding: 8px 14px 8px 11px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--green-primary);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
}
.card-add-btn:hover {
    background: var(--green-deep);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(47, 58, 34, 0.25);
}
.card-add-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(168, 130, 63, 0.5); }
.card-add-btn[disabled] { background: #cfc8ba; cursor: not-allowed; transform: none; box-shadow: none; }
.card-add-btn .icon { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.card-add-btn:hover .icon { transform: rotate(90deg); }
.card-add-btn.is-added { animation: card-add-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes card-add-pop {
    0%, 100% { transform: none; }
    40%      { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
    .card-add-btn.is-added { animation: none; }
}

/* --- ดรอปดาวน์แบบช่องฟอร์ม (หน้าชำระเงิน: วิธีจัดส่ง / วิธีชำระเงิน) --- */
.cselect-label { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; text-align: left; }
.cselect-title { font-weight: 700; color: var(--text-main); }
.cselect-desc  { font-size: 12px; font-weight: 500; color: var(--text-muted); line-height: 1.45; }
.cselect-meta  { flex-shrink: 0; font-weight: 800; color: var(--red-oxblood); white-space: nowrap; }

.cselect.is-form { width: 100%; }
.cselect.is-form .cselect-btn {
    width: 100%;
    max-width: none;
    min-height: 56px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}
.cselect.is-form .cselect-value {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
    min-width: 0;
    white-space: normal;
}
.cselect.is-form .cselect-list {
    width: 100%;
    max-width: none;
    max-height: 420px;
}
.cselect.is-form .cselect-item {
    padding: 12px 14px;
    font-size: 14px;
    align-items: center;
}
.cselect.is-form .cselect-item + .cselect-item { margin-top: 4px; }
.cselect.is-form .cselect-item .cselect-check { order: -1; }
.cselect.is-form .cselect-item .cselect-check {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    color: transparent;
}
.cselect.is-form .cselect-item.is-selected .cselect-check {
    border-color: var(--green-primary);
    background: var(--green-primary);
    color: #fff;
}
.cselect.is-form .cselect-item.is-selected { background: var(--green-soft); }
.cselect.is-form .cselect-item.is-selected .cselect-title { color: var(--green-deep); }
.cselect-meta:is(:empty) { display: none; }

/* ==========================================================
   PRIVACY POLICY (นโยบายความเป็นส่วนตัว)
   ========================================================== */
.policy-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    margin-bottom: 60px;
}
.policy-toc {
    position: sticky;
    top: 96px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold-primary);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: var(--shadow-soft);
}
.policy-toc-title { font-family: var(--font-heading); font-weight: 800; color: var(--green-deep); margin-bottom: 10px; }
.policy-toc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.policy-toc li { font-size: 13px; color: var(--text-muted); }
.policy-toc a { color: var(--text-muted); }
.policy-toc a:hover { color: var(--green-primary); }

.policy-body {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    box-shadow: var(--shadow-soft);
}
.policy-intro { font-size: 15px; line-height: 1.85; color: var(--text-main); margin-bottom: 8px; }
.policy-section { padding-top: 26px; margin-top: 26px; border-top: 1px solid var(--border-color); scroll-margin-top: 96px; }
.policy-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 800;
    color: var(--green-deep);
    margin-bottom: 12px;
}
.policy-num {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green-primary);
    color: var(--gold-light);
    font-size: 13px;
}
.policy-section p,
.policy-section li { font-size: 14.5px; line-height: 1.85; color: var(--text-muted); }
.policy-section p + p { margin-top: 10px; }
.policy-section ul { padding-left: 22px; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.policy-section strong { color: var(--text-main); }
.policy-section code { font-size: 12.5px; background: var(--bg-ivory); padding: 1px 6px; border-radius: 6px; }
.policy-section a { color: var(--green-primary); font-weight: 700; }

/* ลิงก์นโยบายในแถบล่างของ footer */
.footer-policy-link { color: var(--gold-warm); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.footer-policy-link:hover { color: #fff; }

@media (max-width: 900px) {
    .policy-layout { grid-template-columns: 1fr; gap: 20px; }
    .policy-toc { position: static; }
    .policy-body { padding: 26px 20px; }
}

/* ตัวอักษรโค้ดใช้ Kanit ตามทั้งเว็บ */
code, kbd, samp, pre { font-family: var(--font-body); }

/* ==========================================================
   MOBILE MENU (ปุ่ม ☰ มุมขวาบน + แผงเมนูพร้อมเลือกภาษา) — initMobileMenu() ใน app.js
   ========================================================== */
.nav-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-surface);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.2s, border-color 0.2s;
}
.nav-toggle:hover { border-color: var(--gold-primary); }
.nav-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(168, 130, 63, 0.4); }
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--green-deep);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
}
/* ☰ → ✕ เมื่อเปิดเมนู */
.nav-toggle[aria-expanded="true"] { background: var(--green-soft); border-color: var(--green-line); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
    display: none;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    padding: 8px 24px 20px;
    box-shadow: 0 18px 30px rgba(47, 58, 34, 0.08);
}
.mobile-menu.is-open {
    display: block;
    animation: mobile-menu-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes mobile-menu-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
}
.mobile-menu-links { list-style: none; margin: 0; padding: 0; }
.mobile-menu-links li + li { border-top: 1px solid var(--border-color); }
.mobile-menu-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.mobile-menu-links a::after {
    content: '';
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--gold-primary);
    border-right: 2px solid var(--gold-primary);
    transform: rotate(45deg);
}
.mobile-menu-links a.active { color: var(--green-primary); font-weight: 800; }
.mobile-menu-lang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--bg-ivory);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}
.mobile-menu-lang .lang-btn { padding: 6px 14px; font-size: 13px; }

@media (min-width: 769px) {
    .nav-toggle, .mobile-menu, .mobile-menu.is-open { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .mobile-menu.is-open { animation: none; }
    .nav-toggle span { transition: none; }
}

/* แสดงปุ่ม ☰ บนมือถือ (ต้องอยู่หลังกฎ .nav-toggle ด้านบน) */
@media (max-width: 768px) {
    .nav-toggle { display: inline-flex; }
}

/* หน้ารายละเอียดสินค้าบนมือถือ: รูปอยู่บน ข้อมูลอยู่ล่าง (grid ตั้งค่าแบบ inline จึงต้องใช้ !important) */
@media (max-width: 768px) {
    .product-detail-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
}

/* ปุ่มแคปซูลไม่ตัดคำขึ้นบรรทัดใหม่ (กันปุ่มถูกบีบจนตัวหนังสือเรียงลงทีละคำ) */
.black-pill-btn, .hero-banner-cta-pill, .btn-red-cta{ white-space: nowrap; }

/* หน้ารีวิวบนมือถือ: คะแนนอยู่บน ปุ่ม "เขียนรีวิวของคุณ" เต็มความกว้างอยู่ล่าง */
@media (max-width: 640px) {
    .reviews-summary-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 22px 20px;
        gap: 18px;
    }
    .rating-score-box { gap: 14px; }
    .huge-score { font-size: 46px; }
    .reviews-summary-bar > div:last-child { width: 100%; }
    .reviews-summary-bar .black-pill-btn { width: 100%; justify-content: center; }
}

/* หัวข้อใหญ่ขึ้นบรรทัดแบบสมดุล (เช่น "เสียงตอบรับ / จากนักสะสม" แทน "เสียงตอบรับจากนัก / สะสม") */
.page-hero-title,
.sec-heading,
.showcase-giant-heading { text-wrap: balance; }

/* ==========================================================
   มือถือ: การ์ดสินค้าแถวละ 2 ใบ (2x2) — ทุกบรรทัดในการ์ดสูงเท่ากัน เรียงระดับเดียวกันทุกใบ
   ========================================================== */
@media (max-width: 640px) {
    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
    .showcase-products-grid { --cards-visible: 2; gap: 12px; }
    .showcase-products-grid > .product-card { flex-basis: calc((100% - 12px) / 2); }

    .product-card-info { padding: 10px 10px 12px; }
    .product-card-cat {
        font-size: 10px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .product-card-title { font-size: 13px; line-height: 1.35; }

    /* สเปกสูง 2 บรรทัดเท่ากันทุกใบ (สภาพ / ปี) — ข้อความไม่ถูกตัด; ชนิดโลหะ ขนาด นน. ดูได้ในป๊อปอัพ */
    .product-card .spec-chip-row {
        flex-wrap: wrap;
        align-content: flex-start;
        gap: 4px;
        margin: 6px 0;
        height: 50px;
        overflow: hidden;
    }
    .product-card .spec-chip { font-size: 10px; padding: 2px 7px; }
    .product-card .spec-chip:nth-child(n+3) { display: none; }
    .product-card-serial { display: none; }

    /* ราคาอยู่บน ปุ่มใส่ตะกร้าเต็มความกว้างอยู่ล่าง */
    .product-card-foot { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 10px; }
    .product-card-price { font-size: 15px; }
    .card-add-btn { justify-content: center; padding: 8px 10px; font-size: 12px; }
}

/* ==========================================================
   มือถือ: การ์ดรีวิวแถวละ 2 ใบ (2x2) — ขนาดเท่ากันทุกใบ
   ========================================================== */
@media (max-width: 640px) {
    .reviews-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .review-card { padding: 10px 10px 12px; }
    .review-photo { margin-bottom: 10px; border-radius: 8px; }

    /* ดาวบรรทัดแรก ป้าย "ยืนยันแล้ว" บรรทัดถัดไป */
    .review-card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 6px;
        height: 48px;             /* สูงเท่ากันทั้งการ์ดที่มีและไม่มีป้าย "ยืนยันแล้ว" */
    }
    .review-card-head .star-rating .icon { width: 12px; height: 12px; }
    .verified-tag { font-size: 9.5px; padding: 2px 6px; }

    .review-title { font-size: 13px; margin-bottom: 4px; }
    .review-comment { font-size: 12px; line-height: 1.55; margin: 4px 0 10px; min-height: calc(1.55em * 3); }

    /* ชื่อผู้รีวิวบรรทัดแรก วันที่บรรทัดถัดไป */
    .review-card-foot { flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 8px; }
    .review-author { font-size: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .review-date { font-size: 11px; }
}

/* มือถือ: หัวข้อหน้าอยู่บรรทัดเดียวเสมอ — ขนาดตัวอักษรย่อให้พอดีจอด้วย fitPageTitle() ใน app.js */
@media (max-width: 768px) {
    .page-hero-title { white-space: nowrap; text-wrap: nowrap; }
}

/* ข้อมูลติดต่อท้ายเว็บ (จอคอม): เว้นระยะแต่ละบรรทัดให้อ่านง่าย */
@media (min-width: 769px) {
    .footer-contact-list > div { margin: 0 0 10px !important; }
    .footer-contact-list > div:last-child { margin-bottom: 0 !important; }
}

/* ==========================================================
   หน้าชำระเงิน: กล่อง "ได้รับสลิปแล้ว" + เอฟเฟกต์สำเร็จ
   ========================================================== */
.slip-panel [hidden] { display: none !important; }
.slip-received {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 32px 20px; background: var(--green-soft); border: 1px solid var(--green-line, #cdd4bd); border-radius: var(--radius-md, 14px);
}
.slip-received-icon {
    width: 64px; height: 64px; border-radius: 50%; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--green-primary); color: #fff; box-shadow: 0 8px 20px rgba(70, 83, 47, 0.25);
}
.slip-received-title { font-family: var(--font-heading); font-size: 18px; font-weight: 800; color: var(--green-deep); }
.slip-received-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.slip-received-note { font-size: 13px; color: var(--green-deep); margin: 12px 0 18px; max-width: 300px; line-height: 1.6; }
.slip-change-btn {
    background: none; border: none; cursor: pointer; padding: 6px 4px;
    font: inherit; font-size: 13px; font-weight: 700; color: var(--green-primary); text-decoration: underline; text-underline-offset: 3px;
}
.slip-change-btn:hover { color: var(--green-deep); }
#slip-upload-form .slip-change-btn { align-self: center; }

.success-overlay[hidden] { display: none; }
.success-overlay {
    position: fixed; inset: 0; z-index: 9999; padding: 20px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(30, 26, 18, 0.55); backdrop-filter: blur(3px);
}
.success-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.success-card {
    position: relative; width: min(420px, 100%); background: #fff; border-radius: 22px;
    padding: 34px 28px 26px; text-align: center; border-top: 5px solid var(--gold-primary);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3);
}
.success-check { width: 92px; height: 92px; margin: 0 auto 14px; display: block; }
.success-check-ring { fill: var(--green-soft); stroke: var(--green-primary); stroke-width: 4; stroke-dasharray: 227; stroke-dashoffset: 227; }
.success-check-mark { fill: none; stroke: var(--green-primary); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; }
.success-title { font-family: var(--font-heading); font-size: 24px; font-weight: 900; color: var(--green-deep); margin-bottom: 4px; }
.success-order { font-size: 14px; font-weight: 700; color: var(--gold-primary); }
.success-slip { max-height: 140px; margin: 14px auto 0; border-radius: 10px; border: 1px solid var(--border-color); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.success-text { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin: 14px 0 22px; }
.success-btn { width: 100%; height: 50px; justify-content: center; }

.success-overlay.is-playing { animation: successFade 0.25s ease; }
.success-overlay.is-playing .success-card { animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.success-overlay.is-playing .success-check-ring { animation: successDraw 0.6s 0.15s ease-out forwards; }
.success-overlay.is-playing .success-check-mark { animation: successDraw 0.4s 0.65s ease-out forwards; }
.success-overlay.is-playing .success-check { animation: successPulse 0.5s 1s ease; }
@keyframes successFade { from { opacity: 0; } }
@keyframes successPop { from { opacity: 0; transform: translateY(24px) scale(0.9); } }
@keyframes successDraw { to { stroke-dashoffset: 0; } }
@keyframes successPulse { 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) {
    .success-overlay.is-playing, .success-overlay.is-playing .success-card, .success-overlay.is-playing .success-check { animation: none; }
    .success-check-ring, .success-check-mark { stroke-dashoffset: 0; animation: none !important; }
}

/* ==========================================================
   มือถือ: หน้าชำระเงิน / checkout (เลย์เอาต์ 2 คอลัมน์ → คอลัมน์เดียว)
   ========================================================== */
@media (max-width: 768px) {
    .pay-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 20px !important; }
    .pay-grid > * { min-width: 0; }
    .pay-order-card { padding: 20px !important; margin-bottom: 20px !important; }
    .pay-order-card h2 { font-size: 22px !important; word-break: break-all; }
    .slip-panel { padding: 20px !important; }
    .slip-panel .slip-dropzone { padding: 24px 14px; }
}
@media (max-width: 560px) {
    .form-row-2 { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
    .success-card { padding: 28px 20px 22px; }
    .success-title { font-size: 21px; }
}

/* มือถือ: แถวสินค้าในตะกร้า → 2 บรรทัด (รูป | ชื่อ+ราคา | ลบ / จำนวน | ยอดรวม) */
.cart-checkout-grid > * { min-width: 0; }
@media (max-width: 640px) {
    .cart-items-table { padding: 8px 16px; }
    .cart-order-summary { padding: 22px 18px; }
    .cart-item-row {
        grid-template-columns: 64px minmax(0, 1fr) auto;
        gap: 10px 14px;
        align-items: start;
    }
    .cart-item-row > :nth-child(1) { grid-column: 1; grid-row: 1 / 3; width: 64px; height: 64px; }
    .cart-item-row > :nth-child(2) { grid-column: 2; grid-row: 1; min-width: 0; }
    .cart-item-row > :nth-child(3) { grid-column: 2; grid-row: 2; justify-self: start; }
    .cart-item-row > :nth-child(4) { grid-column: 3; grid-row: 2; align-self: center; white-space: nowrap; }
    .cart-item-row > :nth-child(5) { grid-column: 3; grid-row: 1; justify-self: end; margin-top: -6px; }
    .cart-item-title { display: block; font-size: 14px; line-height: 1.45; }
}

/* จอแคบมาก (≤ 360px): ให้คอลัมน์ในกริดหดได้ ไม่ดันหน้าให้กว้างเกินจอ */
.product-detail-grid > *, .contact-layout-grid > * { min-width: 0; }
@media (max-width: 768px) {
    .product-detail-grid, .contact-layout-grid { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ลิงก์ชื่อสินค้าในการ์ด (ให้ Google/คีย์บอร์ดเข้าหน้าสินค้าได้) — หน้าตาเหมือนข้อความปกติ */
.product-card-link { color: inherit; text-decoration: none; }
.product-card-link:focus-visible { outline: 2px solid var(--gold-primary); outline-offset: 2px; border-radius: 4px; }
