
        :root { --ease-ios: cubic-bezier(0.16, 1, 0.3, 1); }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
            background-color: #f1f5f9;
            -webkit-font-smoothing: antialiased;
        }
        .makro-red { background-color: #9b0707; }
        .makro-red-text { color: #9b0707; }

        .slider-container { overflow: hidden; position: relative; }
        .slider-track { display: flex; transition: transform 0.6s var(--ease-ios); }
        .slider-slide { min-width: 100%; box-sizing: border-box; }

        .product-carousel {
            display: flex; gap: 1rem; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none;
            scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
            padding: 12px 6px 26px; margin: -12px -6px -14px;
        }
        .product-carousel::-webkit-scrollbar { display: none; }
        .snap-item { scroll-snap-align: start; }

        .ios-card {
            position: relative; overflow: hidden;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
            border: 1px solid rgba(226, 232, 240, 0.8);
            border-radius: 28px;
            box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
            transition: transform 0.4s var(--ease-ios), box-shadow 0.4s var(--ease-ios), background 0.4s var(--ease-ios);
        }
        .ios-card:hover:not(.out-of-stock) {
            transform: scale(1.02) translateY(-4px);
            box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
            background: #fff;
        }
        .ios-card.out-of-stock img.ios-zoom { filter: grayscale(1); opacity: .55; }

        #sidebarWrapper {
            width: 270px;
            transition: width 0.4s var(--ease-ios), transform 0.4s var(--ease-ios), opacity 0.3s ease;
            overflow: hidden;
            flex-shrink: 0;
        }
        #sidebarWrapper.collapsed {
            width: 0px !important;
            transform: translateX(-100%);
            opacity: 0;
            margin-right: 0 !important;
            padding: 0 !important;
            border: none !important;
            pointer-events: none;
        }

        .rotate-arrow { transition: transform 0.4s var(--ease-ios); }
        .rotate-arrow.is-active { transform: rotate(180deg); }

        .nav-dropdown {
            position: absolute; right: 0; top: 100%; padding-top: 12px;
            opacity: 0; visibility: hidden; transform: translateY(12px) scale(0.95);
            transition: opacity 0.3s ease, transform 0.35s var(--ease-ios), visibility 0.3s;
            pointer-events: none; z-index: 60;
        }
        .group:hover .nav-dropdown,
        .group:focus-within .nav-dropdown {
            opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto;
        }

        .ios-zoom { transition: transform 0.6s ease, filter .3s ease, opacity .3s ease; }
        .ios-card .ios-zoom{display:block;max-width:100%;max-height:100%;object-fit:contain;object-position:center;}
        .ios-card>div.relative:has(>img.ios-zoom){background:#fff;}
        @media(max-width:767px){.ios-card{padding:10px!important}.ios-card>div.relative:has(>img.ios-zoom){height:175px!important;margin-bottom:8px!important}.ios-card .ios-zoom{width:100%;height:100%}}
        .ios-card:hover:not(.out-of-stock) .ios-zoom { transform: scale(1.08); }

        .ios-nav-btn {
            width: 40px; height: 40px; border-radius: 50%; border: none; background: #fff; color: #475569;
            display: flex; align-items: center; justify-content: center; cursor: pointer;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .ios-nav-btn:hover { transform: scale(1.08); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); }
        .ios-nav-btn:active { transform: scale(0.92); }

        .ios-gradient-title {
            background: linear-gradient(135deg, #0f172a 30%, #475569 100%);
            -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
        }
        .ios-search { transition: all 0.3s ease; }
        .ios-search:focus { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25); }

        .marquee-container { display: inline-block; white-space: nowrap; animation: marqueeScroll 22s linear infinite; }
        .marquee-container:hover { animation-play-state: paused; }
        @keyframes marqueeScroll { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
        @media (prefers-reduced-motion: reduce) {
            .marquee-container { animation: none; }
            .slider-track, .product-carousel { transition: none; scroll-behavior: auto; }
        }

        .ios-toast {
            position: fixed; left: 50%; z-index: 70; pointer-events: none;
            bottom: 30px; transform: translateX(-50%) translateY(100px); opacity: 0;
            background: rgba(15, 23, 42, 0.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            color: #fff; padding: 14px 28px; border-radius: 32px;
            display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            transition: transform 0.5s var(--ease-ios), opacity 0.3s ease;
            max-width: calc(100vw - 32px);
        }
        .ios-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
        @media (max-width: 767px) {
            .ios-toast { bottom: calc(84px + env(safe-area-inset-bottom)); padding: 12px 20px; }
        }

        #productModal { transition: opacity 0.3s ease; }
        #productModalContent { transition: transform 0.4s var(--ease-ios), opacity 0.3s ease; }

        .fab-contact-wrapper { position: fixed; right: 20px; bottom: 85px; z-index: 45; }
        @media (min-width: 768px) { .fab-contact-wrapper { bottom: 30px; } }
        .fab-main-btn {
            width: 56px; height: 56px; border-radius: 50%; background: #9b0707; color: #fff;
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 10px 30px rgba(155, 7, 7, 0.4); cursor: pointer;
            border: 2px solid rgba(255,255,255,0.3);
            transition: transform 0.3s var(--ease-ios), box-shadow 0.3s ease;
            position: relative; overflow: hidden;
        }
        .fab-main-btn:hover { transform: scale(1.08); box-shadow: 0 15px 35px rgba(155, 7, 7, 0.6); }
        .fab-main-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
        .fab-popup-menu {
            position: absolute; right: 6px; bottom: 68px; display: flex; flex-direction: column; gap: 10px;
            opacity: 0; visibility: hidden; transform: translateY(15px) scale(0.9);
            transition: all 0.3s var(--ease-ios); pointer-events: none;
        }
        .fab-contact-wrapper:hover .fab-popup-menu,
        .fab-contact-wrapper.active .fab-popup-menu {
            opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto;
        }
        .fab-sub-btn {
            width: 44px; height: 44px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center; color: #fff;
            box-shadow: 0 5px 15px rgba(0,0,0,0.15); transition: transform 0.2s ease; text-decoration: none;
        }
        .fab-sub-btn:hover { transform: scale(1.12); }

        #scrollTopBtn {
            position: fixed; right: 86px; bottom: 85px; z-index: 45;
            width: 48px; height: 48px; border-radius: 50%;
            background: rgba(15, 23, 42, 0.85);
            backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
            color: #fff; border: none; display: flex; align-items: center; justify-content: center;
            box-shadow: 0 8px 25px rgba(0,0,0,0.15);
            opacity: 0; visibility: hidden; transform: translateY(15px) scale(0.8);
            transition: all 0.3s var(--ease-ios); cursor: pointer;
        }
        @media (min-width: 768px) { #scrollTopBtn { bottom: 30px; right: 88px; } }
        #scrollTopBtn.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
        #scrollTopBtn:hover { transform: scale(1.1) translateY(-3px); background: #0f172a; }

        @keyframes cartPop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
        .cart-pop { animation: cartPop .4s ease; }

        /* ===== Mobile / Touch ===== */
        html { -webkit-text-size-adjust: 100%; }
        body { -webkit-tap-highlight-color: transparent; }
        button, a, input, label { touch-action: manipulation; }
        .no-scrollbar { scrollbar-width: none; }
        .no-scrollbar::-webkit-scrollbar { display: none; }
        .product-carousel { scroll-padding-left: 6px; overscroll-behavior-x: contain; }

        /* ช่องค้นหามือถือ: ซ่อนเมื่อเลื่อนลง แสดงเมื่อเลื่อนขึ้น */
        #mobileSearchRow { max-height: 70px; overflow: hidden; transition: max-height .3s ease, opacity .25s ease, padding .3s ease; }
        #mobileSearchRow.is-hidden { max-height: 0; opacity: 0; padding-bottom: 0; }

        /* อุปกรณ์สัมผัส: ไม่มี hover ค้างหลังแตะ */
        @media (hover: none) {
            .ios-card:hover:not(.out-of-stock) { transform: none; box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04); }
            .ios-card:hover:not(.out-of-stock) .ios-zoom { transform: none; }
            .ios-card:active:not(.out-of-stock) { transform: scale(0.98); }
            .fab-contact-wrapper:hover .fab-popup-menu { opacity: 0; visibility: hidden; transform: translateY(15px) scale(0.9); pointer-events: none; }
            .fab-contact-wrapper.active .fab-popup-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }
        }

        @media (max-width: 767px) {
            .ios-card { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
            input, select, textarea { font-size: 16px !important; } /* กัน iOS ซูมเองตอนแตะช่องกรอก */
            .ios-nav-btn { display: none; }                         /* มือถือใช้ปัดแทนปุ่มลูกศร */
            .fab-contact-wrapper, #scrollTopBtn { bottom: calc(80px + env(safe-area-inset-bottom)); right: 16px; }
            #scrollTopBtn { right: 82px; }

            /* Popup เป็นแผงเลื่อนขึ้นจากด้านล่าง */
            #productModal { align-items: flex-end; padding: 0; }
            #productModalContent { border-radius: 28px 28px 0 0; max-width: none; max-height: 92vh; max-height: 92dvh; overscroll-behavior: contain; }
            #productModalContent.scale-95 { transform: translateY(48px); }
            #productModal .sheet-footer { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
        }
        

        /* Mobile-first: logo / search / notification / cart / menu on one row */
        .mobile-top-search{height:39px;min-width:0;flex:1;display:flex;align-items:center;gap:7px;padding:0 10px;border:1px solid rgba(255,255,255,.28);border-radius:14px;background:rgba(255,255,255,.16);color:#fff}
        .mobile-top-search input{width:100%;min-width:0;background:transparent;color:#fff;border:0;outline:0;font-size:16px}
        .mobile-top-search input::placeholder{color:rgba(255,255,255,.78)}
        .mobile-top-icon{width:30px;height:36px;display:grid;place-items:center;color:#fff;font-size:19px}
        .mobile-slide-panel{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows .35s cubic-bezier(.2,.8,.2,1),opacity .25s ease;background:#910707;border-top:1px solid #ffffff25;box-shadow:0 12px 20px #33000015}
        .mobile-slide-panel.open{grid-template-rows:1fr;opacity:1}
        .mobile-panel-inner{min-height:0;overflow:hidden;padding:0 14px;transition:padding .3s}
        .mobile-slide-panel.open .mobile-panel-inner{padding:13px 14px 17px}
        .mobile-link-grid{display:flex;align-items:center;gap:9px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch}.mobile-link-grid::-webkit-scrollbar{display:none}
        .mobile-link-grid a{flex:0 0 auto;white-space:nowrap;scroll-snap-align:start;color:#fff;font-size:12px;font-weight:700;padding:10px 13px;border-radius:13px;background:#ffffff1c;display:inline-flex;align-items:center;gap:7px;min-height:42px}
        .mobile-category-trigger-row{display:flex;align-items:center;gap:7px;padding:0 12px 9px}
        .mobile-category-trigger-row button{flex:1;min-height:38px;border:1px solid #ffffff45;background:#ffffff19;border-radius:13px;color:#fff;font-weight:700;font-size:13px;display:flex;align-items:center;justify-content:center;gap:8px}
        .mobile-category-trigger-row button[aria-expanded=true]{background:#fff;color:#9b0707}
        .mobile-category-trigger-row .category-chevron{font-size:10px;transition:transform .2s}
        .mobile-category-trigger-row button[aria-expanded=true] .category-chevron{transform:rotate(180deg)}
        .mobile-category-grid{display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:thin;-webkit-overflow-scrolling:touch;padding:2px 1px 10px}
        .mobile-category-item{flex:0 0 clamp(130px,42vw,190px);scroll-snap-align:start;border-radius:12px;background:#fff;overflow:hidden;display:block;padding:5px;box-shadow:0 3px 12px #0000000e}
        .mobile-category-item img{display:block;width:100%;aspect-ratio:2.4;object-fit:contain;background:#fff;border-radius:8px}
        .mobile-cat-placeholder{display:grid;place-items:center;aspect-ratio:2.4;width:100%;color:#a51520;background:#fff3f3}
        .mobile-all-categories{display:flex;justify-content:center;gap:8px;margin-top:11px;color:white;font-size:13px;font-weight:750}
        @media(max-width:767px){.store-logo-link img{height:auto!important;width:clamp(87px,26vw,130px);max-height:37px}.mobile-header-row{gap:7px!important}.mobile-header-actions{gap:8px!important}.mobile-header-actions .relative.group>a{min-width:25px;min-height:32px;justify-content:center}.mobile-header-actions #cartCountBadge{top:-8px;right:-7px;font-size:10px}.mobile-promo-collapsed{display:none!important}.mobile-promo-collapsed.mobile-promo-open{display:block!important}.mobile-promo-open{border-radius:16px!important}.mobile-promo-open .slider-slide{aspect-ratio:3/1.1!important}body{overflow-x:hidden}}
        @media(max-width:385px){.store-logo-link img{width:78px}.mobile-header-actions{gap:5px!important}.mobile-top-search{padding:0 7px}.mobile-category-trigger-row button{font-size:12px}}
        @media(min-width:768px){.mobile-top-search,.mobile-top-icon{display:none!important}}
        @media(prefers-reduced-motion:reduce){.mobile-slide-panel,.mobile-panel-inner,.category-chevron{transition:none!important}}
    
/* Page-only refinements */
body {font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Helvetica Neue",Helvetica,Arial,sans-serif}
@media(min-width:1280px){.ss-index-grid {grid-template-columns:repeat(6,minmax(0,1fr))}}
.ss-count.cart-pop{animation:cartPop .4s ease}
.product-carousel{scrollbar-width:none}
#productModal{z-index:250!important}
.ios-toast{z-index:260!important}
#topBannerBox{isolation:isolate}
@media(min-width:768px){.ios-card .ios-zoom{object-fit:contain}}

/* ============================================
   SOMSRI INDEX — COMPACT LAYOUT
   Sticky Category + iOS 26
============================================ */

:root {
    --ss-header-height: 110px;
    --ss-space: 12px;
    --ss-brand: #9b0707;
    --ss-ease: cubic-bezier(.16, 1, .3, 1);
}

/* คุมความกว้างทั้งหน้า */
body {
    overflow-x: clip;
}

/* Container หลัก */
body > div.max-w-\[1800px\] {
    padding-top: 12px !important;
    padding-bottom: 14px !important;
    row-gap: 14px !important;
}

/* ระยะระหว่าง Sidebar กับ Main */
#sidebarWrapper {
    flex-shrink: 0;
}

#sidebarWrapper > div {
    gap: 8px !important;
}

/* ระยะระหว่างส่วนสินค้า */
main.space-y-7 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 14px !important;
}

/* ลดช่องว่างหัวข้อสินค้า */
main section.space-y-3 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 8px !important;
}

/* ============================================
   STICKY CATEGORY BUTTON
============================================ */

.ss-category-sticky {
    position: sticky !important;
    top: calc(var(--ss-header-height) + 12px);
    z-index: 950;

    flex: 0 0 44px;
    width: 44px;
    height: 44px;

    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255,255,255,.35);
    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #b90b0b 0%,
            #9b0707 60%,
            #700303 100%
        );

    color: white;
    cursor: pointer;

    box-shadow:
        0 8px 22px rgba(155,7,7,.25),
        inset 0 1px 0 rgba(255,255,255,.25);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
        transform .3s var(--ss-ease),
        box-shadow .3s ease;
}

.ss-category-sticky:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 28px rgba(155,7,7,.35);
}

.ss-category-sticky:active {
    transform: scale(.95);
}

.ss-category-sticky > i {
    font-size: 15px;
    transition: transform .3s var(--ss-ease);
}

/* Tooltip */
.ss-category-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;

    transform: translateY(-50%) translateX(-5px);

    padding: 9px 14px;
    border-radius: 12px;

    background: rgba(35,35,45,.92);
    color: white;

    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: all .2s ease;
}

.ss-category-sticky:hover .ss-category-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* ============================================
   CATEGORY SIDEBAR
============================================ */

#sidebarWrapper {
    width: 264px;
    opacity: 1;

    transition:
        width .4s var(--ss-ease),
        opacity .3s ease;
}

#sidebarWrapper.collapsed {
    width: 0 !important;
    opacity: 0;
    pointer-events: none;
}

#sidebarWrapper .rounded-2xl {
    border-radius: 16px;
}

/* หมวดหมู่ชิดกัน */
#sidebarWrapper a {
    line-height: 1.35;
}

#sidebarWrapper .space-y-3 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 7px !important;
}

/* ============================================
   PRODUCT CARDS
============================================ */

.product-carousel {
    gap: 10px !important;
    padding: 5px 2px 12px !important;
    margin: 0 !important;
}

/* การ์ดสินค้ากระชับ */
.ios-card.snap-item {
    padding: 10px !important;
    border-radius: 19px !important;
}

/* รูปสินค้า */
.ios-card.snap-item .ios-zoom {
    object-fit: contain;
    width: 100%;
    height: 100%;
}

/* รายละเอียดสินค้า */
.ios-card.snap-item h3 {
    margin-top: 4px !important;
    line-height: 1.4;
}

.ios-card.snap-item .pt-3 {
    padding-top: 7px !important;
}

/* ============================================
   RECOMMENDED GRID + LOAD MORE
============================================ */

#recommendedGrid {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px !important;
    align-items: stretch;
}

#recommendedGrid .ios-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

/* ปุ่มโหลดเพิ่ม */
#recommendedLoadMore {
    margin-top: 12px !important;
    border-radius: 17px;
    transition: transform .25s var(--ss-ease);
}

#recommendedLoadMore:hover {
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 1399px) {
    #recommendedGrid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1199px) {
    #recommendedGrid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    #recommendedGrid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #sidebarWrapper,
    #sidebarOpenBtn {
        display: none !important;
    }
}

@media (max-width: 767px) {
    body > div.max-w-\[1800px\] {
        padding: 10px !important;
        row-gap: 10px !important;
    }

    main.space-y-7 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 11px !important;
    }

    #recommendedGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px !important;
    }

    .product-carousel {
        gap: 8px !important;
    }

    .ios-card.snap-item {
        padding: 8px !important;
        border-radius: 16px !important;
    }

    .ss-category-tooltip {
        display: none;
    }
}
