/* --- CSS GABUNGAN --- */
:root {
    --primary-color: #5c4033;
    /* Coklat Pawon */
    --secondary-color: #ebb866;
    --accent-color: #d2b48c;
    --wa-color: #01722a;
}

body {
    font-family: 'France', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* HEADER UTAMA */
header {
    background-color: var(--primary-color);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

#navMenuLeft {
    display: flex;
    flex-direction: grid;
    gap: 15px;
    margin: 0;
    padding: 0;
}

#navMenuLeft li {
    list-style: none;
}

/* BRAND / LOGO */
.nav-brand {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--secondary-color);
    text-decoration: none;
    /* text-shadow dihapus agar terlihat lebih bersih, opsional */
}

.nav-brand:hover {
    color: var(--accent-color);
    /* Menggunakan variabel agar konsisten */
}

.nav-logo {
    width: 40px;
    height: auto;
    margin-right: 10px;
}

/* NAV MENU (UL) */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

/* LINK NAVIGASI */
.nav-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--accent-color);
}

/* Efek garis bawah saat hover */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* BAGIAN KANAN (CART + HAMBURGER) */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* --- HAMBURGER MENU (CSS Anda yang Diperbaiki) --- */
.hamburger {
    display: none;
    /* Default hidden di desktop */
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--secondary-color);
    background: none;
    border: none;
    padding: 5px;
    /* Tambahan padding agar area klik lebih luas */
}

.cart-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    color: var(--accent-color);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
}

/* MAIN CONTENT */
main {
    padding: 20px 5%;
    min-height: 60vh;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 30px;
    margin-top: 20px;
}

/* PRODUCT GRID */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.product-card {
    background: var(--accent-color);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 10px;
}

.product-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3rem;
    /* Fixed height for title alignment */
}

.product-desc {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.add-to-cart-btn {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: background 0.3s;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

/* CAROUSEL */
.carousel-container {
    width: 1280px;
    height: 720px;
    margin: 20px auto;
    overflow: hidden;
    position: relative;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    aspect-ratio: 16/7;
    /* Maintain aspect ratio */
}

.carousel-slide {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#prevBtn,
#nextBtn {
    top: 25%;
    transform: translateY(-50%);
    margin: 0;
    left: 15px;
    right: 15px;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}

.dot {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* CART MODAL */
.cart-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: blur(2.5px);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
}

.cart-content {
    background: var(--secondary-color);
    padding: 25px;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.cart-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 5px;
}

.close-cart {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
}

.close-cart:hover {
    color: #ff0000;
}

.cart-item-container {
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 0;
}

#cartItems #details {
    text-align: center;
    margin-top: 20px;
    color: var(--primary-color);
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-name {
    font-weight: 600;
    display: block;
}

.cart-item-price {
    font-size: 0.9rem;
    color: var(--primary-color);
}

.remove-btn {
    margin-top: 5px;
    margin-bottom: 5px;
    background: #ff0000;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 10px;
}

.wa-btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--wa-color);
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    transition: background 0.3s;
    gap: 10px;
}

.wa-btn-checkout:hover {
    background-color: var(--primary-color);
    color: #ff0000;
}

.cart-total {
    font-weight: bold;
    font-size: 1.3rem;
    text-align: right;
    border-top: 2px solid #333;
    padding-top: 15px;
    color: var(--primary-color);
}

/* FOOTER */
footer {
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 40px 5% 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section-title {
    color: var(--accent-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: inline-block;
}

.footer-subtitle {
    font-size: 1rem;
    font-weight: bold;
    color: #ff0000;
    margin-bottom: 10px;
}

.footer-subtitle ul {
    padding-left: 20px;
    margin: 0;
}

.footer-subtitle li {
    margin-bottom: 8px;
    list-style-type: disc;
}

.footer-links a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ff0000;
}

.btn-maps {
    display: inline-block;
    margin-top: 10px;
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-copyright {
    text-align: center;
    border-top: 1px solid var(--secondary-color);
    padding-top: 20px;
    font-size: 0.9rem;
}

/* FLOATING WHATSAPP & BACK TO TOP */
.wa-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

#waFloatingBtn {
    background: var(--wa-color);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

#waFloatingBtn:hover {
    transform: scale(1.1);
}

#waFloatingBtn img {
    width: 35px;
    height: 35px;
    filter: brightness(0) invert(1);
}

.wa-chatbox {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 300px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wa-chat-header {
    background: var(--wa-color);
    color: var(--secondary-color);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.wa-chat-header button {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.2rem;
    cursor: pointer;
}

.wa-chat-body {
    padding: 15px;
}

.wa-msg-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    background: var(--accent-color);
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.wa-msg-btn:hover {
    background: var(--secondary-color);
}

.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.back-to-top:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Media Queries */
/* for laptop or computer and tablet */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .header-left {
        gap: 5px;
    }

    #navMenuLeft {
        gap: 5px;
    }

    /* 1. Munculkan Tombol Hamburger */
    .hamburger {
        display: block;
    }

    /* 2. Ubah Menu Navigasi jadi Dropdown/Hidden */
    .nav-menu {
        position: absolute;
        top: 100%;
        /* Tepat di bawah header */
        left: 0;
        width: 100%;
        background: var(--primary-color);
        flex-direction: column;
        /* Susun ke bawah */
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);

        /* KUNCI PERBAIKAN: Default sembunyi */
        display: none;
    }

    .nav-menu li {
        margin: 10px 0;
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 10px;
        width: 100%;
    }

    .nav-menu a:hover {
        background: var(--accent-color);
        color: var(--primary-color);
    }

    /* 3. Class Active (Dimunculkan oleh JS) */
    .nav-menu.active {
        display: flex;
        /* Munculkan kembali saat active */
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    /* Hapus efek hover garis bawah di mobile agar lebih rapi */
    .nav-link::after {
        display: none;
    }

    main {
        padding: 15px 3%;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .product-card {
        padding: 10px;
    }

    .product-card img {
        height: 120px;
    }

    .product-title {
        font-size: 0.9rem;
        height: 2.7rem;
    }

    .product-desc {
        font-size: 0.7rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .add-to-cart-btn {
        padding: 8px;
        font-size: 0.9rem;
    }

    .carousel-container {
        top: 200px;
        width: 100%;
        aspect-ratio: 16/9;
    }

    .carousel-btn {
        padding: 10px;
        font-size: 16px;
        width: 40px;
        height: 40px;
    }

    .carousel-dots {
        bottom: 15px;
    }

    .carousel-slide {
        height: auto;
    }

    .carousel-slide img {
        height: auto;
    }

    .prevBtn,
    .nextBtn {
        top: 25%;
    }

    .dot {
        width: 8px;
        height: 8px;
    }

    .dot.active {
        transform: scale(1);
    }

    .cart-modal {
        align-items: flex-start;
        padding-top: 50px;
    }

    .cart-content {
        width: 95%;
        max-width: none;
        max-height: 90vh;
    }

    .cart-header {
        font-size: 1.2rem;
    }

    .cart-count {
        font-size: 0.5rem;
        padding: 1px 4px;
    }

    .cart-items-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item-details {
        margin-bottom: 10px;
    }

    .cart-item-name {
        font-size: 0.9rem;
    }

    .cart-item-price {
        font-size: 0.8rem;
    }

    .remove-btn {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .wa-btn-checkout {
        padding: 12px;
        font-size: 0.9rem;
    }

    .cart-total {
        font-size: 1.1rem;
    }

    footer {
        padding: 30px 3% 15px;
    }

    .footer-grid {
        gap: 20px;
    }

    .footer-section-title {
        font-size: 1.1rem;
    }

    .footer-subtitle {
        font-size: 0.95rem;
    }

    .footer-subtitle ul {
        padding-left: 15px;
    }

    .footer-subtitle li {
        margin-bottom: 6px;
    }

    .footer-links a {
        font-size: 0.9rem;
    }

    .btn-maps {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .footer-copyright {
        font-size: 0.8rem;
    }

    .wa-button {
        bottom: 20px;
        right: 20px;
    }

    #waFloatingBtn {
        width: 50px;
        height: 50px;
    }

    #waFloatingBtn img {
        width: 28px;
        height: 28px;
    }

    .wa-chatbox {
        width: 250px;
        bottom: 70px;
    }

    .wa-chat-header {
        font-size: 0.9rem;
        padding: 10px;
    }

    .wa-chat-header button {
        font-size: 1rem;
    }

    .wa-chat-body {
        padding: 10px;
    }

    .wa-msg-btn {
        padding: 8px;
        font-size: 0.9rem;
    }

    .back-to-top {
        bottom: 80px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .back-to-top.show {
        opacity: 1;
        visibility: visible;
    }
}

/* for mobile devices */
@media screen and (max-width: 480px) {
    body {
        font-size: 12px;
    }

    .header-left {
        gap: 5px;
    }

    #navMenuLeft {
        gap: 5px;
    }

    /* 1. Munculkan Tombol Hamburger */
    .hamburger {
        display: block;
    }

    /* 2. Ubah Menu Navigasi jadi Dropdown/Hidden */
    .nav-menu {
        position: absolute;
        top: 100%;
        /* Tepat di bawah header */
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        flex-direction: column;
        /* Susun ke bawah */
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);

        /* KUNCI PERBAIKAN: Default sembunyi */
        display: none;
    }

    .nav-menu li {
        margin: 10px 0;
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 10px;
        width: 100%;
    }

    .nav-menu a:hover {
        background: var(--accent-color);
        color: var(--primary-color);
    }

    /* 3. Class Active (Dimunculkan oleh JS) */
    .nav-menu.active {
        display: flex;
        /* Munculkan kembali saat active */
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .nav-link::after {
        display: none;
    }

    main {
        padding: 10px 2%;
    }

    h1 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .product-card img {
        height: 100px;
    }

    .product-title {
        font-size: 0.8rem;
        height: 2.4rem;
    }

    .product-desc {
        font-size: 0.65rem;
    }

    .product-price {
        font-size: 0.9rem;
    }

    .add-to-cart-btn {
        padding: 6px;
        font-size: 0.8rem;
    }

    .carousel-container {
        top: 200px;
        width: 100%;
        aspect-ratio: 16/9;
    }

    .carousel-btn {
        padding: 8px;
        font-size: 14px;
        width: 35px;
        height: 35px;
    }

    .carousel-dots {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
    }

    .carousel-slide {
        height: auto;
    }

    .carousel-slide img {
        height: auto;
    }

    .prevBtn,
    .nextBtn {
        position: absolute;
        top: 25%;
        right: 10px;
        transform: translateY(-50%);
        background-color: var(--primary-color);
        color: var(--secondary-color);
        border: none;
        padding: 8px;
        cursor: pointer;
    }

    .dot {
        width: 6px;
        height: 6px;
    }

    .dot.active {
        transform: scale(1);
    }

    .cart-modal {
        align-items: flex-start;
        padding-top: 40px;
    }

    .cart-content {
        width: 100%;
        max-width: none;
        max-height: 95vh;
        padding: 15px;
    }

    .cart-header {
        font-size: 1rem;
    }

    .cart-count {
        font-size: 0.4rem;
        padding: 1px 3px;
    }

    .cart-item-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item-details {
        margin-bottom: 8px;
    }

    .cart-item-name {
        font-size: 0.85rem;
    }

    .cart-item-price {
        font-size: 0.75rem;
    }

    .remove-btn {
        font-size: 0.6rem;
        padding: 3px 6px;
    }

    .wa-btn-checkout {
        padding: 10px;
        font-size: 0.8rem;
    }

    .cart-total {
        font-size: 1rem;
    }

    footer {
        padding: 20px 2% 10px;
    }

    .footer-grid {
        gap: 15px;
    }

    .footer-section-title {
        font-size: 1rem;
    }

    .footer-subtitle {
        font-size: 0.9rem;
    }

    .footer-subtitle ul {
        padding-left: 10px;
    }

    .footer-subtitle li {
        margin-bottom: 5px;
    }

    .footer-links a {
        font-size: 0.85rem;
    }

    .btn-maps {
        font-size: 0.75rem;
        padding: 3px 6px;
    }

    .footer-copyright {
        font-size: 0.75rem;
    }

    .wa-button {
        bottom: 15px;
        right: 15px;
    }

    #waFloatingBtn {
        width: 45px;
        height: 45px;
    }

    #waFloatingBtn img {
        width: 25px;
        height: 25px;
    }

    .wa-chatbox {
        width: 220px;
        bottom: 65px;
    }

    .wa-chat-header {
        font-size: 0.85rem;
        padding: 8px;
    }

    .wa-chat-header button {
        font-size: 0.9rem;
    }

    .wa-chat-body {
        padding: 8px;
    }

    .wa-msg-btn {
        padding: 7px;
        font-size: 0.85rem;
    }

    .back-to-top {
        bottom: 70px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .back-to-top.show {
        opacity: 1;
        visibility: visible;
    }
}