:root {
    --primary-dark: #0b1b3d;
    --secondary: #1f3a5f;
    --accent-gold: #ffc107;
    --accent-gold-hover: #ffca2c;
}

body {
    font-family: "Plus Jakarta Sans", sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}

.bg-primary-dark {
    background-color: var(--primary-dark) !important;
}

.bg-secondary-dark {
    background-color: var(--secondary) !important;
}
.text-gold {
    color: var(--accent-gold) !important;
}

.btn-gold {
    background-color: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--primary-dark);
    font-weight: 600;
}

.btn-gold:hover {
    background-color: var(--accent-gold-hover);
    border-color: var(--accent-gold-hover);
    color: var(--primary-dark);
}

.sticky-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: var(--primary-dark);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-link {
    color: #fff !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-gold) !important;
}

.custom-card {
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    background: #fff;
}

.custom-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}

.hero-logo-container {
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

.info-floating-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    margin-top: -4rem;
}

.cover-box {
    height: 230px;
    background-size: cover;
    background-position: center;
    border-radius: 0.5rem;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.banner-green {
    background-color: #113024;
    border-radius: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Pastikan semua card memiliki transisi yang halus */
.custom-card {
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    background: #fff;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); /* Efek smooth */
    display: flex;
    flex-direction: column;
}

/* Status Hover: Semua card akan berubah menjadi biru saat di-hover */
.custom-card:hover {
    background-color: var(--primary-dark) !important;
    color: #fff !important;
    border-color: var(--primary-dark) !important;
    transform: translateY(-5px); /* Sedikit naik agar terlihat hidup */
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
}

/* Mengubah isi teks menjadi putih saat parent-nya di-hover */
.custom-card:hover h3,
.custom-card:hover p,
.custom-card:hover .text-dark {
    color: #fff !important;
}

/* Mengubah icon/lingkaran saat parent di-hover */
.custom-card:hover .rounded-circle {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Mengubah tombol saat parent di-hover */
.custom-card:hover .btn-outline-secondary {
    background-color: var(--accent-gold) !important;
    border-color: var(--accent-gold) !important;
    color: var(--primary-dark) !important;
}

/* Styling Utama Modern Card */
.modern-card {
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 1.25rem !important;
    background: #ffffff;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Garis aksen tipis di atas card */
.card-glow-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background 0.3s ease;
}

/* Ukuran kotak icon */
.icon-box {
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
}

/* Tombol Kustom pada Card */
.btn-outline-custom {
    border: 1px solid #dee2e6;
    color: #212529;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

/* --- Efek saat Card di-Hover --- */
.modern-card:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    transform: translateY(-8px);
    box-shadow: 0 1rem 2.5rem rgba(11, 27, 61, 0.15);
}

/* Munculkan garis aksen warna Gold di atas saat di-hover */
.modern-card:hover .card-glow-line {
    background: var(--accent-gold);
}

/* Ubah warna teks di dalam card menjadi putih saat di-hover */
.modern-card:hover h3,
.modern-card:hover p,
.modern-card:hover .text-dark {
    color: #ffffff !important;
}

.modern-card:hover .text-muted {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Ubah gaya icon box saat di-hover */
.modern-card:hover .icon-box {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--accent-gold) !important;
    transform: scale(1.05);
}

/* Ubah gaya tombol saat card di-hover */
.modern-card:hover .btn-outline-custom {
    background-color: var(--accent-gold) !important;
    border-color: var(--accent-gold) !important;
    color: var(--primary-dark) !important;
}

/* Animasi kecil untuk panah pada tombol */
.modern-card:hover .arrow-icon {
    transform: translateX(3px);
    transition: transform 0.2s ease;
}

/* Mengaktifkan horizontal slider dengan snap */
#card-slider {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory; /* Kunci posisi saat di-scroll */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Sembunyikan scrollbar di Firefox */
}

#card-slider::-webkit-scrollbar {
    display: none; /* Sembunyikan scrollbar di Chrome/Safari */
}

#card-slider > .col-10 {
    scroll-snap-align: start; /* Titik kunci snap */
    flex: 0 0 auto; /* Mencegah card mengecil */
}

@media (min-width: 992px) {
    #card-slider {
        overflow-x: visible; /* Kembali ke layout grid normal di desktop */
    }
}

/* =========================================
   PENGATURAN KHUSUS KATALOG BUKU
   ========================================= */

.book-card-item {
    flex: 0 0 210px;
    width: 210px;
    scroll-snap-align: start;
}

/* Mematikan efek hover biru pada card buku secara spesifik */
.book-card-item .custom-card {
    transition: box-shadow 0.3s ease !important;
    background: #fff !important;
    border: 1px solid #dee2e6 !important;
}

.book-card-item .custom-card:hover {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    transform: none !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
}

/* Memastikan teks judul buku tetap gelap dan tidak ikut berubah jadi putih saat di-hover */
.book-card-item .custom-card:hover h6,
.book-card-item .custom-card:hover .text-dark {
    color: #212529 !important;
}

/* Efek hover khusus pada bagian gambar/cover buku (naik & rotasi miring) */
.book-card-item .cover-box {
    transition:
        transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
        box-shadow 0.4s ease;
    will-change: transform;
}

.book-card-item .custom-card:hover .cover-box {
    transform: translateY(-6px) rotate(2deg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Container Slider Buku */
.book-slider-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.book-slider-container::-webkit-scrollbar {
    display: none;
}

@media (max-width: 575.98px) {
    .book-card-item {
        flex: 0 0 185px;
        width: 185px;
    }
}

/* Styling Box Katalog Buku dengan Border Radius dan Background Fixed */
.book-parallax-box {
    border-radius: 1.1rem; /* Menyamakan lengkungan sudut dengan banner lainnya */
    background:
        linear-gradient(0deg, rgba(11, 27, 61, 0.58), rgba(11, 27, 61, 0.48)),
        url("https://images.unsplash.com/photo-1541339907198-e08756dedf3f?auto=format&fit=crop&w=1920&q=80")
            center center / cover no-repeat;
    background-attachment: fixed; /* Efek "lubang" / parallax saat halaman di-scroll */
}

/* Penyesuaian warna teks deskripsi agar kontras */
.book-parallax-box p {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Pengaturan Layout Berita Versi Mobile (Gambar di Kiri, Teks di Kanan) */
@media (max-width: 767.98px) {
    .berita-card > div:first-child {
        display: flex;
        flex-direction: row; /* Mengubah susunan jadi horizontal */
        align-items: center;
    }

    /* Mengatur ukuran kotak gambar di mobile */
    .berita-card .berita-img-wrapper {
        width: 110px !important;
        min-width: 110px;
        height: 90px !important;
        border-radius: 0.75rem;
        margin: 0.5rem;
    }

    /* Mengatur padding bagian teks agar pas */
    .berita-card .berita-content {
        padding: 0.5rem 0.75rem !important;
        flex-grow: 1;
    }

    /* Ukuran font judul di mobile agar rapi */
    .berita-card .berita-content h6 {
        font-size: 0.82rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Batasi maksimal 2 baris */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Pengaturan tinggi gambar standar untuk versi Desktop */
@media (min-width: 768px) {
    .berita-card .berita-img-wrapper {
        height: 130px !important;
        width: 100% !important;
    }
}

/* Styling Full-Width Section Bank Sampah */
.banner-bank-sampah-section {
    background-color: #113024; /* Warna hijau khas bank sampah */
    width: 100%;
}

/* Efek interaktif halus pada icon card */
.transition-hover {
    transition:
        transform 0.3s ease,
        background-color 0.3s ease;
}

.transition-hover:hover {
    transform: translateY(-4px);
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Styling Banner Bank Sampah ala Referensi */
.bank-sampah-banner {
    border-radius: 1.5rem; /* Sudut melengkung */
    background:
        linear-gradient(
            90deg,
            rgba(14, 45, 29, 0.98) 0%,
            rgba(14, 45, 29, 0.92) 50%,
            rgba(14, 45, 29, 0.4) 85%
        ),
        url("https://images.unsplash.com/photo-1532996122724-e3c354a0b15b?auto=format&fit=crop&w=1920&q=80")
            center right / cover no-repeat;
    background-color: #0e2d1d; /* Fallback color */
}

/* Responsif khusus teks judul di perangkat besar */
@media (min-width: 992px) {
    .bank-sampah-banner h2 {
        font-size: 2.25rem !important;
    }
}

/* =========================================
   1. UTILITIES & WARNA DASAR
   ========================================= */
.bg-gold {
    background-color: #ffc107 !important;
}
.text-primary-dark {
    color: #0b1b3d !important;
}
.bg-primary-dark {
    background-color: #0b1b3d !important;
}
.tracking-wide {
    letter-spacing: 1px;
}
.cursor-pointer {
    cursor: pointer;
}
.hover-gold:hover {
    background-color: #ffc107 !important;
    color: #0b1b3d !important;
}

/* Scrollbar Kustom untuk area yang bisa di-scroll (Filter & Keranjang) */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* =========================================
   2. HERO SECTION KATALOG
   ========================================= */
.catalog-hero {
    position: relative;
    background-image:
        linear-gradient(
            135deg,
            rgba(11, 27, 61, 0.88) 0%,
            rgba(31, 58, 95, 0.8) 100%
        ),
        url("https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?q=80&w=1920&auto=format&fit=crop");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Efek Parallax */
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 193, 7, 0.05); /* Gold transparan */
    z-index: 0;
}
.hero-shape.shape-1 {
    width: 300px;
    height: 300px;
    top: -50px;
    left: -100px;
}
.hero-shape.shape-2 {
    width: 500px;
    height: 500px;
    bottom: -150px;
    right: -100px;
    background: rgba(255, 255, 255, 0.03); /* Putih transparan */
}

/* =========================================
   3. FILTER & SEARCH (KOLOM KIRI)
   ========================================= */
.custom-search .form-control {
    border-radius: 50rem;
    padding-left: 1.2rem;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
    box-shadow: none;
    transition: all 0.3s ease;
}
.custom-search .form-control:focus {
    border-color: #0b1b3d;
    box-shadow: 0 0 0 0.2rem rgba(11, 27, 61, 0.1);
}

.filter-checkboxes .form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-right: 10px;
    cursor: pointer;
}
.filter-checkboxes .form-check-input:checked {
    background-color: #0b1b3d;
    border-color: #0b1b3d;
}
.filter-checkboxes label {
    margin-top: 2px;
}

/* =========================================
   4. GRID PRODUK (KOLOM TENGAH)
   ========================================= */
.catalog-product-card {
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}
.catalog-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08) !important;
}

/* Mengunci rasio gambar produk menjadi 4:5 (Portrait) */
.product-img-wrapper {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    position: relative;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.catalog-product-card:hover .product-img {
    transform: scale(1.05);
}

.product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
    min-height: 2.4em;
}

/* Tombol Add to Cart */
.btn-add-cart {
    transition: all 0.2s ease;
}
.btn-add-cart:active {
    transform: scale(0.95); /* Efek memantul (mengecil sedikit) saat ditekan */
}

/* =========================================
   5. SLIDING KERANJANG (PANEL KANAN)
   ========================================= */
/* Tombol Trigger (Badge Keranjang di Tepi Kanan) */
.cart-trigger {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 60px;
    height: 75px;
    border-radius: 10px 0 0 10px;
    z-index: 1040;
    transition:
        right 0.3s ease,
        background-color 0.3s ease;
}
.cart-trigger:hover {
    background-color: #1f3a5f !important; /* Warna biru sedikit lebih terang saat di hover */
    width: 65px; /* Sedikit memanjang keluar saat di hover */
}

/* Panel Sidebar Keranjang */
.cart-sidebar-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    /* PERBAIKAN: Gunakan 100% dan 100dvh agar tidak tertutup navbar browser mobile */
    height: 100%;
    height: 100dvh;
    z-index: 1050;
    transition: right 0.35s cubic-bezier(0.82, 0.085, 0.395, 0.895);
}

.cart-sidebar-panel.open {
    right: 0;
}

/* Pastikan footer tidak tertekan atau tersembunyi */
.cart-footer {
    flex-shrink: 0; /* Mencegah footer mengecil */
    /* Tambahan safe-area untuk pengguna iPhone / iOS agar tidak tertutup garis home */
    padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
}

/* Overlay Hitam Transparan (Berfungsi baik di Mobile maupun Desktop) */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1045; /* Di bawah panel keranjang, tapi di atas web */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cart-overlay.show {
    display: block;
    opacity: 1;
}

/* Layout per Item di dalam Keranjang */
.cart-item-row {
    border-bottom: 1px dashed #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.cart-item-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cart-item-img {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
}

/* Icon Hapus Item */
.btn-remove-item {
    cursor: pointer;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}
.btn-remove-item:hover {
    color: #dc3545 !important;
    transform: scale(1.1);
}

/* Styling Input Qty (+ / -) di Keranjang */
.qty-input-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.qty-input-group .btn {
    border-color: #dee2e6;
    background: #f8f9fa;
    color: #495057;
    font-weight: bold;
}
.qty-input-group .btn:hover {
    background: #e9ecef;
}
.qty-input-group .form-control {
    border-color: #dee2e6;
    background: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0b1b3d;
}
.qty-input-group .form-control:focus {
    box-shadow: none;
}

/* =========================================
   6. RESPONSIVE DESIGN (MOBILE)
   ========================================= */
@media (max-width: 575.98px) {
    .cart-sidebar-panel {
        width: 100%;
        right: -100%;
    }

    .catalog-product-card .card-body {
        padding: 0.75rem !important;
    }
    .product-title {
        font-size: 0.8rem;
    }
    .product-price {
        font-size: 0.9rem !important;
    }
    .btn-add-cart {
        font-size: 0.75rem;
        padding: 0.4rem;
    }
}
