/* =========================================
   1. GLOBAL STYLES & VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;700&family=Roboto:wght@300;400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    overflow-x: hidden; /* Mencegah scroll horizontal yang tidak diinginkan */
}

h1, h2, h3 {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   2. NAVBAR & MEGA MENU
   ========================================= */
.navbar {
    background-color: #e60000;
    position: sticky;
    top: 0;
    z-index: 999;
    /* Penting: relative agar mega menu posisinya mengikuti navbar */
    position: relative; 
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo img {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links > a, .dropbtn {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
}

.nav-search {
    font-size: 18px;
    cursor: pointer;
    color: #ffffff;
}

/* --- Dropdown Container --- */
.dropdown {
    position: static; /* Penting agar mega menu bisa full width */
}

.dropbtn {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* --- Mega Menu --- */
.mega-menu {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #f4f4f4;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 99;
    transition: all 0.3s ease;
    transform: translateY(10px);
}

.dropdown:hover .mega-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.mega-menu-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 30px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.menu-column h4 {
    color: #e60000;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    text-transform: uppercase;
}

.menu-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-column ul li {
    margin-bottom: 8px;
}

.menu-column ul li a {
    color: #333333;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    transition: color 0.2s;
}

.menu-column ul li a:hover {
    color: #e60000;
    font-weight: 500;
}

/* Hamburger Menu (Sembunyi di Desktop) */
.hamburger-menu {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #ffffff;
}

/* =========================================
   3. HERO SECTION (FULL BACKGROUND SLIDER)
   ========================================= */
.hero {
    position: relative;
    width: 100%;
    height: 85vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #000;
}

/* Container Slider memenuhi seluruh area hero */
.hero-slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.hero-slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease-in-out;
}

.slide {
    min-width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Memenuhi layar tanpa gepeng */
    object-position: center;
    display: block;
}

/* Overlay Gelap */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 2;
}

/* Konten Teks Hero */
.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
}

.hero-text {
    max-width: 600px;
}

.hero-text h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 30px;
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.btn-primary {
    display: inline-block;
    background-color: #f0f0f0;
    color: #000000;
    padding: 12px 24px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    transition: 0.3s;
}

.btn-primary:hover {
    background-color: #e60000;
    color: #ffffff;
}

/* Navigasi Dots Slider */
.slider-dots {
    position: absolute;
    bottom: 40px; 
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 14px;
    height: 14px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.dot.active {
    background-color: #e60000;
    border-color: #ffffff;
    transform: scale(1.2);
}

/* =========================================
   4. SECTION HEADERS & SUBTITLES
   ========================================= */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.section-header h2, .categories h2 {
    color: #e60000;
    font-size: 2.5rem;
    font-weight: 500;
}

.slider-arrows button {
    background-color: #e60000;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    margin-left: 5px;
}

.subtitle {
    color: #888;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 30px;
}

/* =========================================
   5. FEATURED PRODUCTS
   ========================================= */
.featured-products {
    padding: 60px 0;
}

.product-grid {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 15px;
}

.product-card {
    flex: 0 0 auto; 
    min-width: calc((100% - (4 * 15px)) / 5);
    background-color: #ffffff;
    color: #000000;
    padding: 20px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-top:solid 4px #fff;
    border-bottom:solid 4px #fff;
}

.product-card:hover {
    cursor: pointer;
    border-top:solid 4px #e60000;
    border-bottom:solid 4px #e60000;
}

.product-card h3 {
    color: #e60000;
    font-size: 14px;
    margin-bottom: 10px;
}

.product-card p {
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;

    /* === TAMBAHKAN KODE INI UNTUK MEMOTONG TEKS === */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Maksimal 3 baris */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card img {
    max-width: 100px;
    height: 170px;
}

/* =========================================
   6. CATEGORIES SECTION (Background + Icon + Overlay)
   ========================================= */
.categories {
    padding: 60px 0;
    background-color: #1a1a1a;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.category-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
    height: 220px; 
}

/* 1. Gambar Background */
.category-item > img:first-child {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 1; /* Kita hapus opacity di sini karena akan ditangani oleh overlay */
    filter: blur(0px); 
}

.category-item:hover > img:first-child {
    transform: scale(1.05);
    filter: blur(2px);   
}

/* 2. OVERLAY GELAP (Menggunakan pseudo-element ::after) */
.category-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient gelap dari bawah ke atas agar teks & ikon kontras */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.8) 100%);
    z-index: 1; /* Berada di atas gambar background */
    transition: background 0.3s ease;
    pointer-events: none; /* Agar klik mouse tembus ke elemen di bawahnya */
}

/* Efek hover: Overlay sedikit lebih terang agar gambar lebih terlihat */
.category-item:hover::after {
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.4) 100%);
}

/* 3. Ikon Logo */
.category-icon {
    position: absolute;
    top: 45%; 
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 70px; 
    max-height: 70px;
    width: auto;
    height: auto;
    z-index: 2; 
    transition: transform 0.3s ease;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.8)); 
}

.category-item:hover .category-icon {
    transform: translate(-50%, -50%) scale(1.1);
    filter: drop-shadow(2px 0px 0px white) 
          drop-shadow(-2px 0px 0px white) 
          drop-shadow(0px 2px 0px white) 
          drop-shadow(0px -2px 0px white);

}

/* 4. Judul Kategori */
.category-title {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.9);
    z-index: 3; /* Di atas overlay */
    transition: transform 0.3s ease;
}

.category-item:hover .category-title {
    transform: translateY(-5px);
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-item {
        height: 180px;
    }
    .category-icon {
        max-width: 50px;
        max-height: 50px;
    }
    .product-card { flex: 0 0 auto; min-width: calc((100% - (1 * 15px)) / 2); }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
    .category-item {
        height: 200px;
    }
    .product-card { flex: 0 0 auto; min-width: 100%; }
}

/* =========================================
   7. FOOTER
   ========================================= */
.footer {
    background-color: #111111;
    padding-top: 60px;
    border-top: 1px solid #333;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo img {
    width: 100px;
}

.footer-about h3, .footer-links h3 {
    color: #e60000;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-about p {
    color: #aaa;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-about .email {
    color: #fff;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: #aaa;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links ul li a:hover {
    color: #e60000;
}

.footer-bottom {
    background-color: #000000;
    padding: 20px 0;
    font-size: 12px;
    color: #666;
}

/* =========================================
   8. RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================= */

/* Tablet (Max 1024px) */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .hero-text h1 {
        font-size: 3rem;
    }
}

/* Mobile (Max 768px) */
@media (max-width: 768px) {
    /* --- Navbar Mobile --- */
    .hamburger-menu {
        display: block;
    }
    .nav-search {
        display: none; 
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background-color: #1a1a1a;
        padding: 20px;
        transition: right 0.3s ease-in-out;
        overflow-y: auto;
        border-left: 1px solid #333;
        z-index: 1000;
        gap: 0; /* Reset gap untuk mobile */
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links > a {
        padding: 15px 0;
        border-bottom: 1px solid #333;
        font-size: 16px;
    }

    /* --- Mobile Dropdown (Accordion) --- */
    .dropdown {
        position: relative;
        width: 100%;
    }
    
    .dropbtn {
        padding: 15px 0;
        border-bottom: 1px solid #333;
        justify-content: space-between;
        text-align: left;
        width: 100%;
    }

    .mega-menu {
        visibility: visible;
        opacity: 1;
        position: static;
        width: 100%;
        background-color: #222222;
        box-shadow: none;
        transform: none;
        display: none;
        padding: 0;
    }

    .menu-column h4 { text-align:left; }

    .mega-menu.active {
        display: block;
    }

    .mega-menu-inner {
        grid-template-columns: 1fr;
        padding: 10px 15px;
        gap: 15px;
    }

    .menu-column h4 {
        font-size: 14px;
        margin-bottom: 10px;
        color: #fff;
        border-bottom: none;
    }

    .menu-column ul li a {
        color: #aaa;
        font-size: 13px;
    }
    
    .dropbtn.active i {
        transform: rotate(180deg);
    }

    /* --- Hero Mobile --- */
    .hero {
        height: 70vh;
    }
    .hero-text h1 {
        font-size: 3rem;
    }
    .hero-overlay {
        background: rgba(0,0,0,0.6); 
    }
    .hero-content {
        text-align: center;
    }
    .hero-text {
        margin: 0 auto;
    }

    /* --- Section Grid Mobile --- */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-logo {
        margin-bottom: 20px;
    }
}

/* Mobile Kecil (Max 480px) */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    .hero-text h1 {
        font-size: 2.5rem;
    }
}

/* --- HERO TEXT SLIDER (Teks Berganti) --- */
.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    /* Kita butuh tinggi minimum agar layout tidak lompat saat teks berganti */
    min-height: 300px; 
    display: flex;
    align-items: center;
}

/* Sembunyikan semua teks secara default */
.hero-text-slide {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, transform 0.8s ease;
    max-width: 600px;
}

/* Class 'active' untuk menampilkan teks */
.hero-text-slide.active {
    opacity: 1;
    visibility: visible;
    /* Efek slide-up halus saat muncul */
    transform: translateY(-50%) translateX(0); 
}

/* Styling H1 di dalam slider */
.hero-text-slide h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 30px;
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

/* Responsive Mobile untuk Text Slider */
@media (max-width: 768px) {
    .hero-content {
        min-height: 400px; /* Beri ruang lebih di mobile karena teks biasanya turun ke bawah */
        justify-content: center;
    }
    .hero-text-slide {
        position: absolute;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        text-align: center;
    }
    .hero-text-slide.active {
        transform: translate(-50%, -50%);
    }
    .hero-text-slide h1 {
        font-size: 3rem;
    }
}


/* --- FEATURED PRODUCTS SLIDER --- */
.product-slider-wrapper {
    width: 100%;
    overflow: hidden; /* Sembunyikan produk yang keluar dari layar */
    padding: 10px 0; /* Beri sedikit ruang agar shadow tidak terpotong */
}

/* Ubah Grid menjadi Flexbox agar berjejer ke samping */
.product-grid {
    display: flex;
    gap: 15px;
    transition: transform 0.5s ease-in-out; /* Efek geser halus */
}

.product-card {
    /* Lebar card dihitung agar pas 5 card dalam 1 layar */
    min-width: calc((100% - (4 * 15px)) / 5); 
    background-color: #ffffff;
    color: #000000;
    padding: 20px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

/* --- UPDATE RESPONSIVE UNTUK CARD --- */
@media (max-width: 1024px) {
    .product-card {
        /* Tampilkan 3 card di tablet */
        min-width: calc((100% - (2 * 15px)) / 3);
    }
}

@media (max-width: 768px) {
    .product-card {
        /* Tampilkan 2 card di mobile landscape */
        min-width: calc((100% - (1 * 15px)) / 2);
    }
}

@media (max-width: 480px) {
    .product-card {
        /* Tampilkan 1 card di mobile portrait */
        min-width: 100%;
    }
}

/* Styling tambahan untuk tombol panah agar lebih interaktif */
.slider-arrows button {
    background-color: #e60000;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    margin-left: 5px;
    transition: background-color 0.3s;
    border-radius: 3px;
}

.slider-arrows button:hover {
    background-color: #b30000;
}

.slider-arrows button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* --- CATEGORIES SECTION (Gaya Thumbnail Full) --- */
.categories {
    padding: 60px 0;
    background-color: #1a1a1a;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px; /* Jarak antar gambar tipis saja seperti di contoh */
}

.category-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    /* Tidak perlu padding-bottom karena teks ada di dalam gambar */
    border-radius: 4px; /* Opsional: sedikit membulat di sudut */
}

/* Gambar Thumbnail */
.category-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Memastikan gambar mengisi kotak tanpa gepeng */
    display: block;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0.85; /* Sedikit redup agar teks putih di bawah terbaca */
}

/* Efek Hover: Gambar Zoom & Terang */
.category-item:hover img {
    transform: scale(1.05);
    opacity: 1;
}

/* Judul Kategori (Teks Putih di Bawah) */
.category-title {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    z-index: 2;
    transition: transform 0.3s ease;
}

/* Teks sedikit naik saat di-hover */
.category-item:hover .category-title {
    transform: translateY(-5px);
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 kolom di tablet/mobile */
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr; /* 1 kolom di HP kecil */
    }
}



/* =========================================
   9. PRODUCT MODAL (POPUP)
   ========================================= */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000; /* Di atas navbar */
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s ease;
}

.product-modal.active {
    visibility: visible;
    opacity: 1;
}

/* Overlay Gelap */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px); /* Efek blur di belakang modal */
}

/* Kotak Modal */
.modal-content {
    position: relative;
    background-color: #ffffff;
    color: #333333;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    overflow: hidden;
    z-index: 2001;
    transform: translateY(30px);
    transition: transform 0.4s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.product-modal.active .modal-content {
    transform: translateY(0);
}

/* Tombol Close (X) */
.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e60000;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: background 0.3s;
}

.close-modal:hover {
    background: #b30000;
}

/* Body Modal (Flexbox) */
.modal-body {
    display: flex;
    flex-direction: row;
}

/* Gambar Produk */
.modal-image {
    width: 40%;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.modal-image img {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
}

/* Info Teks */
.modal-info {
    width: 60%;
    padding: 40px 30px;
}

.modal-info h2 {
    color: #e60000;
    font-size: 2rem;
    margin-bottom: 5px;
}

.modal-subtitle {
    font-size: 12px;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.modal-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 25px;
}

/* Spesifikasi */
.modal-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #e60000;
}

.spec-item span {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.spec-item strong {
    font-size: 14px;
    color: #333;
}

.modal-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
}

/* Responsive Modal Mobile */
@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
    }
    .modal-image {
        width: 100%;
        padding: 20px;
    }
    .modal-image img {
        max-height: 200px;
    }
    .modal-info {
        width: 100%;
        padding: 25px 20px;
    }
    .modal-info h2 {
        font-size: 1.5rem;
    }
    .modal-specs {
        grid-template-columns: 1fr;
    }
}