/**
 * หน้าแรก commerce — มินิมอล responsive ยึดโทนส้ม-แดงเดิม
 * Breakpoint หลัก: 1200px (desktop)
 */

.home {
    --home-accent: var(--theme-primary, #f7432e);
    --home-accent-2: var(--theme-secondary, #fa4d2f);
    --home-accent-grad: linear-gradient(
        var(--theme-footer-angle, 269.98deg),
        var(--theme-footer-from, #f6402d) 0%,
        var(--theme-footer-to, #fe6232) 100%
    );
    --home-surface: #f8f8f8;
    --home-radius: 12px;
    --home-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --home-max: 1200px;
    --home-pad-x: 16px;
    /* ช่องว่าง header → สไลด์ (responsive ตามจอ) */
    --home-header-gap-mo: clamp(4.25rem, 9vw + 2.5rem, 5.5rem);
    --home-header-gap-dt: clamp(3.25rem, 2.5vw + 2rem, 4.25rem);
    /* ความสูงแบนเนอร์ลด ~30% จากเดิม */
    --home-hero-banner-max: min(33.6vw, 252px);
    --home-hero-banner-dt: min(322px, 25.2vw);
    --home-hero-side-max-w: 20%;
    color: #333;
    background: #fff;
    /* ยกเลิก ybb style.css .home { top: -50px } ที่ดึงเนื้อหาทับ header */
    top: 0 !important;
    margin-top: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

/* ---- สลับ mobile/tablet vs desktop ---- */
@media (max-width: 1199.98px) {
    .home .home-show-dt {
        display: none !important;
    }
}

@media (min-width: 1200px) {
    .home .home-show-mo {
        display: none !important;
    }
}

/* ---- กล่องเนื้อหากลาง ---- */
.home-shell {
    width: 100%;
    max-width: var(--home-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--home-pad-x);
    padding-right: var(--home-pad-x);
    box-sizing: border-box;
}

.home-block {
    margin-bottom: 20px;
}

.home-section {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.home-section .head-title {
    font: 600 1.25rem 'Prompt', sans-serif;
    color: var(--home-accent);
    margin-bottom: 1rem;
    text-align: left;
}

/* ---- Hero ---- */
.home-hero-wrap {
    width: 100%;
    max-width: var(--home-max);
    margin: 0 auto 12px;
    padding: var(--home-header-gap-mo) var(--home-pad-x) 8px;
    box-sizing: border-box;
}

.home-hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Hero เต็มความกว้าง (variant full_width จากจัดชั้นหน้าแรก) */
.home-hero-wrap--full .home-hero__slider {
    flex: 1 1 100%;
    max-width: 100%;
}

.home-hero-wrap--full .home-hero__side {
    display: none !important;
}

.home-hero__slider,
.home-hero__side {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.home-hero__slider {
    position: relative;
}

/* ยกเลิก slider/styles.css เก่า (โหลดค้างในบางธีม) — ไม่ให้ทับ engine ใหม่ */
.home-hero__slider .slide_viewer {
    top: 0 !important;
    height: auto !important;
}

.home-hero__slider .slide,
.home-hero__slider .slide:first-child {
    display: block !important;
}

.home-hero__slider .slide_buttons {
    position: absolute !important;
    display: flex !important;
}

.home-hero__slider .slider {
    width: 100%;
    border-radius: var(--home-radius);
    overflow: hidden;
    position: relative;
    line-height: 0;
    flex: 1 1 auto;
}

/* สไลด์ — crossfade นุ่ม (ไม่ใช้ jQuery animate + fadeIn 3s) */
.home-hero__slider .slide_viewer {
    top: 0 !important;
    position: relative !important;
    width: 100%;
    margin: 0;
    overflow: hidden;
    border-radius: var(--home-radius);
    aspect-ratio: 3.05 / 1;
    max-height: var(--home-hero-banner-max);
}

.home-hero__slider .slide_group {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    margin: 0;
}

.home-hero__slider .slide {
    position: absolute !important;
    inset: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    display: block !important;
    z-index: 0;
    animation: none !important;
}

.home-hero__slider .slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.home-hero__slider .slide.fade-in {
    animation: none !important;
}

.home-hero__slider .slide a {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
}

.home-hero__slider .rectangle-1212s {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: none !important;
    object-fit: cover;
    object-position: center;
    border-radius: var(--home-radius);
    display: block;
}

/* dot กลางล่างบนรูป — แบบเดิม (bullet ใหญ่ ขาว / active แดง) */
.home-hero__slider .slide_viewer {
    position: relative !important;
}

.home-hero__slider .slide_buttons {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    z-index: 9;
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    width: max-content;
    max-width: calc(100% - 16px);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    pointer-events: auto;
    background: transparent;
    line-height: 1;
}

.home-hero__slider .slide_buttons .slide_btn {
    display: inline-block;
    margin: 0 0.175em;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1;
    text-decoration: none;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.35s ease-in-out, transform 0.35s ease-in-out;
}

.home-hero__slider .slide_buttons .slide_btn:hover {
    color: #fff;
    transform: scale(1.08);
}

.home-hero__slider .slide_buttons .slide_btn.active,
.home-hero__slider .slide_buttons .slide_btn.active:hover {
    color: #e2231a;
    transform: scale(1);
}

/* หน้าร้อง: ซ่อนปุ่มลูกศร — ใช้เฉพาะ dot (เปิดได้ด้วย data-show-arrows="1") */
.home-hero__slider:not([data-show-arrows="1"]) .home-slider-nav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ไม่ให้ directional_nav ดัน layout ลง */
.home-hero__slider .directional_nav {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    top: 0 !important;
    left: 0 !important;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* แบนเนอร์ข้าง (เดิม .rectangle-1212 มี top:130px จาก ybb — ทำให้ทับไอคอน/โปรโมชัน) */
.home-hero__side {
    position: relative !important;
    top: 0 !important;
    overflow: hidden;
    border-radius: var(--home-radius);
}

.home-hero__side img,
.home-hero__side .rectangle-1212,
.home-hero__side .home-hero__side-img {
    position: relative !important;
    top: 0 !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
    display: block;
    object-fit: cover;
    object-position: center;
}

.home-hero__side > a {
    display: block;
    line-height: 0;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .home-hero-wrap {
        padding-top: clamp(4rem, 7vw + 2.25rem, 5rem);
    }

    .home-hero__slider .slide_viewer {
        max-height: min(28vw, 294px);
        aspect-ratio: 2.85 / 1;
    }
}

@media (min-width: 1200px) {
    .home-hero-wrap {
        padding-top: var(--home-header-gap-dt);
    }

    .home-hero {
        --home-hero-banner-h: var(--home-hero-banner-dt);
        flex-direction: row;
        align-items: stretch;
        gap: 16px;
    }

    /* สไลด์ ~80% | แบนเนอร์ข้างสูงสุด 20% */
    .home-hero__slider {
        flex: 1 1 0;
        min-width: 0;
        max-width: none !important;
        width: auto;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        min-height: var(--home-hero-banner-h);
    }

    .home-hero__slider .slider {
        flex: 1 1 auto;
        width: 100%;
        height: 100%;
        min-height: var(--home-hero-banner-h);
        display: flex;
        flex-direction: column;
    }

    .home-hero__slider .slide_viewer {
        flex: 1 1 auto;
        width: 100%;
        height: var(--home-hero-banner-h);
        min-height: var(--home-hero-banner-h);
        max-height: var(--home-hero-banner-h);
        aspect-ratio: unset;
    }

    .home-hero__side {
        flex: 0 0 var(--home-hero-side-max-w);
        width: var(--home-hero-side-max-w);
        max-width: var(--home-hero-side-max-w) !important;
        min-width: 0;
        height: var(--home-hero-banner-h);
        min-height: var(--home-hero-banner-h);
        max-height: var(--home-hero-banner-h);
        display: flex !important;
        flex-direction: column;
        gap: 0;
        align-self: stretch;
    }

    .home-hero__side > a {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        width: 100%;
    }

    .home-hero__side img,
    .home-hero__side .rectangle-1212,
    .home-hero__side .home-hero__side-img {
        flex: 1 1 auto;
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        max-height: 100% !important;
        object-fit: cover;
        object-position: center top;
    }

    .home-hero__slider .slide_buttons {
        bottom: 14px;
    }
}

/* ยกเลิก float bootstrap ในหน้าแรก */
.home .container,
.home .col-md-8,
.home .col-md-4,
.home .col-md-9,
.home .col-md-3,
.home .col-md-6,
.home .col-md-12,
.home .col-xs-12 {
    box-sizing: border-box;
}

@media (max-width: 1199.98px) {
    .home .home-shell .col-md-8,
    .home .home-shell .col-md-4,
    .home .home-shell .col-md-9,
    .home .home-shell .col-md-3,
    .home .home-shell .col-md-6,
    .home .home-shell .col-md-12,
    .home .home-shell .col-xs-12 {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* ---- เมนูไอคอน (promotion-bar) ---- */
.home-nav-icons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px 8px;
    width: 100%;
    padding: 12px 0 8px;
    justify-items: center;
}

.home-nav-icons .col-md-1,
.home-nav-icons .col-md-2,
.home-nav-icons .col-xs-1,
.home-nav-icons > div,
.home-nav-icons > a {
    float: none !important;
    width: auto !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
}

.home-nav-icons .icon-home {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--home-surface);
    padding: 11px;
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--home-accent);
    box-shadow: var(--home-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-nav-icons .hl-shortcut-menu__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.home-nav-icons .hl-shortcut-menu__icon {
    font-size: 1.15rem;
    line-height: 1;
}

.home-nav-icons .hl-shortcut-menu__fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--home-accent);
    background: rgba(255, 255, 255, 0.72);
}

.home-nav-icons a:hover .icon-home {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(247, 67, 46, 0.2);
}

.home-nav-icons .text-promotion,
.home-nav-icons .text-promo-subhead,
.home-nav-icons span:not(.icon-home) {
    display: block;
    font-size: 11px;
    line-height: 1.35;
    margin-top: 6px;
    color: #444 !important;
    word-break: break-word;
    max-width: 76px;
}

@media (max-width: 480px) {
    .home-nav-icons {
        gap: 10px 6px;
    }

    .home-nav-icons .icon-home {
        width: 46px;
        height: 46px;
        font-size: 17px;
        padding: 9px;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .home-nav-icons {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
        gap: 16px 12px;
    }

    .home-nav-icons .icon-home {
        width: 58px;
        height: 58px;
        font-size: 22px;
    }
}

@media (min-width: 1200px) {
    .home-nav-icons--dt {
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 18px 14px;
        padding: 20px 0 12px;
        max-width: var(--home-max);
        margin: 0 auto;
    }

    .home-nav-icons--dt .icon-home {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }

    .home-nav-icons--dt .text-promotion,
    .home-nav-icons--dt .text-promo-subhead {
        font-size: 12px;
        max-width: 88px;
    }
}

/* ---- การ์ดโปรโมชัน — 1 แถว 3 คอลัมน์เท่ากัน กลางสูงกว่า ---- */
.home-promo-deals {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto !important;
    gap: 10px;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 0 18px;
    align-items: center;
    box-sizing: border-box;
}

/* การ์ดกลาง (ใบที่ 2) สูงกว่าซ้าย–ขวา */
.home-promo-deals > .home-promo-card:nth-child(2) {
    margin-top: 0;
}

.home-promo-deals > .home-promo-card:nth-child(1),
.home-promo-deals > .home-promo-card:nth-child(3) {
    margin-top: 0;
}

.home-promo-deals > .home-promo-card:nth-child(2) .home-promo-card__main {
    min-height: 118px;
    padding-top: 20px;
    padding-bottom: 22px;
}

.home-promo-deals > .home-promo-card:nth-child(1) .home-promo-card__main,
.home-promo-deals > .home-promo-card:nth-child(3) .home-promo-card__main {
    min-height: 88px;
    padding-top: 12px;
    padding-bottom: 14px;
}

.home-promo-deals > .home-promo-card:nth-child(2) .home-promo-card__price {
    font-size: clamp(1.95rem, 1.3rem + 5.46vw, 3.25rem);
    line-height: 1.05;
}

/* ลูกโดยตรงต้องเป็น .home-promo-card เท่านั้น (ไม่ใช้ wrapper col-md-10) */
.home-promo-deals > .home-promo-card {
    grid-column: auto;
    width: 100% !important;
    max-width: none !important;
}

.home-promo-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    border-radius: var(--home-radius);
    overflow: hidden;
    box-shadow: var(--home-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-promo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: inherit;
}

.home-promo-card__main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 10px 16px;
    min-height: 96px;
    background: var(--home-promo-bg, var(--home-accent-grad));
    color: #fff;
}

.home-promo-card__label {
    font-size: clamp(11px, 2.5vw, 16px);
    font-weight: 500;
    line-height: 1.3;
    opacity: 0.95;
}

.home-promo-card__sub {
    font-size: clamp(10px, 2vw, 14px);
    line-height: 1.3;
    margin-top: 2px;
    opacity: 0.9;
}

.home-promo-card__price {
    font-size: clamp(1.35rem, 5.5vw, 2.75rem);
    font-weight: 600;
    line-height: 1.1;
    margin-top: 4px;
    letter-spacing: -0.02em;
}

.home-promo-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: linear-gradient(180deg, #474747 0%, #000 100%);
    color: #fff;
    font-size: clamp(11px, 2.5vw, 14px);
    font-weight: 500;
    border-radius: 0 0 var(--home-radius) var(--home-radius);
}

/* fallback: ถ้ายังมี HTML เก่าหลุดเข้ามา — ยกเลิก grid ชั้นนอก ให้ wrapper เต็มกว้าง */
.home-promo-deals:has(> .col-md-10),
.home-promo-deals:has(> .col-xs-12) {
    display: block !important;
}

.home-promo-deals > .col-md-10,
.home-promo-deals > .col-xs-12 {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: end !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    justify-content: stretch !important;
    align-items: stretch !important;
}

.home-promo-deals .col-md-3,
.home-promo-deals .col-md-4,
.home-promo-deals .col-xs-3,
.home-promo-deals .col-xs-6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

.home-promo-deals .col-md-4 .rectangle-115,
.home-promo-deals .col-md-4 .rectangle-116,
.home-promo-deals .col-md-4 .rectangle-117,
.home-promo-deals .col-xs-6 .rectangle-115,
.home-promo-deals .col-xs-6 .rectangle-116,
.home-promo-deals .col-xs-6 .rectangle-117 {
    min-height: 118px !important;
}

.home-promo-deals .rectangle-115,
.home-promo-deals .rectangle-116,
.home-promo-deals .rectangle-117 {
    flex: 1 1 auto;
    width: 100% !important;
    height: auto !important;
    min-height: 88px;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-radius: var(--home-radius) var(--home-radius) 0 0;
}

.home-promo-deals .rectangle-120 {
    width: 100% !important;
    height: auto !important;
    min-height: 36px;
    position: relative !important;
    top: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 var(--home-radius) var(--home-radius);
}

.home-promo-deals .rectangle-120 .text-promotion {
    color: #fff !important;
    position: static !important;
    margin: 0;
}

@media (min-width: 576px) {
    .home-promo-deals {
        gap: 12px;
    }

    .home-promo-deals > .home-promo-card:nth-child(2) .home-promo-card__main {
        min-height: 132px;
    }

    .home-promo-deals > .home-promo-card:nth-child(1) .home-promo-card__main,
    .home-promo-deals > .home-promo-card:nth-child(3) .home-promo-card__main {
        min-height: 100px;
    }

    .home-promo-deals > .home-promo-card:nth-child(1),
    .home-promo-deals > .home-promo-card:nth-child(3) {
        margin-top: 0;
    }

    .home-promo-deals > .home-promo-card:nth-child(2) .home-promo-card__price {
        font-size: clamp(2.6rem, 1.625rem + 4.55vw, 3.9rem);
    }
}

@media (min-width: 992px) {
    .home-promo-deals > .home-promo-card:nth-child(2) .home-promo-card__price {
        font-size: clamp(3.58rem, 1.3rem + 3.64vw, 4.88rem);
    }
}

@media (min-width: 1200px) {
    .home-promo-deals--dt {
        gap: 16px;
        padding-bottom: 24px;
    }

    .home-promo-deals > .home-promo-card:nth-child(2) .home-promo-card__main {
        min-height: 148px;
    }

    .home-promo-deals > .home-promo-card:nth-child(1) .home-promo-card__main,
    .home-promo-deals > .home-promo-card:nth-child(3) .home-promo-card__main {
        min-height: 108px;
    }

    .home-promo-deals > .home-promo-card:nth-child(1),
    .home-promo-deals > .home-promo-card:nth-child(3) {
        margin-top: 0;
    }

    .home-promo-deals > .home-promo-card:nth-child(2) .home-promo-card__price {
        font-size: 5.525rem;
    }
}

/* แบนเนอร์มือถือใต้การ์ดโปร */
.home-mo-banner {
    padding: 0 0 12px !important;
    margin: 0 !important;
    width: 100% !important;
}

.home-mo-banner img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
}

/* ---- Marketplace (Taobao / Tmall / 1688) ---- */
.home-marketplace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 8px 0 20px;
}

.home-marketplace > div,
.home-marketplace .col-md-4,
.home-marketplace .col-sm-12,
.home-marketplace .col-xs-12 {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.home-marketplace img {
    width: 100%;
    height: auto;
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
    transition: transform 0.15s ease;
}

.home-marketplace a:hover img {
    transform: scale(1.02);
}

@media (min-width: 576px) {
    .home-marketplace {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}

/* ---- เรทหยวน ---- */
.home-rate-block {
    margin-bottom: 24px;
}

.home-rate-block .rate-home,
.home-rate-block .rate-home-mo {
    border-radius: var(--home-radius);
    overflow: hidden;
    box-shadow: var(--home-shadow);
}

.home-rate-block .rate-home {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: 200px;
    padding: 20px;
}

.home-rate-block .rate-home .col-md-4,
.home-rate-block .rate-home .col-md-8,
.home-rate-block .rate-home .col-md-6 {
    float: none !important;
    width: 100% !important;
    position: relative !important;
}

.home-rate-block .img-rate-home {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: min(200px, 40%);
    height: auto;
    margin: 0 auto;
    display: block;
}

.home-rate-block .quote-form-area {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    z-index: 1;
}

.home-rate-block .ratehome {
    position: relative !important;
    margin: 12px auto;
}

.home-rate-block .blog-rate {
    padding: 16px !important;
    text-align: center;
}

.home-rate-block .blog-rate h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.home-rate-block .btn-footer,
.home-rate-block .btn-footer2 {
    display: block;
    margin: 8px auto;
    max-width: 280px;
}

@media (min-width: 768px) {
    .home-rate-block .rate-home {
        flex-wrap: nowrap;
        padding: 24px 28px;
    }

    .home-rate-block .rate-home .col-md-4 {
        flex: 0 0 38%;
        width: 38% !important;
    }

    .home-rate-block .rate-home .col-md-8 {
        flex: 1 1 62%;
        width: 62% !important;
    }

    .home-rate-block .rate-home .col-md-6 {
        width: 50% !important;
        display: inline-block;
    }

    .home-rate-block .blog-rate {
        text-align: left;
        padding-top: 8% !important;
    }
}

/* mobile rate */
.home-rate-block--mo {
    text-align: center;
    padding: 16px 0;
}

.home-rate-block--mo .text-center[style*="left: -20px"] {
    left: 0 !important;
    top: 0 !important;
    position: relative !important;
}

.home-rate-block--mo .ratehome {
    position: relative !important;
    left: auto !important;
    margin: 12px auto !important;
    width: min(220px, 80%) !important;
}

.home-rate-block--mo .img-rate-home {
    position: relative !important;
    margin: 0 auto 12px;
}

.home-rate-block--mo .rate-home-mo {
    margin-top: 12px;
    padding: 16px;
}

/* ---- หมวดหมู่สินค้า ---- */
.home-category-grid .col-md-12 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100% !important;
}

.home-category-grid .col-md-1 {
    display: none !important;
}

.home-category-grid .col-md-2 {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.home-category-grid .img-category {
    width: 100%;
    max-width: 100px;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}

.home-category-grid .card.product-card {
    padding: 12px !important;
    border-radius: var(--home-radius);
}

@media (min-width: 576px) {
    .home-category-grid .col-md-12 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .home-category-grid .col-md-12 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 16px;
    }

    .home-category-grid .img-category {
        max-width: 115px;
    }
}

/* ---- สินค้า / บทความ carousel ---- */
.home .home-section .product-card {
    border-radius: var(--home-radius);
    border: none;
    box-shadow: var(--home-shadow);
}

.home .home-section .img-respon-mobile {
    width: 100% !important;
    height: auto !important;
    max-width: 194px;
    aspect-ratio: 1;
    object-fit: cover;
}

.home-featured-products {
    padding-top: 1rem;
}

.home-featured-products__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1rem;
}

.home-featured-products__header .head-title {
    margin-bottom: 0;
}

.home-featured-products__link {
    display: inline-flex;
    align-items: center;
    color: var(--home-accent);
    font: 500 0.95rem 'Prompt', sans-serif;
    text-decoration: none;
    white-space: nowrap;
}

.home-featured-products__link:hover,
.home-featured-products__link:focus {
    color: var(--home-accent-2);
    text-decoration: none;
}

.home-featured-products__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.home-featured-products__item {
    min-width: 0;
}

.home-featured-products__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

.home-featured-products__image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    overflow: hidden;
}

.home-featured-products__image {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    display: block;
    object-fit: cover;
}

.home-featured-products__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.home-featured-products__title {
    height: auto !important;
    min-height: 2.8em;
    margin: 0;
    overflow: hidden;
    word-break: break-word;
}

.home-featured-products__title a {
    display: -webkit-box;
    color: #333;
    font: 500 0.95rem/1.45 'Prompt', sans-serif;
    text-decoration: none;
    overflow: hidden;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.home-featured-products__title a:hover,
.home-featured-products__title a:focus {
    color: var(--home-accent);
    text-decoration: none;
}

.home-featured-products__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.home-featured-products__price {
    font-size: 1rem;
    font-weight: 700;
}

.home-featured-products__sales {
    color: #6b7280;
    font-size: 0.85rem;
}

.home-featured-products__empty {
    padding: 18px 16px;
    border-radius: var(--home-radius);
    background: #fff7f4;
    color: var(--home-accent);
    text-align: center;
    box-shadow: var(--home-shadow);
}

.home .home-section .btn-home {
    max-width: 320px;
    margin: 16px auto;
    border-radius: var(--home-radius);
    min-height: 52px;
}

.home .home-cta-row {
    display: flex;
    justify-content: center;
    padding: 8px 0 24px;
}

.home .home-cta-row .col-md-4:empty {
    display: none;
}

@media (min-width: 768px) {
    .home-featured-products__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .home-featured-products__body {
        padding: 14px;
    }
}

@media (min-width: 1200px) {
    .home-featured-products__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .home-featured-products__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-featured-products__link {
        font-size: 0.88rem;
    }
}

/* ---- ติดต่อ / contact ---- */
.home .contact-home {
    border-radius: var(--home-radius);
    height: auto !important;
    min-height: 280px;
    padding: 20px;
}

.home .contact-home .col-md-3,
.home .contact-home .col-md-4 {
    float: none !important;
    width: 100% !important;
    margin-bottom: 16px;
    text-align: center !important;
}

@media (min-width: 768px) {
    .home .contact-home {
        padding: 28px;
    }

    .home .contact-home .blog-rate {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
        text-align: left;
    }

    .home .contact-home .col-md-3,
    .home .contact-home .col-md-4 {
        width: auto !important;
    }
}

/* ---- ซ่อนส่วนซ้ำ / legacy ---- */
.home .home-section--dup-market {
    display: none !important;
}

.home .home-seo-title {
    font-size: 1rem;
    color: #888;
    font-weight: 500;
    margin: 24px 0 8px;
    text-align: center;
}

/* ล้าง inline grid ที่ทำให้ icon กระจัดกระจาย */
.home .home-nav-icons [style*="display: flex"] {
    display: contents !important;
}

.home-layout-draft-preview-banner {
    margin: 0 0 12px;
    padding: 10px 14px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9a3412;
    background: #ffedd5;
    border: 1px solid #fdba74;
    border-radius: 8px;
}

.home-layout-draft-preview-banner--error {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}

.home-layout-draft-preview-order {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.95;
}

.home-layout-draft-preview-empty,
.home-layout-published-empty {
    margin: 24px auto;
    max-width: var(--home-max, 1200px);
    padding: 32px 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.home-module-shortcut-promo {
    width: 100%;
    min-height: 48px;
}

.hl-home-section[data-home-module="shortcut_promo"]:empty,
.hl-home-section[data-home-module="marketplace_strip"]:empty {
    display: none;
}

.home-shortcut-empty-hint {
    grid-column: 1 / -1;
    margin: 0;
    padding: 8px 0;
    font-size: 0.78rem;
    text-align: center;
}

/* พรีวิวหลังบ้าน: บังคับให้มีชั้น shortcut มองเห็น (ไม่โดน media + variant ซ่อนหมด) */
body.hl-admin-embed .home-module-shortcut-promo .home-show-dt {
    display: block !important;
}

body.hl-admin-embed .home-module-shortcut-promo .home-show-mo {
    display: none !important;
}

@media (max-width: 1199.98px) {
    body.hl-admin-embed .home-module-shortcut-promo .home-show-dt {
        display: none !important;
    }

    body.hl-admin-embed .home-module-shortcut-promo .home-show-mo {
        display: block !important;
    }
}

/* พรีวิวใน iframe หลังบ้าน — ซ่อนเฉพาะ widget ลอยที่รบกวนการแก้หน้า
   แต่คง shell จริงของ storefront ไว้ให้ใกล้ live มากที่สุด */
body.hl-admin-embed #sy-whatshelp,
body.hl-admin-embed .btn-scroll-top,
body.hl-admin-embed #non-printable.btn-scroll-top,
body.hl-admin-embed [id^="omni-livechat"],
body.hl-admin-embed .omni-livechat-widget,
body.hl-admin-embed .olc-widget-root {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.hl-admin-embed {
    /* padding-bottom: 24px !important; */
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100%;
}

body.hl-admin-embed .profile-page,
body.hl-admin-embed .home,
body.hl-admin-embed #wrapper,
body.hl-admin-embed main {
    overflow: visible !important;
}

body.hl-admin-embed .py-2 {
    padding-bottom: 0.5rem !important;
}

/* shortcut_promo behavior variants */
.home .hl-module--shortcut-promo .hl-shortcut-carousel {
    position: relative;
}

.home .hl-module--shortcut-promo .hl-shortcut-carousel__viewport {
    overflow: visible;
}

.home .hl-module--shortcut-promo-slider .hl-shortcut-carousel__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    padding: 2px;
    margin: -2px;
}

.home .hl-module--shortcut-promo-slider .hl-shortcut-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.home .hl-module--shortcut-promo-slider .hl-shortcut-carousel.is-dragging .hl-shortcut-carousel__viewport {
    cursor: grabbing;
    scroll-behavior: auto;
}

.home .hl-module--shortcut-promo .hl-shortcut-carousel__control {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.96);
    color: #e2512b;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    transform: translateY(-50%);
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.home .hl-module--shortcut-promo .hl-shortcut-carousel__control--prev {
    left: -8px;
}

.home .hl-module--shortcut-promo .hl-shortcut-carousel__control--next {
    right: -8px;
}

.home .hl-module--shortcut-promo .hl-shortcut-carousel__control:hover {
    transform: translateY(-50%) scale(1.04);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
}

.home .hl-module--shortcut-promo .hl-shortcut-carousel__control[disabled] {
    opacity: 0.34;
    box-shadow: none;
    cursor: default;
}

.home .hl-module--shortcut-promo-slider .home-nav-icons {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    width: max-content;
    min-width: 100%;
    max-width: none !important;
    padding: 12px 2px 10px;
}

.home .hl-module--shortcut-promo-slider .home-nav-icons .col-md-1,
.home .hl-module--shortcut-promo-slider .home-nav-icons .col-md-2,
.home .hl-module--shortcut-promo-slider .home-nav-icons .col-xs-1,
.home .hl-module--shortcut-promo-slider .home-nav-icons > div,
.home .hl-module--shortcut-promo-slider .home-nav-icons > a {
    flex: 0 0 clamp(78px, 24vw, 92px);
    max-width: none;
}

.home .hl-module--shortcut-promo-slider .home-promo-deals {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 12px;
    width: max-content !important;
    min-width: 100%;
    max-width: none !important;
    padding: 8px 2px 18px;
    align-items: stretch;
}

.home .hl-module--shortcut-promo-slider .home-promo-deals > .home-promo-card {
    flex: 0 0 min(84vw, 320px);
    margin-top: 0 !important;
}

.home .hl-module--shortcut-promo-slider .home-promo-deals > .home-promo-card:nth-child(1),
.home .hl-module--shortcut-promo-slider .home-promo-deals > .home-promo-card:nth-child(2),
.home .hl-module--shortcut-promo-slider .home-promo-deals > .home-promo-card:nth-child(3) {
    margin-top: 0;
}

.home .hl-module--shortcut-promo-slider .home-promo-deals > .home-promo-card:nth-child(1) .home-promo-card__main,
.home .hl-module--shortcut-promo-slider .home-promo-deals > .home-promo-card:nth-child(2) .home-promo-card__main,
.home .hl-module--shortcut-promo-slider .home-promo-deals > .home-promo-card:nth-child(3) .home-promo-card__main {
    min-height: 118px;
}

@media (min-width: 768px) {
    .home .hl-module--shortcut-promo-slider .home-nav-icons {
        gap: 14px;
    }

    .home .hl-module--shortcut-promo-slider .home-nav-icons .col-md-1,
    .home .hl-module--shortcut-promo-slider .home-nav-icons .col-md-2,
    .home .hl-module--shortcut-promo-slider .home-nav-icons .col-xs-1,
    .home .hl-module--shortcut-promo-slider .home-nav-icons > div,
    .home .hl-module--shortcut-promo-slider .home-nav-icons > a {
        flex-basis: clamp(86px, 16vw, 102px);
    }

    .home .hl-module--shortcut-promo-slider .home-promo-deals > .home-promo-card {
        flex-basis: min(46vw, 360px);
    }
}

@media (min-width: 1200px) {
    .home .hl-module--shortcut-promo-slider .home-nav-icons {
        gap: 16px;
        padding-bottom: 12px;
    }

    .home .hl-module--shortcut-promo-slider .home-promo-deals {
        gap: 16px;
        padding-bottom: 24px;
    }

    .home .hl-module--shortcut-promo-slider .home-promo-deals > .home-promo-card {
        flex-basis: min(30vw, 360px);
    }
}

.home .hl-module--shortcut-promo .hl-shortcut-panel--nav .hl-shortcut-carousel:not(.is-scrollable) .hl-shortcut-carousel__viewport {
    display: flex;
    justify-content: center;
}

.home .hl-module--shortcut-promo .hl-shortcut-panel--nav .hl-shortcut-carousel:not(.is-scrollable) .home-nav-icons {
    width: fit-content;
    min-width: 0;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

.home .hl-module--shortcut-promo .hl-shortcut-panel--nav .hl-shortcut-carousel:not(.is-scrollable) .home-nav-icons--dt {
    grid-template-columns: repeat(var(--hl-shortcut-nav-count-compact, 5), minmax(72px, 88px));
}

@media (max-width: 1199.98px) {
    .home .hl-module--shortcut-promo-fixed .home-nav-icons > .col-md-1:nth-child(n+6),
    .home .hl-module--shortcut-promo-fixed .home-nav-icons > .col-md-2:nth-child(n+6),
    .home .hl-module--shortcut-promo-fixed .home-nav-icons > .col-xs-1:nth-child(n+6),
    .home .hl-module--shortcut-promo-fixed .home-nav-icons > div:nth-child(n+6),
    .home .hl-module--shortcut-promo-fixed .home-nav-icons > a:nth-child(n+6) {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .home .hl-module--shortcut-promo .hl-shortcut-panel--nav .hl-shortcut-carousel:not(.is-scrollable) .home-nav-icons--dt {
        grid-template-columns: repeat(var(--hl-shortcut-nav-count-compact, 5), minmax(78px, 98px));
    }
}

@media (min-width: 1200px) {
    .home .hl-module--shortcut-promo .hl-shortcut-panel--nav .hl-shortcut-carousel:not(.is-scrollable) .home-nav-icons--dt {
        grid-template-columns: repeat(var(--hl-shortcut-nav-count-desktop, 10), minmax(78px, 96px));
    }
}
