/* ================================================================
   SHOP THEME — หน้าร้านลูกค้า (index.html)
   โหลดหลังสุด เพื่อปรับหน้าตาทุกส่วนให้เป็นชุดเดียวกับหน้าแอดมิน
   ================================================================ */
:root {
    --sh-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Thai', 'Leelawadee UI', sans-serif;
    --sh-bg: #f4f6f4;
    --sh-surface: #ffffff;
    --sh-border: #e3e8e4;
    --sh-border-soft: #eef2ef;
    --sh-text: #0f172a;
    --sh-text-2: #475569;
    --sh-text-3: #8492a6;
    --sh-primary: #1d7a46;
    --sh-primary-2: #2ca652;
    --sh-primary-soft: #ecfdf3;
    --sh-primary-ink: #14532d;
    --sh-accent: #d97706;
    --sh-danger: #dc2626;
    --sh-radius: 14px;
    --sh-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .05);
    --sh-shadow-lg: 0 10px 30px rgba(15, 23, 42, .10);
    --sh-grad: linear-gradient(135deg, #14532d 0%, #1d7a46 55%, #2ca652 100%);
    --sh-gutter: 20px;
}
@media (max-width: 768px) { :root { --sh-gutter: 14px; } }

html, body, body.theme-green, body.theme-green .page, body.theme-green .panel { font-family: var(--sh-font); }
body, html, body.theme-green { background: var(--sh-bg); color: var(--sh-text); }
.page-content, .popup .page-content, #tab-1, #tab-2, #tab-3, #tab-5 { background: var(--sh-bg) !important; }
#tab-1 { padding-bottom: 0 !important; }

/* ================= Navbar ================= */
.theme-green .navbar {
    background: var(--sh-grad);
    box-shadow: 0 2px 10px rgba(20, 83, 45, .25);
}
.navbar-inner .center.sh-brand, .sh-brand {
    display: flex; align-items: center; gap: 10px; line-height: 1.2; height: 56px; overflow: visible;
}
.sh-brand-mark {
    width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25);
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.sh-brand-mark svg { width: 22px; height: 22px; }
.sh-brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; white-space: nowrap; }
.sh-brand-text b { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .01em; }
.sh-brand-text small { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .78); letter-spacing: .06em; text-transform: uppercase; }
.theme-green .navbar .center.sh-brand { font-weight: 400; }
.sh-nav-phone {
    display: none; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px;
    border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
    color: #fff !important; font-size: 13px; font-weight: 600; text-decoration: none;
}
.sh-nav-phone svg { width: 16px; height: 16px; }
@media (min-width: 768px) { .sh-nav-phone { display: inline-flex; } }

/* ================= Tabbar ================= */
.theme-green .toolbar.tabbar {
    background: var(--sh-surface);
    box-shadow: 0 1px 0 var(--sh-border), 0 6px 16px rgba(15, 23, 42, .05);
}
.toolbar-inner a.tab-link { color: var(--sh-text-3); }
.toolbar-inner a.tab-link.active { background: transparent; color: var(--sh-primary); }
.tabbar-labels span.tabbar-label { font-size: 13px; font-weight: 600; line-height: 18px; }
@media (min-width: 768px) { .tabbar-labels span.tabbar-label { font-size: 14px; } }
.tabbar .tab-link-highlight { background: var(--sh-primary) !important; height: 3px; border-radius: 3px 3px 0 0; }
i.icon.sh-tab-ico {
    width: 26px; height: 26px; background: none; position: relative;
    display: inline-flex; align-items: center; justify-content: center; opacity: 1;
}
i.icon.sh-tab-ico svg { width: 24px; height: 24px; }
.tab-link.active i.icon.sh-tab-ico { color: var(--sh-primary); }
.tabbar .active-state { background: var(--sh-primary-soft); }
.tab-link .badge#noti-add-to-card {
    position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; line-height: 18px;
    padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700;
    background: var(--sh-danger); color: #fff; border: 2px solid #fff; box-sizing: content-box;
}

/* ================= Page container ================= */
.sh-container { max-width: 1280px; margin: 0 auto; padding: 0 var(--sh-gutter); box-sizing: border-box; }

/* ================= Hero ================= */
#hero-banner { padding: 14px var(--sh-gutter) 6px; max-width: 1280px; margin: 0 auto; box-sizing: border-box; }
.hero-banner { margin: 0; border-radius: 18px; box-shadow: var(--sh-shadow-lg); }
.sh-hero {
    position: relative; overflow: hidden; border-radius: 20px; color: #fff;
    background: var(--sh-grad); box-shadow: var(--sh-shadow-lg);
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; padding: 30px 34px; align-items: center;
}
.sh-hero:before, .sh-hero:after {
    content: ''; position: absolute; border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0));
}
.sh-hero:before { width: 420px; height: 420px; right: -120px; top: -200px; }
.sh-hero:after { width: 300px; height: 300px; left: 30%; bottom: -220px; }
.sh-hero-main { position: relative; z-index: 1; }
.sh-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
    font-size: 12px; font-weight: 600; letter-spacing: .02em; margin-bottom: 14px;
}
.sh-hero-eyebrow svg { width: 14px; height: 14px; }
.sh-hero h1 { margin: 0 0 10px; font-size: 30px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.sh-hero p { margin: 0 0 20px; font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, .88); max-width: 520px; }
.sh-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sh-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
    border-radius: 10px; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
    border: 1px solid transparent; transition: transform .15s, box-shadow .15s, background .15s;
}
.sh-btn svg { width: 16px; height: 16px; }
.sh-btn-light { background: #fff; color: var(--sh-primary) !important; box-shadow: 0 6px 16px rgba(0, 0, 0, .15); }
.sh-btn-light:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0, 0, 0, .2); }
.sh-btn-ghost { background: rgba(255, 255, 255, .12); color: #fff !important; border-color: rgba(255, 255, 255, .35); }
.sh-btn-ghost:hover { background: rgba(255, 255, 255, .2); }
.sh-hero-side { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sh-hero-stat {
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 14px;
    padding: 14px 12px; text-align: center; backdrop-filter: blur(4px);
}
.sh-hero-stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.sh-hero-stat span { display: block; margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, .85); }
@media (max-width: 900px) {
    .sh-hero { grid-template-columns: 1fr; padding: 24px 22px; gap: 16px; }
    .sh-hero h1 { font-size: 24px; }
    .sh-hero p { font-size: 14px; }
}
@media (max-width: 480px) {
    .sh-hero { padding: 20px 18px; }
    .sh-hero h1 { font-size: 22px; }
    .sh-hero-side { gap: 8px; }
    .sh-hero-stat { padding: 10px 6px; border-radius: 12px; }
    .sh-hero-stat b { font-size: 20px; }
    .sh-hero-stat span { font-size: 11px; }
    .sh-btn { height: 40px; padding: 0 14px; font-size: 13px; }
}

/* promo slider (เมื่อมีโปรโมชัน) */
.hero-banner-slide img { height: 240px; }
@media (min-width: 768px) { .hero-banner-slide img { height: 320px; } }
.hero-banner-overlay { padding: 20px 24px; background: linear-gradient(transparent 0%, rgba(15, 23, 42, .72) 100%); }
.hero-banner-name { font-size: 18px; }
.hero-banner-btn { border-radius: 10px; padding: 10px 20px; font-size: 14px; background: #fff; color: var(--sh-primary); }
.hero-banner-btn:hover { background: var(--sh-primary-soft); }

/* ================= Search ================= */
.home-search {
    max-width: 1280px; margin: 10px auto 0; padding: 0 var(--sh-gutter); gap: 10px;
    background: transparent; box-sizing: border-box;
}
.sh-search-field { position: relative; flex: 1; min-width: 0; }
.sh-search-field svg {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px;
    color: var(--sh-text-3); pointer-events: none;
}
.home-search input[type="search"] {
    width: 100%; height: 46px; padding: 0 14px 0 42px; box-sizing: border-box;
    border: 1px solid var(--sh-border); border-radius: 12px; background: var(--sh-surface);
    font-size: 14px; font-family: var(--sh-font); color: var(--sh-text); box-shadow: var(--sh-shadow);
    -webkit-appearance: none; appearance: none;
}
.home-search input[type="search"]:focus { border-color: var(--sh-primary-2); box-shadow: 0 0 0 3px rgba(44, 166, 82, .18); }
.home-search select {
    height: 46px; padding: 0 36px 0 14px; min-width: 130px; border: 1px solid var(--sh-border); border-radius: 12px;
    background: var(--sh-surface) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238492a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
    font-size: 14px; font-family: var(--sh-font); color: var(--sh-text); box-shadow: var(--sh-shadow);
    -webkit-appearance: none; appearance: none; cursor: pointer;
}
.home-search select:focus { outline: none; border-color: var(--sh-primary-2); }
@media (max-width: 480px) { .home-search select { min-width: 104px; padding-left: 10px; } }

/* ================= Section headers ================= */
.home-section-header, .home-allproducts-header {
    max-width: 1280px; margin: 0 auto; padding: 22px var(--sh-gutter) 10px; box-sizing: border-box;
}
.home-section-title, .home-allproducts-title {
    position: relative; padding-left: 14px; font-size: 18px; font-weight: 700; color: var(--sh-text); letter-spacing: -.01em;
}
.home-section-title:before, .home-allproducts-title:before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 4px; height: 20px; border-radius: 4px; background: var(--sh-grad);
}
.home-allproducts-count {
    font-size: 12px; font-weight: 600; color: var(--sh-primary); background: var(--sh-primary-soft);
    border: 1px solid #c8ead5; padding: 4px 10px; border-radius: 999px;
}
.home-section-link { font-size: 13px; font-weight: 600; color: var(--sh-primary); }

/* ================= Categories ================= */
.home-categories-scroll {
    max-width: 1280px; margin: 0 auto; padding: 4px var(--sh-gutter) 8px; box-sizing: border-box;
    display: flex; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 10px;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.home-categories-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .home-categories-scroll { flex-wrap: wrap; overflow: visible; } }
.home-cat-item {
    scroll-snap-align: start; min-width: 84px; padding: 10px 10px 9px; gap: 7px;
    background: var(--sh-surface); border: 1px solid var(--sh-border); border-radius: 14px; box-shadow: var(--sh-shadow);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.home-cat-item:hover { transform: translateY(-2px); box-shadow: var(--sh-shadow-lg); border-color: #c8ead5; }
.home-cat-item.active { border-color: var(--sh-primary-2); background: var(--sh-primary-soft); box-shadow: 0 0 0 3px rgba(44, 166, 82, .15); }
.home-cat-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--sh-bg); font-size: 22px; }
.home-cat-item.active .home-cat-icon { background: #d7f2e1; }
.home-cat-name { font-size: 13px; font-weight: 600; color: var(--sh-text-2); max-width: 84px; }
.home-cat-item.active .home-cat-name { color: var(--sh-primary); }

/* ================= Featured ================= */
.home-featured-scroll { max-width: 1280px; margin: 0 auto; padding: 4px var(--sh-gutter) 10px; box-sizing: border-box; }
.featured-card { flex-basis: 170px; border: 1px solid var(--sh-border); border-radius: var(--sh-radius); box-shadow: var(--sh-shadow); }
.featured-card-badge { background: var(--sh-danger); border-radius: 999px; padding: 3px 9px; }
.featured-card-btn { background: var(--sh-grad); border-radius: 9px; }

/* ================= Product grid ================= */
#tab-1-shop {
    max-width: 1280px; margin: 0 auto; padding: 6px var(--sh-gutter) 28px; box-sizing: border-box;
    grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px;
}
@media (max-width: 1199px) { #tab-1-shop { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
@media (max-width: 899px) { #tab-1-shop { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 599px) { #tab-1-shop { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.product-card {
    border-radius: var(--sh-radius); border: 1px solid var(--sh-border); box-shadow: var(--sh-shadow);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--sh-shadow-lg); border-color: #c8ead5; }
.product-image { height: auto; aspect-ratio: 4 / 3; background: #f1f5f2; }
@supports not (aspect-ratio: 4 / 3) { .product-image { height: 150px; } }
.product-badge { top: 10px; left: 10px; right: auto; border-radius: 999px; padding: 4px 10px; font-size: 11px; background: var(--sh-danger); box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.product-info { padding: 12px 12px 6px; gap: 6px; min-height: 0; }
.product-name { font-size: 14px; font-weight: 600; color: var(--sh-text); line-height: 1.35; min-height: 38px; }
@media (max-width: 480px) { .product-name { font-size: 13px; min-height: 35px; } }
.product-id {
    align-self: flex-start; font-size: 11px; font-weight: 600; color: var(--sh-text-3); letter-spacing: .04em;
    background: var(--sh-bg); border: 1px solid var(--sh-border-soft); border-radius: 6px; padding: 2px 7px;
}
.product-footer {
    flex-direction: row; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px 12px; border-top: 1px solid var(--sh-border-soft);
}
.product-price { font-size: 18px; font-weight: 800; color: var(--sh-primary); letter-spacing: -.01em; white-space: nowrap; }
@media (max-width: 480px) { .product-price { font-size: 16px; } }
.product-footer .button, .product-footer .button.button-small.button-fill.color-green {
    height: 36px; line-height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 700;
    text-transform: none; letter-spacing: 0; background: var(--sh-grad); color: #fff; box-shadow: 0 4px 10px rgba(29, 122, 70, .25);
    font-family: var(--sh-font);
}
.product-footer .button:hover { filter: brightness(1.05); }
@media (max-width: 480px) {
    .product-footer { flex-direction: column; align-items: stretch; gap: 8px; }
    .product-footer .button, .product-footer .button.button-small.button-fill.color-green { height: 38px; line-height: 38px; text-align: center; }
}

/* ================= Footer ================= */
.sh-footer { background: var(--sh-primary-ink); color: rgba(255, 255, 255, .85); margin-top: 8px; }
.sh-footer-inner {
    max-width: 1280px; margin: 0 auto; padding: 34px var(--sh-gutter) 22px; box-sizing: border-box;
    display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px;
}
.sh-footer h4 { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .02em; }
.sh-footer p { margin: 0 0 6px; font-size: 13px; line-height: 1.7; }
.sh-footer a { color: #fff; text-decoration: none; font-weight: 600; }
.sh-footer a:hover { text-decoration: underline; }
.sh-footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sh-footer-brand .sh-brand-mark { background: rgba(255, 255, 255, .12); }
.sh-footer-brand b { font-size: 17px; color: #fff; }
.sh-footer-phones { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-footer-phones a {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); font-size: 13px;
}
.sh-footer-phones svg { width: 14px; height: 14px; }
.sh-footer-hours { display: grid; gap: 4px; font-size: 13px; }
.sh-footer-hours div { display: flex; justify-content: space-between; gap: 12px; }
.sh-footer-hours span:last-child { color: #fff; font-weight: 600; }
.sh-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12); max-width: 1280px; margin: 0 auto;
    padding: 14px var(--sh-gutter) 18px; font-size: 12px; color: rgba(255, 255, 255, .6);
    display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; box-sizing: border-box;
}
@media (max-width: 768px) {
    .sh-footer-inner { grid-template-columns: 1fr; gap: 20px; padding-top: 26px; }
}

/* ================= Contact / Profile / Cart tabs ================= */
#tab-5 { padding-left: var(--sh-gutter) !important; padding-right: var(--sh-gutter) !important; }
#tab-2-order, #tab-2-grand, #tab-3-profile { padding-left: var(--sh-gutter); padding-right: var(--sh-gutter); box-sizing: border-box; }
#tab-2-order { padding-top: 14px; }
#tab-2-grand { padding-bottom: 24px; }
#tab-2 .content-block, #tab-3 .content-block { margin-left: 0; margin-right: 0; }
.sh-tab-wrap { max-width: 960px; margin: 0 auto; }
.contact-map, .contact-info-card { border-radius: var(--sh-radius); border: 1px solid var(--sh-border); box-shadow: var(--sh-shadow); }
.contact-biz-name { font-size: 19px; color: var(--sh-text); }
.contact-section-icon { background: var(--sh-primary-soft); }
.contact-section-label { color: var(--sh-text-3); }
.contact-phone { background: var(--sh-primary-soft); color: var(--sh-primary); }
#tab-2 .order-controls, #tab-2 .order-list li, .content-block, .checkout-card, .confirm-form-section, .auth-card {
    border-radius: var(--sh-radius); border: 1px solid var(--sh-border); box-shadow: var(--sh-shadow);
}
.auth-btn-primary, .checkout-btn-primary, .confirm-form-section .button-fill, #tab-2 .button-fill { background: var(--sh-grad); }
.cart-checkout-btn, .cart-checkout-btn:hover {
    background: var(--sh-grad); color: #fff !important; border-radius: 12px; font-weight: 700;
    box-shadow: 0 6px 16px rgba(29, 122, 70, .28); max-width: 420px; margin-left: auto;
}
.cart-checkout-btn:hover { filter: brightness(1.05); }
.checkout-submit-btn { background: var(--sh-grad) !important; border-radius: 12px; }
.cart-subtotal-price { color: var(--sh-primary); }

/* ================= Popups ================= */
.popup .navbar { background: var(--sh-grad); }
.popup .navbar .center { color: #fff; font-weight: 600; }
.popup .navbar .link, .popup .navbar .icon-back { color: #fff; }
.popup .navbar .icon-back:after { color: #fff; }

/* รายละเอียดสินค้า (markup จาก api/user/shop.php case 'product')
   โครง 2 คอลัมน์บนจอกว้าง: รูปสี่เหลี่ยมจัตุรัสเกาะด้านบนซ้าย (sticky) · ขวา = ชื่อ → กล่องราคา/ใส่ตะกร้า → รายละเอียด → ถูกใจ/รีวิว
   เดิมรูปถูกยืดสูงเท่าคอลัมน์ขวา (มีรีวิวยาว) เลยเหลือพื้นเทาว่างก้อนใหญ่เหนือรูป */
.sh-pd { max-width: 1040px; margin: 0 auto; padding: 18px var(--sh-gutter) 32px; box-sizing: border-box; container-type: inline-size; }
.sh-pd-card {
    background: var(--sh-surface); border: 1px solid var(--sh-border); border-radius: 18px; box-shadow: var(--sh-shadow);
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0; align-items: start;
}
.sh-pd-media {
    position: sticky; top: 0; align-self: start; padding: 22px; background: var(--sh-surface);
    border-radius: 18px 0 0 18px; border-right: 1px solid var(--sh-border-soft);
}
.sh-pd-media img {
    display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px;
    background: #f1f5f2; border: 1px solid var(--sh-border-soft);
}
.sh-pd-promo-tag {
    position: absolute; top: 34px; left: 34px; z-index: 1; background: var(--sh-danger); color: #fff; font-size: 12px; font-weight: 700;
    padding: 5px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.sh-pd-body { padding: 26px 28px 26px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sh-pd-head { display: flex; flex-direction: column; gap: 8px; }
.sh-pd-code {
    align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--sh-text-3); letter-spacing: .06em; text-transform: uppercase;
    background: var(--sh-bg); border: 1px solid var(--sh-border-soft); border-radius: 6px; padding: 3px 8px;
}
.sh-pd-name { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 800; color: var(--sh-text); letter-spacing: -.01em; overflow-wrap: anywhere; }
.sh-pd-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-pd-meta span {
    font-size: 12px; font-weight: 600; color: var(--sh-text-2); background: var(--sh-bg);
    border: 1px solid var(--sh-border-soft); border-radius: 999px; padding: 4px 10px;
}
/* กล่องราคา + ใส่ตะกร้า: พื้นเขียวอ่อน ให้สายตาไปหาจุดสั่งซื้อก่อน */
.sh-pd-buy { background: var(--sh-primary-soft); border: 1px solid #cfe9da; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.sh-pd-price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sh-pd-price { font-size: 32px; font-weight: 800; color: var(--sh-primary); letter-spacing: -.02em; line-height: 1.1; }
.sh-pd-price small { font-size: 14px; font-weight: 600; color: var(--sh-text-2); margin-left: 4px; letter-spacing: 0; }
.sh-pd-price-old { font-size: 16px; color: var(--sh-text-3); text-decoration: line-through; }
.sh-pd-promo-note { font-size: 13px; color: var(--sh-danger); font-weight: 600; }
.sh-pd-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.sh-pd-qty { flex: 0 0 auto; }
.sh-pd .sh-qty-btn, .sh-pd .sh-qty-input { height: 46px; }
.sh-pd .sh-qty-btn { width: 44px; border-radius: 10px; }
.sh-pd .sh-qty-input { width: 64px; border-radius: 10px; font-weight: 700; }
.sh-pd .sh-qty-label { font-weight: 600; color: var(--sh-text-2); }
.sh-pd-add.sh-btn { flex: 1 1 180px; height: 46px; font-size: 15px; }
.sh-btn-primary { background: var(--sh-grad); color: #fff !important; box-shadow: 0 6px 16px rgba(29, 122, 70, .3); }
.sh-btn-primary:hover { transform: translateY(-1px); }
.sh-btn-outline { background: var(--sh-surface); color: var(--sh-primary) !important; border-color: #c8ead5; }
.sh-pd-note { font-size: 12px; color: var(--sh-text-2); line-height: 1.6; }
.sh-pd-note a { color: var(--sh-primary); font-weight: 700; text-decoration: none; white-space: nowrap; }
.sh-pd-section h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--sh-text-3); letter-spacing: .04em; text-transform: uppercase; }
.sh-pd-desc { margin: 0; font-size: 14.5px; line-height: 1.8; color: var(--sh-text-2); white-space: pre-line; overflow-wrap: anywhere; }
.sh-pd-social-wrap { border-top: 1px solid var(--sh-border-soft); padding-top: 4px; }
.sh-pd-social-wrap .vr-social { margin-top: 0; border-top: 0; padding-top: 12px; }
.sh-pd-back.sh-btn { align-self: flex-start; height: 40px; font-size: 13px; padding: 0 16px; }
/* คอลัมน์เดียว (มือถือ หรือ popup แคบ): รูปเต็มความกว้าง 4:3 อยู่บนสุด */
@media (max-width: 720px) {
    .sh-pd { padding: 12px var(--sh-gutter) 24px; }
    .sh-pd-card { grid-template-columns: 1fr; }
    .sh-pd-media { position: static; padding: 0; border-right: 0; border-radius: 18px 18px 0 0; overflow: hidden; }
    .sh-pd-media img { aspect-ratio: 4 / 3; border-radius: 0; border: 0; }
    .sh-pd-promo-tag { top: 14px; left: 14px; }
    .sh-pd-body { padding: 18px 16px 20px; gap: 14px; }
    .sh-pd-name { font-size: 20px; }
    .sh-pd-price { font-size: 28px; }
    .sh-pd-buy { padding: 14px; }
    .sh-pd-add.sh-btn { flex-basis: 100%; }
    .sh-pd-back.sh-btn { align-self: stretch; }
}
/* popup สินค้าบนจอใหญ่: Framework7 กำหนด 630×630 ซึ่งแคบเกินกว่าจะวางรูปกับเนื้อหาข้างกัน — ขยายเป็น ~960×(90% ของจอ) */
@media all and (min-width: 1000px) and (min-height: 630px) {
    .popup-product:not(.tablet-fullscreen) {
        width: 960px; height: min(880px, 90vh); margin-left: -480px; margin-top: calc(-1 * min(880px, 90vh) / 2); border-radius: 12px; overflow: hidden;
    }
}
/* popup กว้างน้อยกว่า ~600px — media query ด้านบนวัดจากหน้าจอจึงไม่ทำงาน ใช้ความกว้างของกล่องแทน */
@container (max-width: 600px) {
    .sh-pd-card { grid-template-columns: 1fr; }
    .sh-pd-media { position: static; padding: 0; border-right: 0; border-radius: 18px 18px 0 0; overflow: hidden; }
    .sh-pd-media img { aspect-ratio: 4 / 3; border-radius: 0; border: 0; }
    .sh-pd-promo-tag { top: 14px; left: 14px; }
    .sh-pd-body { padding: 18px 16px 20px; gap: 14px; }
    .sh-pd-name { font-size: 20px; }
    .sh-pd-price { font-size: 28px; }
    .sh-pd-buy { padding: 14px; }
    .sh-pd-add.sh-btn { flex-basis: 100%; }
    .sh-pd-back.sh-btn { align-self: stretch; }
}

/* ================= Misc ================= */
.toast { border-radius: 12px; font-family: var(--sh-font); }
.modal { border-radius: 12px; font-family: var(--sh-font); }
.modal .modal-button { color: var(--sh-primary); }
.preloader-indicator-modal { border-radius: 12px; }
::selection { background: rgba(44, 166, 82, .25); }

/* ===== qty stepper (card + product popup) ===== */
.sh-qty { display: flex; align-items: center; gap: 6px; }
.sh-qty-btn { width: 32px; height: 32px; border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; font-size: 18px; line-height: 1; color: #1e293b; padding: 0; cursor: pointer; }
.sh-qty-input { width: 56px; height: 32px; text-align: center; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px; padding: 0 4px; -moz-appearance: textfield; background: #fff; }
.sh-qty-input::-webkit-outer-spin-button, .sh-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sh-qty-label, .sh-qty-unit { font-size: 14px; color: #475569; }
.sh-qty-card { width: 100%; justify-content: center; margin-bottom: 6px; }
.sh-qty-card .sh-qty-input { flex: 1 1 auto; min-width: 0; width: auto; }
.product-footer { flex-wrap: wrap; }
.product-footer .product-price { flex: 1 1 100%; }
.product-footer .button { flex: 1 1 100%; text-align: center; }

/* ===== floating call button ===== */
.sh-fab-call { position: fixed; right: 14px; bottom: 84px; z-index: 900; width: 52px; height: 52px; border-radius: 50%; background: #2ca652; color: #fff !important; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.sh-fab-call svg { width: 24px; height: 24px; }
.product-oos { font-size: 12px; color: #b45309; margin-top: 4px; line-height: 1.3; }
.product-gift { font-size: 12px; color: #15803d; font-weight: 600; margin-top: 4px; }

/* ================= Product card — e-commerce layout (2026-10-12) =================
   การ์ดสูงเท่ากันทั้งแถว · รูปจัตุรัส · ชื่อ 2 บรรทัด · ราคา/หน่วย + ราคาเดิมขีดฆ่า · ปุ่มชิดล่างเสมอ */
.product-card-wrapper { display: flex; position: relative; min-width: 0; }
.product-card { display: flex; flex-direction: column; flex: 1 1 auto; width: 100%; min-width: 0; overflow: hidden; background: var(--sh-surface); }
.product-image { aspect-ratio: 1 / 1; overflow: hidden; position: relative; }
.product-img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; transition: transform .35s ease; }
.product-card:hover .product-img { transform: scale(1.04); }
.product-info { flex: 1 1 auto; padding: 12px 12px 8px; gap: 4px; display: flex; flex-direction: column; }
.product-name {
    cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 14px; font-weight: 700; line-height: 1.35; min-height: 2.7em; color: var(--sh-text);
}
.product-name:hover { color: var(--sh-primary); }
.product-id { margin-top: 0; font-size: 11px; font-weight: 500; color: var(--sh-text-3); background: none; border: 0; padding: 0; letter-spacing: 0; }
.product-desc {
    font-size: 12px; line-height: 1.5; color: var(--sh-text-2); margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-gift { display: inline-block; align-self: flex-start; margin-top: 4px; padding: 3px 8px; border-radius: 999px; background: #f0fdf4; border: 1px solid #bbf7d0; font-size: 11.5px; }
.product-oos { display: inline-block; align-self: flex-start; margin-top: 4px; padding: 3px 8px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; font-size: 11.5px; }
.product-footer { margin-top: auto; display: block; padding: 10px 12px 12px; border-top: 1px solid var(--sh-border-soft); }
.product-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.product-footer .product-price-row .product-price { flex: 0 0 auto; font-size: 20px; line-height: 1.2; }
.product-price.is-promo { color: var(--sh-danger); }
.product-price-ask { font-size: 15px !important; color: var(--sh-text-2); font-weight: 700; }
.product-unit { font-size: 12px; color: var(--sh-text-3); font-weight: 600; }
.product-price-old { min-height: 18px; font-size: 13px; color: var(--sh-text-3); text-decoration: line-through; margin-bottom: 8px; }
.product-footer .sh-qty-card { margin-bottom: 8px; }
.product-footer .button { display: block; width: 100%; box-sizing: border-box; }
.product-footer .button.product-call { background: #fff; color: var(--sh-primary); border: 1px solid var(--sh-primary-2); box-shadow: none; margin-top: 8px; }
.product-badge-discount { z-index: 3; }
@media (max-width: 480px) {
    .product-info { padding: 10px 10px 6px; }
    .product-name { font-size: 13px; }
    .product-footer { padding: 8px 10px 10px; }
    .product-footer .product-price-row .product-price { font-size: 18px; }
}

/* โครงการ์ดระหว่างโหลด */
.product-skeleton { pointer-events: none; }
.product-skeleton .sk { background: linear-gradient(90deg, #eef2ef 25%, #f7f9f7 37%, #eef2ef 63%); background-size: 400% 100%; animation: vrSk 1.3s ease infinite; border-radius: 8px; }
.product-skeleton .product-image { border-radius: 0; }
.product-skeleton .sk-line { height: 14px; margin: 8px 0; }
.product-skeleton .sk-line.short { width: 60%; }
.product-skeleton .sk-btn { height: 36px; margin-top: 12px; }
@keyframes vrSk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* เรียงลำดับ */
.home-allproducts-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.home-allproducts-header .home-allproducts-title { margin-right: 2px; }
.home-sort { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sh-text-2); }
.home-sort select {
    height: 36px; border: 1px solid var(--sh-border); border-radius: 10px; background: #fff; padding: 0 28px 0 10px;
    font-size: 13px; font-weight: 600; color: var(--sh-text); font-family: var(--sh-font); cursor: pointer;
}
.home-sort select:focus { outline: none; border-color: var(--sh-primary-2); box-shadow: 0 0 0 3px rgba(44, 166, 82, .18); }
.home-promo-note { margin: 8px 16px 0; padding: 10px 12px; border-radius: 10px; background: #f0fdf4; color: #166534; font-size: 14px; border: 1px solid #bbf7d0; }
