/* Global: Force overflow visible untuk carousel arrows - TARGET SELANGKAO */
/* Section dengan kelas py-6 (section kategori) */
section.py-6 {
    overflow: visible;
}

/* Wrapper inside section kategori */
section.py-6 .w-full {
    overflow: visible;
}

/* Slider Hero */
.slide.active {
    opacity: 1 !important;
}

/* Navbar Hover Underline Animation */
.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background-color: white;
    transition: width 0.3s ease-in-out;
}

.nav-link:hover::after {
    width: 100%;
}

/* Navbar Dropdown Menu Styles */
.navbar-menu > li {
    position: relative;
}

/* Ensure dropdown is visible and not clipped */
.navbar-menu {
    position: relative;
    z-index: 40;
}

/* Ensure navbar container allows overflow for dropdown */
nav.bg-blue-600 {
    overflow: visible !important;
}

nav.bg-blue-600 > div {
    overflow: visible !important;
}

/* Dropdown scrollbar styling */
.navbar-menu > li > div[x-cloak] + div,
.navbar-menu > li > div[style*="display: none"] + div,
.navbar-menu > li > div.max-h-80 {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.navbar-menu > li > div.max-h-80::-webkit-scrollbar {
    width: 6px;
}

.navbar-menu > li > div.max-h-80::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.navbar-menu > li > div.max-h-80::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.navbar-menu > li > div.max-h-80::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================== */
/* CATEGORY HORIZONTAL CAROUSEL STYLES (Alibaba Style) */
/* ========================================== */
.category-carousel-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding: 0.5rem 0;
    margin: 0;
    padding-left: 1rem; /* Space for left arrow - prevent circle cut */
    padding-right: 1rem; /* Space for right arrow - prevent circle cut */
}

/* Mobile: hide arrows, remove padding */
@media (max-width: 640px) {
    .category-carousel-wrapper {
        padding-left: 0;
        padding-right: 0;
    }
}

.category-carousel-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

#categoryCarouselTrack {
    display: flex;
    gap: 0;
    padding: 0.25rem 0;
    width: max-content;
}

.category-item-carousel {
    flex-shrink: 0;
    margin-right: 1rem; /* Consistent gap: 16px */
}

.category-item-carousel:last-child {
    margin-right: 0;
    padding-right: 0.5rem; /* Padding akhir untuk spacing dari panah */
}

/* Mobile spacing - lebih rapat */
@media (max-width: 640px) {
    .category-item-carousel {
        margin-right: 0.875rem; /* 14px - konsisten */
    }
    
    .category-item-carousel:last-child {
        padding-right: 0.5rem;
    }
}

/* Tablet spacing */
@media (min-width: 641px) and (max-width: 1024px) {
    .category-item-carousel {
        margin-right: 1rem; /* 16px - konsisten */
    }
}

/* Desktop spacing */
@media (min-width: 1025px) {
    .category-item-carousel {
        margin-right: 1.25rem; /* 20px - konsisten */
    }
}

.category-item-carousel {
    transition: none; /* No transition on container */
    text-decoration: none;
}

.category-item-carousel:hover {
    /* Absolutely no movement - only child elements can animate */
    transform: none;
}

.category-item-carousel:active {
    transform: none;
}

/* Ensure circle container and text don't move at all */
.category-item-carousel > div:first-child {
    transform: none !important;
    will-change: auto;
}

.category-item-carousel > div:first-child > div {
    transform: none !important;
    will-change: auto;
}

.category-item-carousel > h6 {
    transform: none !important;
    will-change: auto;
}

/* Only allow image inside circle to scale */
.category-item-carousel img {
    transition: transform 0.2s ease;
    will-change: transform;
}

.category-scroll-btn {
    opacity: 0.5; /* Sama seperti produk terlaris (opacity-50) */
    transition: opacity 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    /* Fix position - prevent movement on hover */
    will-change: opacity, background-color;
}

/* High specificity untuk override Tailwind - Sama seperti produk terlaris */
/* Pastikan seluruh area button (termasuk ujung luar card) memiliki warna yang sama */
/* Hover dan Active state - biru solid saat hover/klik, kembali abu saat tidak */
.category-scroll-btn:hover,
.category-scroll-btn:active,
.category-scroll-left:hover,
.category-scroll-left:active,
.category-scroll-right:hover,
.category-scroll-right:active,
button.category-scroll-btn:hover,
button.category-scroll-btn:active,
button.category-scroll-left:hover,
button.category-scroll-left:active,
button.category-scroll-right:hover,
button.category-scroll-right:active,
.bg-white .category-scroll-btn:hover,
.bg-white .category-scroll-btn:active,
.bg-white .category-scroll-left:hover,
.bg-white .category-scroll-left:active,
.bg-white .category-scroll-right:hover,
.bg-white .category-scroll-right:active,
/* Tambahan untuk memastikan seluruh area button ter-cover */
button.category-scroll-btn.bg-black\/70:hover,
button.category-scroll-btn.bg-black\/70:active,
button.category-scroll-left.bg-black\/70:hover,
button.category-scroll-left.bg-black\/70:active,
button.category-scroll-right.bg-black\/70:hover,
button.category-scroll-right.bg-black\/70:active,
button.category-scroll-btn.hover\:bg-blue-600:hover,
button.category-scroll-btn.hover\:bg-blue-600:active,
button.category-scroll-left.hover\:bg-blue-600:hover,
button.category-scroll-left.hover\:bg-blue-600:active,
button.category-scroll-right.hover\:bg-blue-600:hover,
button.category-scroll-right.hover\:bg-blue-600:active,
button.bg-black\/70.hover\:bg-blue-600.category-scroll-btn:hover,
button.bg-black\/70.hover\:bg-blue-600.category-scroll-btn:active,
button.bg-black\/70.hover\:bg-blue-600.category-scroll-left:hover,
button.bg-black\/70.hover\:bg-blue-600.category-scroll-left:active,
button.bg-black\/70.hover\:bg-blue-600.category-scroll-right:hover,
button.bg-black\/70.hover\:bg-blue-600.category-scroll-right:active {
    opacity: 1 !important;
    background-color: #2563eb !important; /* Blue-600 - sama seperti produk terlaris */
    background: #2563eb !important; /* Fallback untuk browser lama - SOLID */
    /* Hilangkan semua transparansi */
    filter: none !important;
    -webkit-background-color: #2563eb !important;
    -moz-background-color: #2563eb !important;
    background-image: none !important;
    /* Keep transform fixed - do not change transform on hover */
    /* transform is set inline, don't override it */
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

/* Override Tailwind hover class dengan specificity tinggi */
button.category-scroll-btn.hover\:bg-blue-400:hover,
button.category-scroll-left.hover\:bg-blue-400:hover,
button.category-scroll-right.hover\:bg-blue-400:hover,
.category-scroll-btn.hover\:bg-blue-400:hover,
.category-scroll-left.hover\:bg-blue-400:hover,
.category-scroll-right.hover\:bg-blue-400:hover {
    background-color: #60a5fa !important;
    background: #60a5fa !important;
}

.category-scroll-btn[style*="opacity: 0.3"] {
    cursor: not-allowed;
}

/* Show buttons on all screen sizes */
/* Default state - abu (transparan), hanya biru saat hover/active */
.category-scroll-btn {
    display: flex;
    visibility: visible;
    z-index: 30;
    position: absolute;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    /* Default: bg-black/70 dengan opacity-50 = abu transparan */
    /* Biarkan bg-black/70 dari Tailwind bekerja, jangan override background-color */
}

/* Pastikan setelah touch end, button kembali ke default state (abu) */
/* Style inline dari JavaScript akan dihapus oleh ontouchend handler */

/* Jangan override Tailwind opacity classes - biarkan opacity-50 bekerja */
/* Hapus override ini agar opacity-50 dari Tailwind bisa bekerja */

.category-carousel-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Mobile devices - make buttons clearly visible and tappable */
@media (max-width: 640px) {
    .category-scroll-btn,
    .category-scroll-left,
    .category-scroll-right,
    button.category-scroll-btn,
    button.category-scroll-left,
    button.category-scroll-right,
    button.category-scroll-btn.z-30,
    button.category-scroll-left.z-30,
    button.category-scroll-right.z-30 {
        display: flex !important;
        visibility: visible !important;
        opacity: 0.5 !important; /* Sama seperti produk terlaris */
        width: 24px !important; /* w-6 sama seperti desktop */
        height: 64px !important; /* h-16 sama seperti desktop */
        min-width: 24px !important;
        min-height: 64px !important;
        max-width: 24px !important;
        max-height: 64px !important;
        z-index: 40 !important; /* Lebih rendah dari navbar (z-50) agar tertutup saat scroll - override z-30 dari HTML dan JavaScript */
        background-color: rgba(0, 0, 0, 0.5) !important; /* Lebih terang, sama seperti bg-black/70 dengan opacity-50 */
        position: absolute !important;
    }
    
    /* Mobile hover dan active - Warna SOLID sama persis dengan navbar bg-blue-600 (#2563eb) */
    /* Hanya biru saat hover/active, kembali abu saat tidak */
    /* Catatan: :active state di mobile bisa tetap aktif setelah touch, jadi kita gunakan JavaScript untuk reset */
    .category-scroll-btn:active,
    .category-scroll-btn:hover,
    .category-scroll-left:active,
    .category-scroll-left:hover,
    .category-scroll-right:active,
    .category-scroll-right:hover,
    button.category-scroll-btn:active,
    button.category-scroll-btn:hover,
    button.category-scroll-left:active,
    button.category-scroll-left:hover,
    button.category-scroll-right:active,
    button.category-scroll-right:hover,
    /* Override Tailwind hover:bg-blue-600 dengan specificity tinggi */
    button.hover\:bg-blue-600.category-scroll-btn:hover,
    button.hover\:bg-blue-600.category-scroll-btn:active,
    button.hover\:bg-blue-600.category-scroll-left:hover,
    button.hover\:bg-blue-600.category-scroll-left:active,
    button.hover\:bg-blue-600.category-scroll-right:hover,
    button.hover\:bg-blue-600.category-scroll-right:active,
    /* Tambahan selector untuk memastikan override */
    button.bg-black\/70.category-scroll-btn:hover,
    button.bg-black\/70.category-scroll-btn:active,
    button.bg-black\/70.category-scroll-left:hover,
    button.bg-black\/70.category-scroll-left:active,
    button.bg-black\/70.category-scroll-right:hover,
    button.bg-black\/70.category-scroll-right:active,
    button.bg-black\/70.hover\:bg-blue-600.category-scroll-btn:hover,
    button.bg-black\/70.hover\:bg-blue-600.category-scroll-btn:active,
    button.bg-black\/70.hover\:bg-blue-600.category-scroll-left:hover,
    button.bg-black\/70.hover\:bg-blue-600.category-scroll-left:active,
    button.bg-black\/70.hover\:bg-blue-600.category-scroll-right:hover,
    button.bg-black\/70.hover\:bg-blue-600.category-scroll-right:active {
        opacity: 1 !important;
        /* Warna SOLID sama persis dengan navbar - tidak ada transparansi */
        background-color: #2563eb !important; /* Blue-600 - SOLID seperti navbar */
        background: #2563eb !important; /* Fallback - SOLID color */
        /* Hilangkan semua kemungkinan transparansi */
        filter: none !important;
        -webkit-background-color: #2563eb !important;
        -moz-background-color: #2563eb !important;
        background-image: none !important;
        /* Shadow untuk efek visual */
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
    }
    
    /* Pastikan setelah touch end, button kembali ke default (abu) */
    /* JavaScript akan menghapus style inline dan memanggil blur() untuk menghilangkan :active state */
    
    .category-carousel-wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .category-scroll-btn svg,
    .category-scroll-left svg,
    .category-scroll-right svg {
        width: 16px !important; /* w-4 sama seperti desktop */
        height: 16px !important; /* h-4 sama seperti desktop */
        display: block !important;
    }
}

/* Extra small mobile - still show buttons */
@media (max-width: 480px) {
    .category-scroll-btn,
    .category-scroll-left,
    .category-scroll-right {
        display: flex !important;
        visibility: visible !important;
        width: 12px !important;
        height: 60px !important;
        opacity: 0.7 !important;
    }
}

/* Tablet and Desktop */
@media (min-width: 641px) {
    .category-scroll-btn,
    .category-scroll-left,
    .category-scroll-right {
        opacity: 0.5 !important; /* Sama seperti produk terlaris */
        /* Biarkan bg-black/70 dari Tailwind bekerja, jangan override background-color */
    }
    
    .category-scroll-btn:hover,
    .category-scroll-left:hover,
    .category-scroll-right:hover {
        opacity: 1 !important;
    }
}

/* ========================================== */
/* OLD CATEGORY CAROUSEL STYLES - TAILWIND BASED */
/* ========================================== */

.category-carousel-container {
    position: relative;
    width: 100%;
    overflow: visible; /* Biarkan arrow yang setengah keluar terlihat */
}

#categoryCarousel {
    position: relative;
    width: 100%;
}

.category-carousel-inner {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 0; /* Tambahan: Hindari auto-height inheritance dari child hidden */
}

.category-slide {
    display: none;
    transition: opacity 0.6s ease-in-out;
    width: 100%;
}

.category-slide.active {
    display: block;
}

.category-grid {
    width: 100%;
    display: block; /* Tambahan: Pastikan grid full width di mobile */
}

/* Category Column - 8 kolom per baris (12.5% each) */
.category-col {
    flex: 0 0 12.5%;
    max-width: 12.5%;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    transition: all 0.3s ease;
    min-height: 180px;
    display: flex;
    box-sizing: border-box;
    position: relative;
}

.category-col:hover {
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    z-index: 10;
}

.category-col-empty {
    flex: 0 0 12.5%;
    max-width: 12.5%;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    min-height: 180px;
    box-sizing: border-box;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.category-item:hover {
    text-decoration: none;
    color: inherit;
}

/* Category Image Styling - Full Cover seperti Card Produk */
.category-image-wrapper {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.category-item:hover .category-image-wrapper {
    background: #e0f2fe;
    transform: scale(1.05);
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.category-item:hover .category-image {
    transform: scale(1.05);
}

/* Category Icon Styling */
.category-icon-wrapper {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e0f2fe 0%, #eef5ff 100%);
    color: #0D6EFD;
    font-size: 1.75rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.1);
}

.category-item:hover .category-icon-wrapper {
    background: #0D6EFD;
    color: #fff;
    transform: scale(1.05);
}

/* Category Name */
.category-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    margin: 0;
    transition: color 0.3s ease;
}

.category-item:hover .category-name {
    color: #0D6EFD;
}

/* CAROUSEL NAVIGATION BUTTONS */
.category-nav-btn {
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    width: 32px;
    height: 56px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    cursor: pointer;
    z-index: 20;
    padding: 0;
    opacity: 0;
}

/* Desktop: arrow posisi setengah keluar dari container */
@media (min-width: 769px) {
    .category-nav-prev {
        left: -16px; /* Setengah arrow di luar (-32px/2 = -16px) */
    }

    .category-nav-next {
        right: -16px; /* Setengah arrow di luar */
    }
}

.category-carousel-container:hover .category-nav-btn {
    opacity: 1;
}

.category-nav-btn:hover {
    background-color: #0D6EFD;
    color: #fff;
}

.category-nav-prev {
    left: 8px;
}

.category-nav-next {
    right: 8px;
}

.category-nav-icon {
    width: 20px;
    height: 20px;
}

/* Navigation Controls Container */
.category-nav-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* Allow clicks to pass through container */
}

.category-nav-controls button {
    pointer-events: auto; /* Enable clicks on buttons */
}

/* ========================================== */
/* RESPONSIVE STYLES */
/* ========================================== */

/* Large Desktop (1400px+) - 8 kolom */
@media (min-width: 1201px) {
    .category-col,
    .category-col-empty {
        flex: 0 0 12.5%;
        max-width: 12.5%;
    }
}

/* Desktop (992px - 1200px) - 6 kolom */
@media (max-width: 1200px) and (min-width: 993px) {
    .category-col,
    .category-col-empty {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
}

/* Tablet (768px - 992px) - 4 kolom */
@media (max-width: 992px) and (min-width: 769px) {
    .category-col,
    .category-col-empty {
        flex: 0 0 25%;
        max-width: 25%;
        min-height: 140px;
    }

    .category-item {
        padding: 14px 8px;
    }

    .category-image-wrapper {
        height: 90px;
        margin-bottom: 10px;
    }

    .category-icon-wrapper {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .category-name {
        font-size: 0.75rem;
    }

    .category-nav-btn {
        width: 30px;
        height: 50px;
        opacity: 0.8; /* Terlihat di tablet/m中ium */
    }
    
    .category-nav-prev {
        left: -15px; /* Half outside (30px/2) */
    }

    .category-nav-next {
        right: -15px; /* Half outside */
    }

    .category-row {
        justify-content: center;
    }
    
    /* Pastikan container tidak memotong arrow */
    .category-carousel-container {
        padding: 0 20px; /* Space untuk arrow */
    }
}

/* Tablet Small & Mobile (≤768px) - 3 kolom per baris (layout 3x3) */
@media (max-width: 768px) {
    .category-col,
    .category-col-empty {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        min-height: 120px;
        margin: 0; /* Hapus margin ekstra jika ada */
        padding: 0;
        box-sizing: border-box;
        display: flex;
        align-items: stretch; /* Pastikan height row sama */
    }

    .category-item {
        padding: 12px 6px;
    }

    .category-image-wrapper {
        height: 70px;
        margin-bottom: 8px;
    }

    .category-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        margin-bottom: 8px;
    }

    .category-name {
        font-size: 0.7rem;
        line-height: 1.15;
    }

    .category-nav-btn {
        width: 28px;
        height: 48px;
        opacity: 0.8; /* Terlihat di mobile tanpa hover */
    }

    .category-nav-icon {
        width: 18px;
        height: 18px;
    }

    .category-nav-prev {
        left: -14px; /* Setengah arrow di luar (-28px/2 = -14px) */
    }

    .category-nav-next {
        right: -14px; /* Setengah arrow di luar */
    }
    
    /* Pastikan container carousel tidak overlap dengan arrow */
    .category-carousel-container {
        padding: 0;
        margin: 0 auto;
        width: 100%;
    }

    /* Tambahan: Pastikan grid row tidak overflow di mobile */
    .category-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start; /* Start dari kiri untuk grid yang rapi */
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
        box-sizing: border-box;
        border-top: 1px solid #f0f0f0;
        border-left: 1px solid #f0f0f0;
    }
    
    .category-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
    }
    
    /* Hide empty slots di mobile secara visual tapi tetap maintain grid structure */
    .category-col-empty {
        opacity: 0;
        pointer-events: none;
        min-height: 120px;
        border: none !important;
        background: transparent !important;
    }

    .category-carousel-inner {
        min-height: 280px; /* Estimasi 3 rows dengan ukuran lebih kecil */
        padding: 0; /* Reset padding inheritance */
        margin: 0 auto; /* Center inner jika ada offset */
    }
    
    #mobileSlidesContainer {
        visibility: visible; /* Pastikan tidak hidden secara visual */
        width: 100%;
        margin: 0 auto;
    }
}

/* Mobile Small (≤576px) - 3 kolom per baris (layout 3x3) dengan ukuran lebih kecil */
@media (max-width: 576px) {
    .category-col,
    .category-col-empty {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        min-height: 110px;
    }

    .category-item {
        padding: 10px 4px;
    }

    .category-image-wrapper {
        height: 60px;
        margin-bottom: 6px;
    }

    .category-icon-wrapper {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        margin-bottom: 6px;
    }

    .category-name {
        font-size: 0.65rem;
        line-height: 1.1;
    }

    .category-nav-btn {
        width: 24px;
        height: 40px;
        opacity: 0.8; /* Terlihat di small mobile */
    }

    .category-nav-icon {
        width: 16px;
        height: 16px;
    }

    .category-nav-prev {
        left: -12px; /* Setengah arrow di luar (-24px/2 = -12px) */
    }

    .category-nav-next {
        right: -12px; /* Setengah arrow di luar */
    }
}

/* Extra Small Mobile (≤400px) - 3 kolom per baris jika space sangat terbatas */
@media (max-width: 400px) {
    .category-col,
    .category-col-empty {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        min-height: 100px;
    }

    .category-item {
        padding: 8px 4px;
    }

    .category-image-wrapper {
        height: 50px;
        margin-bottom: 6px;
    }

    .category-icon-wrapper {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .category-name {
        font-size: 0.6rem;
        line-height: 1.1;
    }
    
    .category-nav-btn {
        width: 22px;
        height: 36px;
        opacity: 0.8; /* Terlihat di extra small mobile */
    }
    
    .category-nav-prev {
        left: -11px; /* Setengah arrow di luar (-22px/2 = -11px) */
    }
    
    .category-nav-next {
        right: -11px; /* Setengah arrow di luar */
    }
}

/* ========================================== */
/* TAMBAHAN UNTUK FIX OVERLAPPING DI MOBILE REFRESH */
/* ========================================== */

/* Tambahan untuk Fix Overlapping di Mobile Refresh */
#desktopSlidesContainer,
#mobileSlidesContainer {
    width: 100%;
    transition: display 0.1s ease; /* Smooth switch, tapi cepat */
}

#desktopSlidesContainer {
    display: block; /* Default untuk desktop */
}

#mobileSlidesContainer {
    display: none; /* Default hidden */
}

/* Force no contribution dari hidden container ke parent height */
#desktopSlidesContainer.hidden,
#mobileSlidesContainer.hidden {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden;
}

/* Handle empty message consistency */
.category-slide.text-center {
    display: none; /* Default hidden, JS akan show jika kosong */
}

/* Tambahan: Fix Simetri dan Centering di Mobile Refresh */
@media (max-width: 768px) {
    .category-row {
        justify-content: center;
    }
}


/* ========================================== */
/* PRODUCT CARD STYLES */
/* ========================================== */

.product-card-wrapper {
    position: relative;
}

/* Card tetap diam saat hover */
.product-card-wrapper .bg-white {
    transform: none;
}

/* Image zoom effect saat hover - FULL COVER tanpa padding */
.product-image {
    transition: transform 0.4s ease;
    object-fit: cover; /* Ubah dari contain ke cover */
}

.product-card-wrapper:hover .product-image {
    transform: scale(1.08);
}

/* Product title - 2 baris dengan ellipsis */
.product-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.4;
    min-height: 2.8rem;
}

/* Buttons - hidden by default, slide up on hover */
.product-buttons {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card-wrapper:hover .product-buttons {
    max-height: 50px;
    opacity: 1;
}

.product-btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-btn:active {
    transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-btn .btn-text {
        display: none;
    }
    
    .product-btn {
        padding: 0.5rem;
    }
    
    .product-btn i {
        margin: 0;
    }
}

@media (max-width: 640px) {
    .product-title {
        font-size: 0.75rem;
        min-height: 2.4rem;
    }
    
    .product-card-wrapper:hover .product-buttons {
        max-height: 45px;
    }
}

/* carousel */
/* Category Carousel Styling */
.category-carousel-inner {
    position: relative;
    width: 100%;
    /* Set minimum height yang cukup untuk 2 baris kategori */
    min-height: 400px;
}

#categoryCarousel {
    position: relative;
    overflow: hidden;
    /* Tambahkan height yang fixed */
    height: 400px;
}

.category-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.category-slide.active {
    position: relative;
    display: block;
}

/* Pastikan grid kategori tidak berubah ukuran */
.category-grid {
    height: 100%;
}

/* Responsive height */
@media (max-width: 768px) {
    #categoryCarousel {
        height: auto;
        min-height: 300px;
    }
    .category-carousel-inner {
        min-height: 300px;
    }
}

/* mobile produk terlaris */
@media (max-width: 1023px) {
    #bestSellingTrack .grid > div:nth-child(n+3) {
        display: none;
    }
}

/* Best Selling Carousel Navigation - Presisi tengah visual card */
.best-selling-carousel-container {
    position: relative;
    /* Hapus display: flex dan align-items untuk tidak mengganggu absolute positioning */
}

/* Perhitungan presisi: 
   - Card height: ~280px (mobile), ~320px (desktop)
   - Margin-bottom: mb-2 (8px), mb-4 (16px), mb-6 (24px)
   - Padding-bottom: pb-4 (16px), pb-6 (24px), pb-8 (32px)
   - Tengah card = tengah visual card, bukan tengah container total
   - Offset = setengah dari margin-bottom (karena margin menambah tinggi container)
*/

/* Mobile: mb-2 (8px), pb-4 (16px) - card ~280px */
@media (max-width: 639px) {
    .best-selling-carousel-container {
        min-height: 260px;
    }
    
    .best-selling-nav-btn {
        /* Fallback: akan di-override oleh JavaScript untuk presisi */
        top: 50%;
        transform: translateY(-50%);
        height: 56px !important;
    }
}

/* Tablet: mb-2 (8px), pb-6 (24px) - card ~300px */
@media (min-width: 640px) and (max-width: 1023px) {
    .best-selling-carousel-container {
        min-height: 280px;
    }
    
    .best-selling-nav-btn {
        /* Fallback: akan di-override oleh JavaScript untuk presisi */
        top: 50%;
        transform: translateY(-50%);
        height: 64px !important;
    }
    
    #bestSellingTrack {
        display: flex;
        align-items: stretch;
    }
    
    .best-selling-slide {
        display: flex;
        align-items: stretch;
    }
}

/* Desktop md: mb-4 (16px), pb-6 (24px) - card ~320px */
@media (min-width: 1024px) and (max-width: 1279px) {
    .best-selling-nav-btn {
        /* Fallback: akan di-override oleh JavaScript untuk presisi */
        top: 50%;
        transform: translateY(-50%);
    }
}

/* Large desktop lg: mb-6 (24px), pb-8 (32px) - card ~320px */
@media (min-width: 1280px) {
    .best-selling-nav-btn {
        /* Fallback: akan di-override oleh JavaScript untuk presisi */
        top: 50%;
        transform: translateY(-50%);
    }
}


/* 
Kategori Link Smooth
*/
.category-link {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0.5rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.category-link:hover {
    background-color: #f9fafb;
    color: #3b82f6;
    transform: translateY(-2px);
}

.category-link .category-name {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}


/* 
Kategori Link Smooth
*/
/* .product-card-wrapper a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-wrapper a:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-in-out;
}

.product-card-wrapper a .product-image {
    transition: transform 0.3s ease;
}

.product-card-wrapper a:hover .product-image {
    transform: scale(1.05);
} */

/* 
Product_details scroll 
*/
/* Custom scrollbar */

/* ========================================== */
/* PRODUCT DETAILS MOBILE STYLING */
/* ========================================== */

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari, Opera */
}

/* Mobile Product Details Improvements */
@media (max-width: 640px) {
    /* Thumbnail gallery mobile */
    .thumbnail-btn {
        min-width: 80px;
        min-height: 80px;
    }
    
    /* Better spacing for mobile */
    .detail-content > div {
        padding: 0.5rem 0;
    }
    
    /* Gallery modal mobile */
    #galleryModal {
        padding: 0.5rem;
    }
    
    #galleryModal .gallery-thumb {
        min-width: 72px;
        min-height: 72px;
    }
}

/* Tablet improvements */
@media (min-width: 641px) and (max-width: 768px) {
    .thumbnail-btn {
        min-width: 96px;
        min-height: 96px;
    }
}
        .scrollbar-thin::-webkit-scrollbar {
            height: 6px;
        }

        .scrollbar-thin::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 10px;
        }

        .scrollbar-thin::-webkit-scrollbar-thumb {
            background: #cbd5e0;
            border-radius: 10px;
        }

        .scrollbar-thin::-webkit-scrollbar-thumb:hover {
            background: #a0aec0;
        }

        /* Custom scrollbar untuk modal - lebih jelas dan selalu terlihat */
        .scrollbar-modal::-webkit-scrollbar {
            width: 10px;
        }

        @media (min-width: 640px) {
            .scrollbar-modal::-webkit-scrollbar {
                width: 12px;
            }
        }

        .scrollbar-modal::-webkit-scrollbar-track {
            background: #e5e7eb;
            border-radius: 10px;
            margin: 4px 0;
            border: 1px solid #d1d5db;
        }

        .scrollbar-modal::-webkit-scrollbar-thumb {
            background: #64748b;
            border-radius: 10px;
            border: 2px solid #e5e7eb;
            min-height: 30px;
        }

        .scrollbar-modal::-webkit-scrollbar-thumb:hover {
            background: #475569;
            border: 2px solid #d1d5db;
        }

        .scrollbar-modal::-webkit-scrollbar-thumb:active {
            background: #334155;
        }

        /* Firefox scrollbar untuk modal */
        .scrollbar-modal {
            scrollbar-width: auto;
            scrollbar-color: #64748b #e5e7eb;
        }

        @media (max-width: 640px) {
            .scrollbar-modal {
                scrollbar-width: auto;
                scrollbar-color: #64748b #e5e7eb;
            }
        }

        /* Hide number input arrows */
        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        input[type=number] {
            -moz-appearance: textfield;
        }

/* Product Detail Page */
        .detail-tab {
            transition: all 0.2s ease;
        }

        .detail-tab:hover:not(.active) {
            color: #1e40af;
        }

        .detail-content {
            animation: fadeIn 0.3s ease-in;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Thumbnail styling - FIX HOVER ISSUE */
        .thumbnail-btn {
            overflow: hidden !important;
            position: relative;
            transition: all 0.3s ease;
            display: inline-block;
        }

        .thumbnail-btn img {
            transition: transform 0.3s ease;
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .thumbnail-btn:hover {
            border-color: #3b82f6 !important;
        }

        .thumbnail-btn:hover img {
            transform: scale(1.05);
            filter: brightness(1.05);
        }

        /* Pastikan zoom tidak keluar container */
        .thumbnail-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: inherit;
            pointer-events: none;
            z-index: 1;
        }

        /* Gallery modal image */
        #galleryMainImage {
            animation: zoomIn 0.3s ease-in;
        }

        @keyframes zoomIn {
            from {
                opacity: 0;
                transform: scale(0.95);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        /* Modal Form Tanya Produk - Clean & Modern */
        #askProductModal {
            animation: fadeIn 0.2s ease-out;
        }

        #askProductModal[class*="hidden"] {
            display: none;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        /* Smooth input transitions */
        #askProductForm input,
        #askProductForm textarea {
            transition: all 0.2s ease;
        }

        #askProductForm input:hover,
        #askProductForm textarea:hover {
            border-color: #cbd5e1;
        }

        /* Button hover effects */
        #askProductModal button[type="submit"]:hover {
            transform: translateY(-1px);
        }

        #askProductModal button[type="button"]:hover {
            background-color: #f3f4f6;
        }
