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,
.card-product .btn-whatsapp {
    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 */
}

/* Tombol WhatsApp */
.card-product .btn-whatsapp {
    background-color: #25D366;
    color: white;
    border-color: #25D366;
}

.card-product .btn-whatsapp:hover {
    background-color: #1EBE57;
    color: white;
    border-color: #1EBE57;
    transform: scale(1.1);
}

/* Style for scrollable description in Quick View Modal */
.quick-view-description {
    max-height: 150px; /* Adjust as needed */
    overflow-y: auto;
    padding-right: 15px; /* Space for scrollbar */
    white-space: pre-wrap; /* Ensures line breaks and spacing are respected */
}

/* Image Zoom Styles */
.img-zoom-container {
    position: relative;
    cursor: zoom-in;
}

/* Thumbnail styles for Quick View */
.quick-view-thumbnails {
    gap: 10px; /* Space between thumbnails */
}
.quick-view-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}
.quick-view-thumb:hover {
    border-color: #007bff; /* Highlight on hover */
}
.quick-view-thumb.active {
    border-color: #0056b3; /* Stronger highlight for active thumb */
}

.img-zoom-lens {
    position: absolute;
    border: 1px solid #d4d4d4;
    width: 80px;
    height: 80px;
    display: none;
    z-index: 100; /* Make sure lens is on top */
    background-color: rgba(255,255,255,0.4); /* Make lens slightly visible */
}

.img-zoom-result {
    border: 1px solid #d4d4d4;
    /*set the size of the result div:*/
    width: 300px;
    height: 300px;
    position: absolute;
    right: -310px; /* Position it to the right of the modal content */
    top: 0;
    z-index: 9999;
    display: none; /* Hidden by default */
    background-repeat: no-repeat;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.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 */
}

/* Floating Social Menu - Side Tab Style */
.floating-social-menu {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.social-menu-toggle {
    width: 40px; /* Even Smaller */
    height: 40px; /* Even Smaller */
    background-color: var(--bs-primary);
    color: white;
    border: none;
    border-radius: 12px 0 0 12px; /* Adjusted radius */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px; /* Even Smaller */
    box-shadow: -2px 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.floating-social-menu.open .social-menu-toggle {
    background-color: var(--bs-danger);
}

.social-menu-toggle .icon-close { display: none; }
.floating-social-menu.open .social-menu-toggle .icon-open { display: none; }
.floating-social-menu.open .social-menu-toggle .icon-close { display: block; }

.social-icons-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px; /* This is the gap between icons */
    transition: all 0.4s ease-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.floating-social-menu.open .social-icons-container {
    max-height: 500px; /* Allow expansion */
    opacity: 1;
    margin-bottom: 12px; /* This is the correct, explicit spacing */
}

.social-item {
    position: relative; /* For absolute positioning of the label */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    text-decoration: none;
    color: #333;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.floating-social-menu.open .social-item {
    transform: translateX(0);
    opacity: 1;
}

/* Staggered animation delay */
.floating-social-menu.open .social-item:nth-child(1) { transition-delay: 0.25s; }
.floating-social-menu.open .social-item:nth-child(2) { transition-delay: 0.2s; }
.floating-social-menu.open .social-item:nth-child(3) { transition-delay: 0.15s; }
.floating-social-menu.open .social-item:nth-child(4) { transition-delay: 0.1s; }

.social-item:hover .icon-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.social-item:hover .social-icon {
    transform: scale(1.1);
}

.icon-label {
    position: absolute; /* Take out of flow */
    right: 48px; /* icon width (36px) + gap (12px) */
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background-color: #fff;
    padding: 4px 10px; /* Smaller padding */
    border-radius: 6px;
    font-size: 13px; /* Smaller font */
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none; /* Prevent hover issues */
}

.social-icon {
    width: 36px; /* Even Smaller */
    height: 36px; /* Even Smaller */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px; /* Even Smaller */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* Icon Colors */
.social-icon.facebook { background-color: #3b5998; }
.social-icon.instagram { background: #d6249f; background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%); }
.social-icon.twitter { background-color: #1da1f2; }
.social-icon.youtube { background-color: #cd201f; }

/* Back to Top Button */
.back-to-top-btn {
    display: none; /* Sembunyi secara default */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1040; /* Di bawah menu sosial */
    border: none;
    outline: none;
    background-color: var(--bs-secondary);
    color: white;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    text-align: center;
    line-height: 40px; /* Vertically center icon */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s, opacity 0.3s, visibility 0.3s;
}

.back-to-top-btn:hover {
    background-color: var(--bs-primary);
    color: white;
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--bs-danger);
    color: white;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 5px;
    z-index: 10;
}

.price-container del {
    font-size: 0.9rem;
}