/* =====================================================================
   NCLM — ธีมหลัก (Public + Member)
   ใช้ร่วมกับ Bootstrap 5 + Tailwind (utility). โทน: หรูหรา ทันสมัย
   ===================================================================== */

:root {
    --brand: #6366f1;            /* override จาก layout (Super Admin) */
    --brand-2: #ec4899;
    --brand-soft: #eef2ff;
    --brand-rgb: 99,102,241;     /* ค่า RGB ของ --brand (ใช้ทำเงา/แสงโปร่งใส) */
    --brand-2-rgb: 236,72,153;
    --ink: #0f172a;
    --ink-soft: #475569;
    --muted: #94a3b8;
    --line: #e7e9f0;
    --bg: #f6f7fb;
    --card: #ffffff;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
    --shadow: 0 10px 30px -12px rgba(15,23,42,.18);
    --shadow-lg: 0 24px 50px -20px rgba(79,70,229,.35);
}

* { font-family: 'Prompt', system-ui, sans-serif; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.site-main { flex: 1 0 auto; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1320px; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
.hero-slide-caption .container { padding-left: 1rem; padding-right: 1rem; }

/* ---------- Utilities ---------- */
.text-gradient {
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.text-muted-soft { color: var(--muted); }
.ico-brand { color: var(--brand); }   /* ไอคอน SVG สีแบรนด์ (stroke=currentColor) */

.btn-brand {
    display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    color: #fff; border: none; border-radius: 999px;
    padding: .7rem 1.4rem; font-weight: 600; cursor: pointer;
    box-shadow: 0 8px 20px -8px var(--brand); transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn-brand:hover { transform: translateY(-2px); color:#fff; filter: brightness(1.05); box-shadow: 0 12px 26px -8px var(--brand); }
.btn-brand.btn-sm { padding: .45rem 1rem; font-size: .9rem; }
.btn-outline-brand {
    display:inline-flex; align-items:center; gap:.5rem; justify-content:center;
    border: 1.5px solid var(--brand); color: var(--brand); background:#fff;
    border-radius: 999px; padding: .6rem 1.3rem; font-weight: 600; transition: all .15s;
}
.btn-outline-brand:hover { background: var(--brand); color:#fff; }

.badge-brand {
    background: var(--brand-soft); color: var(--brand);
    border-radius: 999px; padding: .25rem .7rem; font-size: .78rem; font-weight: 600;
}
.chip { display:inline-flex; align-items:center; gap:.35rem; background:#fff; border:1px solid var(--line);
    border-radius:999px; padding:.4rem .9rem; font-size:.85rem; color:var(--ink-soft); transition:.15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); color:#fff; border-color: var(--brand); }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; flex-wrap: nowrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; flex: none; }
/* โลโก้ที่อัปโหลด: ย่อพอดีกรอบอัตโนมัติ ไม่ว่าจะไฟล์ใหญ่/สัดส่วนใด */
.brand-logo { height: auto; width: auto; max-height: 46px; max-width: 210px; object-fit: contain; display: block; }
@media (max-width: 576px) { .brand-logo { max-height: 38px; max-width: 150px; } }
.brand-mark {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff;
    box-shadow: 0 8px 18px -8px var(--brand); flex: none;
}
.brand-name { font-size: 1.15rem; letter-spacing: -.01em; white-space: nowrap; }

.search-box {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .5rem;
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: .3rem .3rem .3rem 1rem; max-width: 680px; margin: 0 auto;
    transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-box .search-ico { color: var(--muted); flex: none; }
.search-box input { flex: 1; border: none; outline: none; background: transparent; font-size: .95rem; padding: .35rem 0; }
.search-box button {
    border: none; border-radius: 999px; padding: .5rem 1.1rem; font-weight: 600; color: #fff;
    background: linear-gradient(120deg, var(--brand), var(--brand-2)); cursor: pointer;
}

.header-actions { display: flex; align-items: center; gap: .25rem; flex: none; }
.nav-link {
    display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-soft);
    padding: .55rem .7rem; border-radius: 12px; font-weight: 500; transition: .15s; cursor: pointer;
    background: transparent; border: none; white-space: nowrap;
}
.nav-link:hover { background: var(--brand-soft); color: var(--brand); }
.cart-link { position: relative; }
.cart-badge {
    position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--brand-2); color: #fff; font-size: .68rem; font-weight: 700;
    border-radius: 999px; display: grid; place-items: center;
}
.cart-badge:empty { display: none; }
.account-btn { font-weight: 600; color: var(--ink); }

/* ---------- Flash ---------- */
.flash-msg {
    display: flex; align-items: center; gap: .6rem; margin-top: 1rem;
    padding: .8rem 1rem; border-radius: var(--radius-sm); font-weight: 500;
    border: 1px solid; animation: flashIn .3s ease;
}
.flash-msg .flash-close { margin-left: auto; background: none; border: none; color: inherit; opacity: .6; cursor: pointer; }
.flash-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.flash-error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.flash-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden; border-radius: 28px; margin: 1.5rem 0;
    background: radial-gradient(120% 120% at 0% 0%, var(--brand) 0%, var(--brand-2) 100%);
    color: #fff; padding: clamp(2rem, 5vw, 4rem);
}
.hero::after {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 39.5h40M39.5 0v40' fill='none' stroke='%23ffffff' stroke-opacity='.08'/%3E%3C/svg%3E");
    opacity: .6;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; line-height: 1.15; margin: 0 0 .75rem; }
.hero p { font-size: 1.05rem; opacity: .92; max-width: 560px; }
.hero-search {
    margin-top: 1.5rem; display: flex; gap: .5rem; background: #fff; padding: .4rem;
    border-radius: 999px; max-width: 520px; box-shadow: var(--shadow);
}
.hero-search input { flex: 1; border: none; outline: none; padding: .6rem 1rem; border-radius: 999px; font-size: 1rem; color: var(--ink); }

/* ---------- Hero slider (carousel) — เต็มขอบจอ full-bleed ---------- */
.hero-slider { width: 100%; margin: 0 0 1.5rem; overflow: hidden; }
.hero-slide { display: block; position: relative; color: #fff; }
.hero-slide img { width: 100%; height: clamp(190px, 30vw, 480px); object-fit: cover; display: block; }
.hero-slide-caption { position: absolute; inset: auto 0 0 0; padding: 3rem 0 1.75rem;
    background: linear-gradient(to top, rgba(15,23,42,.78), rgba(15,23,42,0)); }
.hero-slide-caption h2 { font-size: clamp(1.3rem, 3vw, 2.6rem); font-weight: 700; margin: 0 0 .35rem; }
.hero-slide-caption p { margin: 0; font-size: clamp(.9rem, 1.4vw, 1.15rem); opacity: .95; max-width: 640px; }
.hero-slider .carousel-indicators { margin-bottom: .9rem; }
.hero-slider .carousel-control-prev, .hero-slider .carousel-control-next { width: 6%; }

/* ---------- Mobile hero search ---------- */
.mobile-hero-search { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--line);
    border-radius: 999px; padding: .15rem .15rem .15rem 1rem; margin: -.25rem 0 1rem; }
.mobile-hero-search .search-ico { color: var(--muted); flex: none; }
.mobile-hero-search input { flex: 1; border: none; outline: none; padding: .65rem .5rem; background: transparent; font-size: .95rem; }

@media (max-width: 768px) {
    .hero-slide-caption { padding: 1.75rem 0 1.1rem; }
}

/* ---------- Section heading ---------- */
.section { padding: 2.25rem 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.section-head h2 { font-size: 1.4rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .5rem; }
.section-head .more { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; }

/* ---------- Cards: School ---------- */
.school-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: transform .18s, box-shadow .18s; height: 100%;
}
.school-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.school-card .banner { height: 92px; background: linear-gradient(120deg, var(--brand-soft), #fce7f3); }
.school-card .body { padding: 1rem; position: relative; }
.school-card .logo {
    width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: #fff;
    border: 3px solid #fff; box-shadow: var(--shadow-sm); margin-top: -42px; display:grid; place-items:center;
    color: var(--brand);
}
.school-card h3 { font-size: 1.05rem; font-weight: 600; margin: .6rem 0 .25rem; }
.school-card p { color: var(--muted); font-size: .85rem; margin: 0; min-height: 2.4em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Cards: Product ---------- */
.product-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: transform .18s, box-shadow .18s; height: 100%; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.product-card .thumb { aspect-ratio: 1/1; background: #f1f3f9; overflow: hidden; position: relative; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-card:hover .thumb img { transform: scale(1.05); }
.product-card .thumb .flag {
    position: absolute; top: .6rem; left: .6rem; display: inline-flex; align-items: center; gap: .25rem;
    background: rgba(236,72,153,.95); color: #fff; font-size: .72rem; font-weight: 600;
    padding: .25rem .55rem; border-radius: 999px;
}
.product-card .body { padding: .85rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.product-card .shop { font-size: .76rem; color: var(--muted); display: inline-flex; align-items: center; gap: .25rem; }
.product-card .name {
    font-size: .95rem; font-weight: 500; line-height: 1.3; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em;
}
.product-card .price-row { margin-top: auto; display: flex; align-items: baseline; gap: .4rem; }
.product-card .price { font-size: 1.1rem; font-weight: 700; color: var(--brand); }
.product-card .price-old { font-size: .82rem; color: var(--muted); text-decoration: line-through; }
.product-card .sold { font-size: .74rem; color: var(--muted); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state svg { color: var(--line); }

/* ---------- Footer ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 2rem; padding: 2.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-grid h6 { font-weight: 600; margin-bottom: .75rem; }
.footer-grid a { display: block; color: var(--ink-soft); padding: .2rem 0; font-size: .9rem; }
.footer-grid a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.25rem;
    text-align: center; color: var(--muted); font-size: .85rem; }
.footer-credit { display: inline-flex; align-items: center; gap: .35rem; margin-top: .5rem;
    color: var(--ink-soft); font-size: .82rem; font-weight: 500; }
.footer-credit svg { color: var(--brand); flex: none; }

/* ---------- Page head / breadcrumb ---------- */
.page-head { margin: 1.5rem 0 1.25rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; margin: 0 0 .25rem; }
.breadcrumb-nav { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
    color: var(--muted); font-size: .85rem; padding: 1rem 0 .25rem; }
.breadcrumb-nav a { color: var(--ink-soft); }
.breadcrumb-nav a:hover { color: var(--brand); }
.breadcrumb-nav span { color: var(--ink); font-weight: 500; }

/* ---------- Storefront ---------- */
.storefront { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.storefront-banner { height: 180px; background: linear-gradient(120deg, var(--brand), var(--brand-2)); background-size: cover; background-position: center; }
.storefront-body { display: flex; gap: 1.25rem; padding: 0 1.5rem 1.5rem; }
.storefront-logo {
    width: 110px; height: 110px; border-radius: 22px; background: #fff; margin-top: -45px; flex: none;
    border: 4px solid #fff; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--brand); overflow: hidden;
}
.storefront-logo img { width: 100%; height: 100%; object-fit: cover; }
.storefront-info { padding-top: 1rem; }
.storefront-info h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .35rem; }
.storefront-info .intro { color: var(--ink-soft); margin: 0 0 .6rem; max-width: 60ch; }
.storefront-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; color: var(--ink-soft); font-size: .9rem; }
.storefront-meta span { display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- Promo cards ---------- */
.promo-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 1rem; overflow-x: auto; padding: 1.25rem 0; }
.promo-card { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 110px;
    background: linear-gradient(120deg, var(--brand-soft), #fce7f3); border: 1px solid var(--line); display: flex; }
.promo-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.promo-card .promo-text { position: relative; z-index: 1; padding: 1rem 1.25rem; display: flex; flex-direction: column; justify-content: center;
    background: linear-gradient(90deg, rgba(255,255,255,.92), rgba(255,255,255,.4)); width: 100%; }
.promo-card strong { font-size: 1.05rem; }
.promo-card span { color: var(--ink-soft); font-size: .85rem; }

/* ---------- Category chips ---------- */
.cat-chips { display: flex; gap: .5rem; flex-wrap: wrap; padding: 1.25rem 0 .5rem; }
.cat-count { background: rgba(0,0,0,.06); border-radius: 999px; padding: 0 .45rem; font-size: .75rem; margin-left: .2rem; }
.chip.active .cat-count { background: rgba(255,255,255,.25); }

/* ---------- Sort bar ---------- */
.sort-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.sort-count { color: var(--ink-soft); font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; }
.sort-chips { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* ---------- Pagination ---------- */
.pager { display: flex; justify-content: center; gap: .35rem; margin-top: 2rem; }
.pager-btn { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 .6rem;
    border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-weight: 600; transition: .15s; }
.pager-btn:hover { border-color: var(--brand); color: var(--brand); }
.pager-btn.active { background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }
.pager-btn.disabled { opacity: .4; pointer-events: none; }
.pager-gap { display: grid; place-items: center; padding: 0 .35rem; color: var(--muted); }

/* ---------- Product detail (PDP) ---------- */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2rem; margin-top: .5rem; }
.pdp-main { position: relative; aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden; background: #f1f3f9; border: 1px solid var(--line); }
.pdp-main img { width: 100%; height: 100%; object-fit: cover; }
.flag-lg { top: 1rem; left: 1rem; font-size: .85rem; padding: .4rem .8rem; }
.pdp-thumbs { display: flex; gap: .6rem; margin-top: .75rem; flex-wrap: wrap; }
.pdp-thumb { width: 70px; height: 70px; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); cursor: pointer; }
.pdp-thumb.active { border-color: var(--brand); }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp-shop { display: inline-flex; align-items: center; gap: .35rem; color: var(--brand); font-weight: 600; font-size: .9rem; }
.pdp-name { font-size: 1.6rem; font-weight: 700; line-height: 1.25; margin: .5rem 0; }
.pdp-stats { display: flex; gap: 1.25rem; color: var(--muted); font-size: .85rem; margin-bottom: 1rem; }
.pdp-stats span { display: inline-flex; align-items: center; gap: .3rem; }
.pdp-price-box { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; background: var(--brand-soft);
    border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.pdp-price { font-size: 2rem; font-weight: 700; color: var(--brand); }
.pdp-price-old { font-size: 1.1rem; color: var(--muted); text-decoration: line-through; }
.pdp-short { color: var(--ink-soft); margin-bottom: 1rem; }
.pdp-stock { margin-bottom: 1.25rem; font-weight: 500; }
.stock-in { color: #047857; display: inline-flex; align-items: center; gap: .35rem; }
.stock-low { color: #b45309; display: inline-flex; align-items: center; gap: .35rem; }
.stock-out { color: #b91c1c; display: inline-flex; align-items: center; gap: .35rem; }
.pdp-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.pdp-price-prefix { font-size: .85rem; color: var(--muted); font-weight: 500; }

/* ---------- Product variants (ตัวเลือกสินค้า) ---------- */
.pdp-variants { margin-bottom: 1.1rem; }
.pdp-variant-label { display: block; font-size: .9rem; color: var(--ink-soft); margin-bottom: .5rem; }
.pdp-variant-label strong { color: var(--brand); }
.pdp-variant-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.variant-opt { position: relative; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
    border-radius: 10px; padding: .55rem .95rem; font-weight: 600; font-size: .92rem; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s; }
.variant-opt:hover { border-color: var(--brand); color: var(--brand); }
.variant-opt.is-active { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px var(--brand); }
.variant-opt.is-out { opacity: .5; cursor: not-allowed; text-decoration: line-through; }
.variant-opt .vo-out { font-size: .7rem; margin-left: .3rem; text-decoration: none; }
.price-prefix { font-size: .72rem; color: var(--muted); font-weight: 500; }

/* ---------- Quantity stepper ---------- */
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty-stepper button { border: none; background: transparent; width: 42px; height: 46px; display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); }
.qty-stepper button:hover { background: var(--brand-soft); color: var(--brand); }
.qty-stepper input { width: 54px; height: 46px; border: none; text-align: center; font-weight: 600; font-size: 1rem; outline: none;
    -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- PDP description ---------- */
.pdp-desc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-top: 2rem; }
.pdp-desc h2 { font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.pdp-desc-body { color: var(--ink-soft); line-height: 1.8; }

.pt-0 { padding-top: 0 !important; }

@media (max-width: 900px) {
    .pdp { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .search-box { display: none; }   /* บนมือถือใช้ hero-search แทน */
    .storefront-body { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .storefront-info { padding-top: 0; }
}
@media (max-width: 576px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ===================== Form fields (ใช้ร่วม auth/admin) ===================== */
.field { display: block; margin-bottom: 1rem; }
.field-label { display: block; font-size: .85rem; font-weight: 500; color: var(--ink-soft); margin-bottom: .35rem; }
.field-input { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--line);
    border-radius: 12px; padding: .1rem .9rem; transition: border-color .15s, box-shadow .15s; }
.field-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field-input .field-ico { color: var(--muted); flex: none; }
.field-input input, .field-input select, .field-input textarea {
    flex: 1; border: none; outline: none; background: transparent; padding: .65rem 0; font-size: .95rem; font-family: inherit; width: 100%;
}
.field textarea { resize: vertical; }

/* ===================== Auth pages ===================== */
.auth-body { background: radial-gradient(130% 130% at 0% 0%, var(--brand) 0%, var(--brand-2) 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 24px; padding: 2rem; box-shadow: 0 30px 60px -20px rgba(15,23,42,.4); }
.auth-brand { display: flex; align-items: center; gap: .6rem; justify-content: center; font-weight: 700; font-size: 1.25rem; margin-bottom: 1.25rem; }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .25rem; }
.auth-head p { color: var(--muted); margin: 0; font-size: .9rem; }
.auth-alt { text-align: center; margin-top: 1.25rem; color: var(--ink-soft); font-size: .9rem; }
.auth-alt a { color: var(--brand); font-weight: 600; }
.auth-foot { margin-top: 1.25rem; }
.auth-foot a { color: rgba(255,255,255,.9); display: inline-flex; align-items: center; gap: .3rem; font-size: .9rem; }
.w-100 { width: 100%; }

/* ===================== Cart ===================== */
.cart-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; overflow: hidden; }
.cart-group-head { padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); background: #fafbff; }
.cart-group-head a { font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; }
.cart-item { display: grid; grid-template-columns: 76px 1fr auto auto auto; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.cart-item:last-of-type { border-bottom: none; }
.cart-item.is-unavailable { opacity: .55; }
.cart-thumb { width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: #f1f3f9; flex: none; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-name { font-weight: 500; color: var(--ink); display: block; line-height: 1.35; }
.cart-item-price { color: var(--ink-soft); font-size: .9rem; }
.cart-item-variant { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; color: var(--brand);
    background: var(--brand-soft); border-radius: 6px; padding: .1rem .4rem; margin: .15rem 0; width: fit-content; }
.badge-unavailable { color: #b91c1c; font-size: .8rem; font-weight: 500; }
.qty-sm button { width: 34px; height: 38px; }
.qty-sm input { width: 44px; height: 38px; font-size: .9rem; }
.cart-line-total { font-weight: 700; color: var(--brand); min-width: 90px; text-align: right; }
.cart-remove button { background: none; border: none; color: var(--muted); cursor: pointer; padding: .4rem; border-radius: 8px; transition: .15s; }
.cart-remove button:hover { color: #b91c1c; background: #fef2f2; }
.cart-group-foot { display: flex; justify-content: flex-end; gap: 1.5rem; padding: .85rem 1.25rem; background: #fafbff; font-size: .9rem; color: var(--ink-soft); }
.btn-text-danger { background: none; border: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; padding: .5rem 0; }
.btn-text-danger:hover { color: #b91c1c; }

.cart-summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: 90px; }
.cart-summary h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }
.sum-row { display: flex; justify-content: space-between; padding: .5rem 0; color: var(--ink-soft); }
.sum-total { border-top: 1px dashed var(--line); margin-top: .5rem; padding-top: 1rem; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.sum-total span:last-child { color: var(--brand); }
.cart-note { margin-top: 1rem; font-size: .8rem; color: var(--muted); display: flex; gap: .4rem; align-items: flex-start; }
.text-success { color: #047857 !important; }

@media (max-width: 600px) {
    .cart-item { grid-template-columns: 60px 1fr auto; grid-row-gap: .5rem; }
    .cart-thumb { width: 60px; height: 60px; }
    .cart-line-total { grid-column: 2 / 4; text-align: left; }
    .cart-remove { grid-column: 3; grid-row: 1; justify-self: end; }
}

/* ===================== Account layout ===================== */
.account-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; padding: 1.5rem 0; align-items: start; }
.account-side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; position: sticky; top: 90px; }
.account-user { display: flex; align-items: center; gap: .75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.account-avatar { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(120deg,var(--brand),var(--brand-2)); color: #fff; display: grid; place-items: center; flex: none; }
.account-user strong { display: block; }
.account-menu { display: flex; flex-direction: column; gap: .25rem; }
.account-menu a, .logout-link { display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem; border-radius: 12px; color: var(--ink-soft); font-weight: 500; transition: .15s; border: none; background: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit; font-size: .95rem; }
.account-menu a:hover, .logout-link:hover { background: var(--brand-soft); color: var(--brand); }
.account-menu a.active { background: linear-gradient(120deg,var(--brand),var(--brand-2)); color: #fff; }
.logout-link { color: #b91c1c; margin-top: .5rem; border-top: 1px solid var(--line); border-radius: 0; padding-top: 1rem; }
.logout-link:hover { background: #fef2f2; color: #b91c1c; }

/* ===================== Content blocks (account/admin/super) ===================== */
.content-head { margin-bottom: 1.25rem; }
.content-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .5rem; }
.content-head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.back-link { color: var(--ink-soft); display: inline-flex; align-items: center; gap: .25rem; font-size: .9rem; margin-bottom: .4rem; }
.back-link:hover { color: var(--brand); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.panel-head h2 { font-size: 1.15rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .5rem; }
.panel-head .more { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; font-size: .9rem; }

/* ----- Stat cards ----- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; transition: .15s; }
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.stat-card strong { font-size: 1.6rem; font-weight: 700; display: block; line-height: 1.1; }
.stat-card span { color: var(--muted); font-size: .85rem; }

/* ----- Data table ----- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th { text-align: left; padding: .75rem; color: var(--muted); font-weight: 600; font-size: .82rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.data-table td { padding: .85rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #fafbff; }
.link-brand { color: var(--brand); font-weight: 600; }

/* ----- Status badges ----- */
.status-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.st-success { background: #dcfce7; color: #15803d; }
.st-warn    { background: #fef3c7; color: #b45309; }
.st-info    { background: #dbeafe; color: #1d4ed8; }
.st-danger  { background: #fee2e2; color: #b91c1c; }
.st-muted   { background: #f1f5f9; color: #64748b; }

/* ----- Address cards ----- */
.addr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.addr-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.addr-card.is-default { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.addr-default-tag { position: absolute; top: 1rem; right: 1rem; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .25rem; }
.addr-card h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .35rem; }
.addr-phone { color: var(--ink-soft); font-size: .88rem; margin: 0 0 .5rem; display: flex; align-items: center; gap: .3rem; }
.addr-text { color: var(--ink-soft); font-size: .9rem; line-height: 1.6; margin: 0 0 1rem; }
.addr-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn-mini { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); border-radius: 10px; padding: .4rem .7rem; font-size: .85rem; cursor: pointer; transition: .15s; }
.btn-mini:hover { border-color: var(--brand); color: var(--brand); }
.btn-mini-danger:hover { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }

/* ----- Checkbox row ----- */
.check-row { display: flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; margin-top: .5rem; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }

@media (max-width: 860px) {
    .account-layout { grid-template-columns: 1fr; }
    .account-side { position: static; }
    .account-menu { flex-direction: row; flex-wrap: wrap; }
    .account-menu a span, .logout-link span { display: none; }
    .logout-link { border-top: none; border-radius: 12px; padding-top: .7rem; width: auto; }
    .stat-grid { grid-template-columns: 1fr; }
    .addr-grid { grid-template-columns: 1fr; }
}

/* ===================== Checkout ===================== */
.addr-select, .pay-methods { display: flex; flex-direction: column; gap: .6rem; }
.addr-option, .pay-method { display: flex; gap: .75rem; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 14px; padding: 1rem; cursor: pointer; transition: .15s; }
.addr-option:hover, .pay-method:hover { border-color: var(--brand); }
.addr-option input, .pay-method input { margin-top: .25rem; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.addr-option:has(input:checked), .pay-method:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.addr-option-body strong { display: block; }
.addr-option-body span { color: var(--ink-soft); font-size: .88rem; }
.pay-method { align-items: center; }
.pay-method-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.pay-method strong { display: block; }
.pay-method small { color: var(--muted); }

.co-group { border-bottom: 1px dashed var(--line); padding-bottom: .6rem; margin-bottom: .6rem; }
.co-group-name { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .3rem; margin-bottom: .4rem; }
.co-line { display: flex; justify-content: space-between; font-size: .88rem; color: var(--ink-soft); padding: .15rem 0; gap: 1rem; }
.co-line span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-sub { color: var(--muted); }

/* ===================== Success / Payment ===================== */
.success-hero { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.5rem 1.5rem; margin-bottom: 1.5rem; }
.success-check { color: #16a34a; margin-bottom: .5rem; }
.success-hero h1 { font-size: 1.8rem; font-weight: 700; margin: 0 0 .35rem; }
.success-hero p { color: var(--ink-soft); margin: 0 0 .5rem; }

.order-pay-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; overflow: hidden; }
.order-pay-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); background: #fafbff; gap: 1rem; }
.order-pay-head strong { display: block; }

.pay-box { padding: 1.25rem; }
.pay-paid { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem; color: #16a34a; padding: 1.5rem; }
.pay-paid strong { font-size: 1.15rem; color: var(--ink); }
.pay-paid span { color: var(--muted); }
.pay-cod { display: flex; gap: 1rem; align-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 14px; padding: 1.25rem; }
.pay-cod strong { color: var(--ink); display: block; }
.pay-cod p { margin: .25rem 0 0; color: var(--ink-soft); }

.pay-pp { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; }
.pay-pp-qr { text-align: center; background: linear-gradient(160deg,#fff,#f6f7ff); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; }
.pp-head { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--brand); margin-bottom: .75rem; }
.qr-canvas { display: inline-block; padding: .5rem; background: #fff; border-radius: 12px; }
.qr-canvas img, .qr-canvas canvas { display: block; }
.pp-amount { font-size: 1.6rem; font-weight: 700; color: var(--brand); margin-top: .75rem; }
.pp-hint { color: var(--muted); font-size: .82rem; margin: .25rem 0 0; }
.pay-pp-info h4 { font-weight: 600; margin: 0 0 .75rem; }
.pp-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.pp-list li { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px dashed var(--line); gap: 1rem; }
.pp-list span { color: var(--muted); font-size: .88rem; }
.pp-slip-status { background: #dbeafe; color: #1d4ed8; padding: .6rem .9rem; border-radius: 10px; font-size: .88rem; display: flex; align-items: center; gap: .4rem; margin-bottom: .75rem; }
.pp-slip-status.pp-rejected { background: #fee2e2; color: #b91c1c; }
.upload-drop { display: flex; flex-direction: column; align-items: center; gap: .35rem; border: 2px dashed var(--line); border-radius: 14px; padding: 1.25rem; cursor: pointer; color: var(--ink-soft); transition: .15s; position: relative; }
.upload-drop:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.upload-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

@media (max-width: 640px) {
    .pay-pp { grid-template-columns: 1fr; }
    .pay-pp-qr { max-width: 320px; margin: 0 auto; }
}

/* ===================== Order list / detail ===================== */
.order-list { display: flex; flex-direction: column; gap: .75rem; }
.order-row { display: flex; align-items: center; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.25rem; transition: .15s; }
.order-row:hover { box-shadow: var(--shadow); border-color: transparent; transform: translateY(-1px); }
.order-row-main { flex: 1; min-width: 0; }
.order-row-top { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .25rem; }
.order-row-top strong { font-size: 1rem; }
.order-row-top span { font-size: .85rem; display: inline-flex; align-items: center; gap: .25rem; }
.order-row-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.order-row-badges { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.order-row-total { font-weight: 700; color: var(--brand); }
.order-row-arrow { color: var(--muted); flex: none; }

.oi-row { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid var(--line); gap: 1rem; }
.oi-row:last-child { border-bottom: none; }
.oi-name { flex: 1; }
.oi-sum { color: var(--ink-soft); font-size: .92rem; border-bottom: none; padding: .3rem 0; }
.oi-total { border-top: 2px dashed var(--line); margin-top: .35rem; padding-top: .85rem; font-weight: 700; font-size: 1.1rem; }
.oi-total span:last-child { color: var(--brand); }

/* ----- Timeline ----- */
.timeline { display: flex; justify-content: space-between; position: relative; margin: 1.5rem 0 .5rem; }
.timeline::before { content: ''; position: absolute; top: 22px; left: 8%; right: 8%; height: 3px; background: var(--line); z-index: 0; }
.tl-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .5rem; flex: 1; }
.tl-dot { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 3px solid var(--line); color: var(--muted); display: grid; place-items: center; transition: .2s; }
.tl-step span { font-size: .82rem; color: var(--muted); text-align: center; }
.tl-step.active .tl-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
.tl-step.active span { color: var(--brand); font-weight: 600; }
.tl-step.done .tl-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.tl-step.done span { color: var(--ink); }
.tracking-box { display: flex; align-items: center; gap: .5rem; background: var(--brand-soft); color: var(--ink); border-radius: 10px; padding: .75rem 1rem; margin-top: 1rem; font-size: .9rem; }

@media (max-width: 600px) {
    .order-row { flex-wrap: wrap; }
    .timeline { font-size: .75rem; }
    .tl-dot { width: 38px; height: 38px; }
}

/* =====================================================================
   PREMIUM HOMEPAGE REFRESH — โทนหรูหรา ทันสมัย (e-commerce)
   เพิ่มเลเยอร์ตกแต่งหน้าแรกให้ดูพรีเมียม โดยอิงตัวแปรสีแบรนด์เดิม
   ===================================================================== */

/* ---------- พื้นหลังเว็บแบบไล่เฉดนุ่ม ๆ (luxury mesh) ---------- */
body {
    background:
        radial-gradient(1100px 520px at 100% -8%, rgba(var(--brand-2-rgb), .07), transparent 60%),
        radial-gradient(960px 480px at -8% 4%, rgba(var(--brand-rgb), .07), transparent 58%),
        var(--bg);
    background-attachment: fixed;
}

/* ---------- Scroll reveal (เลื่อนแล้วค่อย ๆ ปรากฏ) ---------- */
/* ใช้ .js gate เพื่อ progressive enhancement: ถ้าไม่มี JS เนื้อหายังแสดงครบ */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); will-change: opacity, transform; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ---------- Hero (เริ่มต้น) — เพิ่มแสงเรืองและกระจกฝ้า ---------- */
.hero {
    border-radius: 32px;
    box-shadow: 0 40px 80px -40px rgba(var(--brand-rgb), .6);
    isolation: isolate;
}
.hero::before {
    content: ''; position: absolute; z-index: 0; inset: -30% -10% auto auto;
    width: 460px; height: 460px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.45), transparent 62%);
    filter: blur(8px); opacity: .7; animation: heroFloat 11s ease-in-out infinite;
}
.hero h1 { letter-spacing: -.02em; text-shadow: 0 6px 24px rgba(15,23,42,.18); }
.hero .badge-brand { backdrop-filter: blur(6px); }
.hero-search {
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35);
    backdrop-filter: blur(14px); box-shadow: 0 20px 50px -20px rgba(15,23,42,.5);
}
.hero-search input { background: #fff; }
@keyframes heroFloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-18px,16px) scale(1.06); } }

/* ---------- Hero slider — มุมโค้งพรีเมียม + caption นุ่มขึ้น ---------- */
.hero-slider { border-radius: 0 0 28px 28px; box-shadow: 0 30px 60px -38px rgba(15,23,42,.5); }
.hero-slide img { transition: transform 7s ease; }
.hero-slider .carousel-item.active .hero-slide img { transform: scale(1.06); }
.hero-slide-caption {
    background: linear-gradient(to top, rgba(15,23,42,.82) 8%, rgba(15,23,42,.35) 55%, transparent);
    padding-top: 4.5rem;
}
.hero-slide-caption h2 { letter-spacing: -.01em; text-shadow: 0 4px 20px rgba(0,0,0,.4); }

/* ---------- Mobile hero search — ยกระดับเป็นกระจกฝ้า ---------- */
.mobile-hero-search { box-shadow: var(--shadow-sm); border-color: var(--line); }
.mobile-hero-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* ---------- Feature strip — การ์ดจุดเด่นบริการ (ก่อนหน้านี้ไม่มีสไตล์) ---------- */
.feature-strip {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
    margin: 1.75rem 0 .5rem;
}
.feature-item {
    display: flex; align-items: center; gap: .9rem;
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.78));
    border: 1px solid rgba(255,255,255,.9); border-radius: 20px;
    padding: 1.05rem 1.15rem;
    box-shadow: 0 14px 36px -22px rgba(15,23,42,.4);
    backdrop-filter: blur(8px);
    transition: transform .22s ease, box-shadow .22s ease;
}
.feature-item:hover { transform: translateY(-5px); box-shadow: 0 24px 50px -24px rgba(var(--brand-rgb), .55); }
.feature-ico {
    width: 50px; height: 50px; border-radius: 16px; flex: none;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 10px 22px -8px rgba(var(--brand-rgb), .8);
}
.feature-item strong { display: block; font-size: .96rem; font-weight: 600; color: var(--ink); }
.feature-item span { color: var(--muted); font-size: .8rem; }

/* ---------- Section heads — หัวข้อหมวดแบบพรีเมียม ---------- */
.sec-title { display: flex; align-items: center; gap: .85rem; }
.sec-badge {
    width: 48px; height: 48px; border-radius: 16px; flex: none;
    display: grid; place-items: center; color: var(--brand);
    background: linear-gradient(135deg, var(--brand-soft), #fff);
    border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.sec-title > div h2 { font-size: 1.45rem; font-weight: 700; margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.sec-title > div p { margin: .1rem 0 0; color: var(--muted); font-size: .88rem; }
.section-head h2 { letter-spacing: -.01em; }
.section-head .more {
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: .45rem 1rem; box-shadow: var(--shadow-sm);
    transition: border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.section-head .more:hover { border-color: var(--brand); box-shadow: 0 10px 24px -12px rgba(var(--brand-rgb), .6); transform: translateY(-1px); }

/* ---------- Cards — เงานุ่มแบบไล่ระดับ + ขอบเรืองแสงตอน hover ---------- */
.product-card, .school-card { box-shadow: 0 6px 18px -14px rgba(15,23,42,.5); }
.product-card:hover, .school-card:hover {
    box-shadow: 0 28px 56px -26px rgba(var(--brand-rgb), .5);
    border-color: rgba(var(--brand-rgb), .35);
}
.product-card .price { letter-spacing: -.02em; }
.product-card .thumb .flag {
    background: linear-gradient(120deg, var(--brand-2), var(--brand));
    box-shadow: 0 6px 16px -6px rgba(var(--brand-2-rgb), .8);
}
.school-card .banner {
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    position: relative;
}
.school-card .logo { box-shadow: 0 10px 24px -10px rgba(var(--brand-rgb), .6); }

/* ---------- Empty state — กล่องว่างให้ดูตั้งใจ ---------- */
.empty-state {
    background: linear-gradient(180deg, #fff, var(--bg));
    border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .feature-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .hero { border-radius: 24px; }
    .sec-badge { width: 42px; height: 42px; border-radius: 13px; }
    .sec-title > div h2 { font-size: 1.2rem; }
}
@media (max-width: 480px) {
    .feature-item { padding: .85rem .9rem; gap: .7rem; border-radius: 16px; }
    .feature-ico { width: 42px; height: 42px; border-radius: 13px; }
    .feature-item strong { font-size: .88rem; }
}

/* ---------- แถบหมวดหมู่สินค้า (Category bar) ---------- */
.cat-bar { display: grid; grid-template-columns: repeat(7, 1fr); gap: .85rem; }
.cat-tile {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .55rem;
    background: #fff; border: 1px solid var(--line); border-radius: 18px;
    padding: 1.15rem .6rem; box-shadow: 0 6px 18px -14px rgba(15,23,42,.5);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cat-tile:hover {
    transform: translateY(-5px); border-color: rgba(var(--brand-rgb), .35);
    box-shadow: 0 22px 44px -22px rgba(var(--brand-rgb), .55);
}
.cat-tile-ico {
    width: 62px; height: 62px; border-radius: 50%; overflow: hidden; flex: none;
    display: grid; place-items: center; color: var(--brand);
    background: linear-gradient(135deg, var(--brand-soft), #fff); border: 1px solid var(--line);
    transition: transform .2s ease;
}
.cat-tile:hover .cat-tile-ico { transform: scale(1.06); }
.cat-tile-ico img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile strong {
    font-size: .86rem; font-weight: 600; color: var(--ink); line-height: 1.25; max-width: 100%;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-tile-count { font-size: .72rem; color: var(--muted); }
@media (max-width: 1200px) { .cat-bar { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 992px)  { .cat-bar { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 768px)  { .cat-bar { grid-template-columns: repeat(4, 1fr); } .cat-tile-ico { width: 54px; height: 54px; } }
@media (max-width: 480px)  { .cat-bar { grid-template-columns: repeat(3, 1fr); gap: .6rem; } .cat-tile { padding: .9rem .4rem; border-radius: 15px; } .cat-tile-ico { width: 48px; height: 48px; } }

/* ---------- แบนเนอร์ CTA โปรโมชั่น ---------- */
.promo-cta {
    position: relative; overflow: hidden; isolation: isolate; border-radius: 28px;
    background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff;
    padding: clamp(2rem, 5vw, 3.5rem); box-shadow: 0 40px 80px -42px rgba(var(--brand-rgb), .75);
}
.promo-cta::after {
    content: ''; position: absolute; inset: 0; z-index: -1; opacity: .55;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 39.5h40M39.5 0v40' fill='none' stroke='%23ffffff' stroke-opacity='.08'/%3E%3C/svg%3E");
}
.promo-cta-decor {
    position: absolute; z-index: -1; width: 420px; height: 420px; border-radius: 50%;
    right: -90px; top: -150px; filter: blur(10px);
    background: radial-gradient(circle, rgba(var(--gold-rgb), .55), transparent 62%);
    animation: heroFloat 12s ease-in-out infinite;
}
.promo-cta-body { position: relative; max-width: 660px; }
.promo-cta-tag {
    display: inline-flex; align-items: center; gap: .4rem;
    background: linear-gradient(120deg, var(--gold-2), var(--gold)); color: #3a2600;
    border: 1px solid rgba(255,255,255,.45);
    padding: .4rem .95rem; border-radius: 999px;
    font-size: .82rem; font-weight: 700; box-shadow: 0 8px 18px -8px rgba(var(--gold-rgb), .8);
}
.promo-cta h2 {
    font-size: clamp(1.6rem, 3.6vw, 2.6rem); font-weight: 700; line-height: 1.15;
    letter-spacing: -.02em; margin: .95rem 0 .6rem; text-shadow: 0 6px 24px rgba(15,23,42,.25);
}
.promo-cta p { opacity: .95; max-width: 560px; margin: 0 0 1.6rem; font-size: 1.02rem; }
.promo-cta-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn-light {
    display: inline-flex; align-items: center; gap: .5rem; color: #3a2600;
    background: linear-gradient(120deg, var(--gold-2), var(--gold));
    border-radius: 999px; padding: .78rem 1.6rem; font-weight: 700;
    box-shadow: 0 16px 32px -14px rgba(var(--gold-rgb), .8); transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn-light:hover { transform: translateY(-2px); color: #3a2600; filter: brightness(1.04); box-shadow: 0 22px 44px -16px rgba(var(--gold-rgb), .85); }
.btn-ghost {
    display: inline-flex; align-items: center; gap: .5rem; color: #fff;
    border: 1.5px solid rgba(255,255,255,.6); border-radius: 999px; padding: .78rem 1.6rem; font-weight: 600;
    transition: background .15s, border-color .15s, transform .15s;
}
.btn-ghost:hover { background: rgba(255,255,255,.16); color: #fff; border-color: #fff; transform: translateY(-2px); }

/* =====================================================================
   PREMIUM v2 — ปรับจังหวะ/ตัวอักษรหน้าแรกให้ดู editorial หรูขึ้น
   ===================================================================== */

/* ---------- จังหวะ section กว้างขึ้น + หัวข้อคมขึ้น ---------- */
.site-main .section { padding: 3rem 0; }
.section-head { margin-bottom: 1.6rem; }
.sec-title > div h2 { font-size: 1.55rem; }
.sec-title > div p { font-size: .92rem; }

/* ---------- Eyebrow (ป้ายเล็กเหนือหัวข้อ) ---------- */
.eyebrow {
    display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .16em;
    text-transform: uppercase; color: var(--brand); margin-bottom: .15rem;
}
.sec-badge { align-self: flex-start; margin-top: .35rem; }

/* ---------- Hero caption — eyebrow + ปุ่ม ---------- */
.hero-slide-caption .container { display: flex; flex-direction: column; align-items: flex-start; }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .7rem;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.32);
    backdrop-filter: blur(8px); padding: .35rem .9rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; color: #fff; letter-spacing: .02em;
}
.btn-hero {
    display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.1rem;
    background: #fff; color: var(--brand); font-weight: 700;
    padding: .6rem 1.4rem; border-radius: 999px;
    box-shadow: 0 16px 34px -14px rgba(0,0,0,.55); transition: transform .15s, box-shadow .15s;
}
.hero-slide:hover .btn-hero { transform: translateY(-2px); box-shadow: 0 22px 42px -16px rgba(0,0,0,.6); }

/* ---------- แถบสถิติ (Stats / trust band) ---------- */
.stats-band {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: 22px;
    overflow: hidden; margin: 1.75rem 0 .5rem;
    box-shadow: 0 18px 44px -28px rgba(15,23,42,.4);
}
.stat-pill {
    display: flex; align-items: center; gap: .85rem;
    background: linear-gradient(180deg, #fff, #fbfcff); padding: 1.4rem 1.5rem;
}
.stat-pill-ico {
    width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center;
    color: var(--brand); background: linear-gradient(135deg, var(--brand-soft), #fff);
    border: 1px solid var(--line);
}
.stat-pill strong {
    display: block; font-size: 1.7rem; font-weight: 700; line-height: 1; letter-spacing: -.02em;
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-pill span { font-size: .82rem; color: var(--ink-soft); }
@media (max-width: 768px) {
    .stats-band { grid-template-columns: repeat(2, 1fr); border-radius: 18px; }
    .stat-pill { padding: 1.1rem; }
    .stat-pill strong { font-size: 1.4rem; }
}
@media (max-width: 360px) {
    .stat-pill { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* ---------- Stagger reveal — ไล่ปรากฏทีละชิ้นในกริด ---------- */
.js .reveal.in .row > [class*="col-"],
.js .reveal.in .cat-bar > .cat-tile,
.js .reveal.in .stats-band > .stat-pill,
.js .reveal.in .feature-strip > .feature-item {
    animation: riseIn .55s cubic-bezier(.22,.61,.36,1) backwards;
}
.js .reveal.in .row > [class*="col-"]:nth-child(1),
.js .reveal.in .cat-bar > .cat-tile:nth-child(1),
.js .reveal.in .stats-band > .stat-pill:nth-child(1),
.js .reveal.in .feature-strip > .feature-item:nth-child(1) { animation-delay: .02s; }
.js .reveal.in .row > [class*="col-"]:nth-child(2),
.js .reveal.in .cat-bar > .cat-tile:nth-child(2),
.js .reveal.in .stats-band > .stat-pill:nth-child(2),
.js .reveal.in .feature-strip > .feature-item:nth-child(2) { animation-delay: .08s; }
.js .reveal.in .row > [class*="col-"]:nth-child(3),
.js .reveal.in .cat-bar > .cat-tile:nth-child(3),
.js .reveal.in .stats-band > .stat-pill:nth-child(3),
.js .reveal.in .feature-strip > .feature-item:nth-child(3) { animation-delay: .14s; }
.js .reveal.in .row > [class*="col-"]:nth-child(4),
.js .reveal.in .cat-bar > .cat-tile:nth-child(4),
.js .reveal.in .stats-band > .stat-pill:nth-child(4),
.js .reveal.in .feature-strip > .feature-item:nth-child(4) { animation-delay: .2s; }
.js .reveal.in .row > [class*="col-"]:nth-child(n+5),
.js .reveal.in .cat-bar > .cat-tile:nth-child(n+5) { animation-delay: .24s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .js .reveal.in .row > [class*="col-"],
    .js .reveal.in .cat-bar > .cat-tile,
    .js .reveal.in .stats-band > .stat-pill,
    .js .reveal.in .feature-strip > .feature-item { animation: none; }
}

/* ---------- Hero slider — cinematic + caption ข้อความ/ปุ่ม เสมอ ---------- */
.hero-slide img { height: clamp(300px, 42vw, 560px); }
.hero-slide-link { display: block; }
.hero-slide-caption {
    background: linear-gradient(to top, rgba(15,23,42,.88) 6%, rgba(15,23,42,.5) 45%, rgba(15,23,42,.12) 75%, transparent);
    padding-top: 5.5rem; pointer-events: none;
}
.hero-slide-caption .btn-hero { pointer-events: auto; }
.hero-slide-caption .container { max-width: 1320px; }
.hero-slide-caption h2 { max-width: 18ch; }
.hero-slide-caption p { max-width: 56ch; opacity: .94; }
.btn-hero:hover { color: var(--brand); }
@media (max-width: 768px) {
    .hero-slide-caption p { display: none; }              /* มือถือ: เน้นหัวข้อ+ปุ่ม */
    .hero-slide-caption { padding-top: 3rem; }
    .hero-eyebrow { font-size: .72rem; padding: .3rem .75rem; }
    .btn-hero { margin-top: .85rem; padding: .55rem 1.2rem; }
}


/* =====================================================================
   VIBRANT LAYER — เติมสีสันให้ตื่นเต้น ดึงดูดสายตา (ยังคงโครงพรีเมียม)
   ===================================================================== */

/* ---------- คู่สีตัดกัน: แบรนด์ (ม่วง–ชมพู) × ทอง/อำพัน ---------- */
:root { --gold: #f59e0b; --gold-2: #fbbf24; --gold-deep: #d97706; --gold-rgb: 245,158,11; }

/* ---------- พื้นหลัง: เฉดแบรนด์ + แต้มทองอุ่น ๆ ---------- */
body {
    background:
        radial-gradient(1050px 520px at 102% -8%, rgba(var(--brand-2-rgb), .09), transparent 60%),
        radial-gradient(950px 480px at -8% 2%, rgba(var(--brand-rgb), .09), transparent 58%),
        radial-gradient(760px 420px at 96% 92%, rgba(var(--gold-rgb), .06), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

/* ---------- ไอคอนหมวด/สถิติ/บริการ: สลับ แบรนด์ ↔ ทอง (คู่ตัด) ---------- */
.cat-tile .cat-tile-ico,
.stats-band .stat-pill-ico,
.feature-strip .feature-ico {
    color: #fff; border: none;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 12px 24px -12px rgba(var(--brand-rgb), .8);
}
.cat-tile:nth-child(even) .cat-tile-ico,
.stats-band .stat-pill:nth-child(even) .stat-pill-ico,
.feature-strip .feature-item:nth-child(even) .feature-ico {
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    box-shadow: 0 12px 24px -12px rgba(var(--gold-rgb), .8);
}
.cat-tile:hover { border-color: rgba(var(--brand-rgb), .3); box-shadow: 0 24px 46px -22px rgba(15,23,42,.32); }

/* ---------- ป้ายสินค้า: คุมโทน (แบรนด์ + ทอง accent + กระจกเข้ม) ---------- */
/* ซ้ายบน: ลดราคา = สีแบรนด์ / แนะนำ = กระจกเข้ม */
.product-card .thumb .flag.flag-sale {
    background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff;
    box-shadow: 0 6px 16px -6px rgba(var(--brand-rgb), .85);
}
.product-card .thumb .flag.flag-featured {
    background: rgba(15,23,42,.6); color: #fff; backdrop-filter: blur(6px);
}
.product-card .thumb .flag-featured svg { color: var(--gold-2); }
/* ขวาบน: มาใหม่ = ทอง / ขายดี = กระจกเข้ม + เปลวทอง เต้นเบา ๆ */
.product-card .thumb .flag-corner {
    position: absolute; top: .6rem; right: .6rem; display: inline-flex; align-items: center; gap: .25rem;
    font-size: .7rem; font-weight: 700; padding: .24rem .55rem; border-radius: 999px;
}
.product-card .thumb .flag-corner.flag-new {
    background: linear-gradient(120deg, var(--gold), var(--gold-2)); color: #2b1a00;
    box-shadow: 0 6px 16px -6px rgba(245,158,11,.9);
}
.product-card .thumb .flag-corner.flag-hot {
    background: rgba(15,23,42,.6); color: #fff; backdrop-filter: blur(6px);
    box-shadow: 0 6px 16px -6px rgba(15,23,42,.5);
    animation: hotPulse 1.9s ease-in-out infinite;
}
.product-card .thumb .flag-corner.flag-hot svg { color: var(--gold-2); }
@keyframes hotPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .product-card .thumb .flag-corner.flag-hot { animation: none; } }

/* ---------- Promo CTA — ไล่สีเคลื่อนไหว มีพลังขึ้น ---------- */
.promo-cta {
    background: linear-gradient(120deg, var(--brand), var(--brand-2), var(--brand));
    background-size: 220% 220%; animation: gradShift 12s ease infinite;
}
@keyframes gradShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@media (prefers-reduced-motion: reduce) { .promo-cta { animation: none; } }

/* ---------- ปุ่ม: แสงวิ่งผ่านตอน hover (micro-delight) ---------- */
.btn-brand, .btn-light, .btn-hero { position: relative; overflow: hidden; }
.btn-brand::after, .btn-light::after, .btn-hero::after {
    content: ''; position: absolute; top: 0; left: -80%; width: 45%; height: 100%; pointer-events: none;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
    transform: skewX(-20deg);
}
.btn-brand:hover::after, .btn-light:hover::after, .btn-hero:hover::after { animation: sheen .85s ease; }
@keyframes sheen { from { left: -80%; } to { left: 140%; } }

/* =====================================================================
   SHOPEE-INSPIRED — ทิศทางไอคอน/หมวดหมู่แบบ marketplace (คงคู่ม่วง×ทอง)
   flat · มุมโค้งมน (squircle) · เส้นหนาขึ้น · กริดหมวดบนพาเนลขาวสะอาด
   ===================================================================== */

/* ไอคอนเด่นบนหน้าแรกหนาขึ้น = ดูเป็นมิตร/ชัด แบบ Shopee */
.cat-tile-ico svg, .feature-ico svg, .stat-pill-ico svg, .sec-badge svg { stroke-width: 2.35; }

/* แถบหมวดหมู่ = พาเนลขาวสะอาด (การ์ดหมวดสไตล์ Shopee) */
.cat-bar {
    background: #fff; border: 1px solid var(--line); border-radius: 22px;
    padding: 1.5rem 1rem; gap: .9rem .4rem;
    box-shadow: 0 14px 36px -24px rgba(15,23,42,.35);
}
.cat-tile {
    background: transparent; border: none; box-shadow: none;
    padding: .6rem .35rem; border-radius: 16px; gap: .55rem;
}
.cat-tile:hover {
    background: var(--brand-soft); border: none; box-shadow: none;
    transform: translateY(-3px);
}
/* ไอคอนหมวด = squircle (กรอบสี่เหลี่ยมมุมโค้ง) แบบแอป marketplace */
.cat-tile-ico { width: 58px; height: 58px; border-radius: 20px; }
.cat-tile:hover .cat-tile-ico { transform: scale(1.05); }
.cat-tile strong { font-size: .82rem; }

@media (max-width: 768px) {
    .cat-bar { padding: 1.1rem .5rem; border-radius: 18px; }
    .cat-tile-ico { width: 52px; height: 52px; border-radius: 17px; }
}
@media (max-width: 480px) {
    .cat-tile-ico { width: 48px; height: 48px; border-radius: 15px; }
}
