html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 70px; /* Beri ruang untuk fixed navbar di desktop */
}

.main-content {
    flex: 1;
}

/* Footer Kustom */
.footer-custom {
    background-color: rgba(255, 255, 255, 0.8); /* Latar belakang transparan */
    backdrop-filter: blur(10px); /* Efek blur untuk browser yang mendukung */
    -webkit-backdrop-filter: blur(10px);
    color: #333; /* Warna teks gelap agar kontras */
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-custom a {
    color: #333;
    text-decoration: none;
}

.footer-custom a:hover {
    color: var(--bs-primary);
}

/* Pastikan dropdown menu selalu di atas */
.navbar .dropdown-menu {
    z-index: 1031; /* Lebih tinggi dari z-index default navbar (1030) */
}

.card .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 20px 0;
    margin-top: 40px;
}

/* -- Fitur Baru -- */

/* Efek Hover pada Kartu Produk */
.card {
    display: flex;
    flex-direction: column;
}
.card-body {
    flex-grow: 1;
}
.card-product:hover .card-img-top {
    transform: scale(1.05);
}

.card-product .card-img-top {
    transition: transform 0.4s ease;
}

.card-product .card-img-container {
    position: relative;
    overflow: hidden;
}

.card-product .card-product-buttons {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.4s ease;
    opacity: 0;
    display: flex;
    gap: 8px;
}

.card-product:hover .card-product-buttons {
    bottom: 15px;
    opacity: 1;
}

.card-product .add-to-cart-btn,
.card-product .btn-quick-view,
.card-product .like-btn {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    padding: 0; /* Reset padding default button */
}

.card-product .add-to-cart-btn:hover,
.card-product .btn-quick-view:hover,
.card-product .like-btn:hover:not(.liked) {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    transform: scale(1.1);
}

.card-product .like-container {
    display: flex;
    align-items: center;
    position: relative; /* Untuk memposisikan count */
}

.card-product .like-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.like-btn.liked {
    color: #dc3545; /* Tetap merah saat sudah disukai */
}

/* Penyesuaian untuk Mobile - Perbaikan */
@media (max-width: 768px) {
    /* Tampilkan tombol secara permanen di mobile tanpa efek transisi */
    .card-product .card-product-buttons {
        opacity: 1;
        bottom: 10px;
        background: none;
        box-shadow: none;
        transition: none; /* Hapus animasi muncul */
        transform: translateX(-50%); /* Pastikan tetap di tengah */
        position: absolute;
        left: 50%;
    }

    /* Pastikan tidak ada perubahan saat disentuh (pseudo-hover) */
    .card-product:hover .card-product-buttons {
        bottom: 10px;
        opacity: 1;
    }

    .card-product .add-to-cart-btn,
    .card-product .btn-quick-view {
        background-color: rgba(255, 255, 255, 0.9);
        transform: none; /* Hapus efek scale saat disentuh */
    }

    .card-product .add-to-cart-btn:hover,
    .card-product .btn-quick-view:hover {
        transform: none; /* Hapus efek scale saat disentuh */
        background-color: rgba(255, 255, 255, 0.9); /* Jaga warna background */
        color: #333; /* Jaga warna ikon */
    }
}

/* Animasi untuk Teks Hero */
.animated-text {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.animated-text-delay {
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Palet Warna Baru */
:root {
    --bs-primary: #28a745; /* Hijau yang lebih cerah */
    --bs-secondary: #6c757d; /* Abu-abu netral */
    --bs-success: #28a745;
    --bs-info: #17a2b8;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #343a40;
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-primary:hover {
    background-color: #218838; /* Hijau yang sedikit lebih gelap saat hover */
    border-color: #1e7e34;
}

.like-btn:hover, .like-btn.liked {
    color: #dc3545; /* Warna merah untuk tombol suka */
}
.card-product {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Sidebar Kategori */
.sidebar {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 20px;
}

.sidebar h4 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--secondary-color, #333);
}

.sidebar .list-group-item {
    border: none;
    padding: 10px 15px;
    background-color: transparent;
    color: var(--text-color, #212529);
}

.sidebar .list-group-item:hover {
    background-color: #e9ecef;
}

.sidebar .list-group-item.active {
    background-color: var(--primary-color, #007bff);
    color: white;
    border-color: var(--primary-color, #007bff);
    font-weight: bold;
}

/* Pagination */
.pagination .page-item.active .page-link {
    background-color: var(--primary-color, #007bff);
    border-color: var(--primary-color, #007bff);
    color: white;
}

.pagination .page-link {
    color: var(--primary-color, #007bff);
}

.pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
}

/* Tombol Berbagi Media Sosial */
.social-share .btn {
    margin-right: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}

/* Carousel Hero Section */
.hero-carousel-section .carousel-item {
    height: 60vh; /* Tinggi slider dibuat lebih pendek agar memanjang */
    max-height: 550px; /* Batas tinggi maksimum juga dikurangi */
    min-height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-carousel-section .carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); /* Lapisan gelap untuk kontras teks */
}

.hero-carousel-section .carousel-caption {
    bottom: 20%;
    z-index: 10;
}

.hero-carousel-section .carousel-caption h1 {
    font-size: 3.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.hero-carousel-section .carousel-caption .lead {
    font-size: 1.5rem;
}

/* Penyesuaian untuk Tampilan Mobile */
.hero-section {
    padding: 4rem 0;
    background-size: cover;
    background-position: center center;
}

@media (max-width: 768px) {
    body {
        padding-top: 56px; /* Sesuaikan padding untuk navbar mobile yang lebih kecil */
    }

    .hero-carousel-section .carousel-item {
        height: 40vh; /* Tinggi slider lebih pendek lagi di mobile */
        min-height: 250px;
    }

    .hero-carousel-section .carousel-caption h1 {
        font-size: 2.2rem; /* Ukuran font lebih kecil untuk judul di mobile */
    }

    .hero-carousel-section .carousel-caption .lead {
        font-size: 1.1rem; /* Ukuran font lebih kecil untuk subjudul di mobile */
    }

    .hero-section {
        padding: 2rem 1rem; /* Kurangi padding di mobile */
    }

    .hero-section h1 {
        font-size: 2.2rem; /* Perkecil ukuran font judul */
    }

    .featured-products {
        padding-top: 2rem; /* Beri sedikit jarak di atas produk unggulan */
        padding-bottom: 2rem;
    }

    /* Penyesuaian Modal Video untuk Mobile */
    #videoModal .modal-dialog {
        margin: 0.5rem; /* Kurangi margin di sekitar modal */
    }

    #videoModal .modal-content {
        border-radius: 10px; /* Sudut lebih kecil di mobile */
    }

    #videoModal .modal-header {
        padding: 0.8rem 1rem; /* Padding lebih kecil di header */
    }

    #videoModal .modal-title {
        font-size: 1.1rem; /* Ukuran font judul lebih kecil */
    }

    #videoModal .modal-body {
        padding: 1rem 0.5rem; /* Padding lebih kecil di body */
    }

    /* Tampilkan tombol "Add to Cart" di mobile */
    .card-product .add-to-cart-btn {
        opacity: 1;
        bottom: 10px;
        padding: 6px 12px;
        font-size: 0.8rem;
        background-color: rgba(40, 167, 69, 0.85);
    }

    .card-product:hover .add-to-cart-btn {
        /* Nonaktifkan animasi hover di mobile agar tidak berkedip */
        bottom: 10px;
    }
}

/* Pastikan Toast terlihat di semua layar */
.toast-container {
    z-index: 1090 !important; /* Pastikan di atas elemen lain seperti header */
}


/* Penataan untuk Tombol Aksi di Kartu Produk (Perbaikan) */
.card-footer {
    display: flex;
    justify-content: space-between; /* Mendorong item ke ujung */
    align-items: center; /* Menyejajarkan item secara vertikal */
    padding: 0.75rem 1.25rem;
}

.like-container {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Jarak antara tombol suka dan angkanya */
}

.like-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.like-count {
    font-weight: 500;
    color: #6c757d; /* Warna abu-abu yang serasi */
    font-size: 0.9rem; /* Sedikit menyesuaikan ukuran font */
}

/* Gaya untuk Modal Video Transparan */
#videoModal .modal-content {
    background-color: rgba(0, 0, 0, 0.8); /* Latar belakang hitam semi-transparan */
    backdrop-filter: blur(10px); /* Efek blur untuk latar belakang */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Garis tepi tipis */
    border-radius: 15px; /* Sudut yang lebih bulat */
}

#videoModal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#videoModal .modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%); /* Membuat tombol close menjadi putih */
}

#videoModal .modal-title {
    color: #ffffff; /* Warna teks judul menjadi putih */
}

#videoModal .modal-body .ratio {
    border-radius: 10px; /* Sudut bulat untuk video */
    overflow: hidden; /* Memastikan video tidak keluar dari batas bulat */
}