*,
html {
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #2196f3;
  --secondary-color: #f50057;
  --bg: white;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  border: none;
  text-decoration: none;
}

body {
  font-family: "poppins", sans-serif;
  background-color: white;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ================================== */
/* STYLING DESKTOP (SEMUA DI ATAS) */
/* ================================== */

/* --- Navbar --- */
.container-navbar {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 7%;
  background-color: var(--bg);
  border-bottom: 2px solid var(--primary-color);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
}

.img-navbar {
  width: 250px;
  height: auto;
  display: block;
  margin-left: -30px;
  margin-top: 5px;
}

.container-navbar .navbar-list a {
  display: inline-block;
  font-size: 1.4rem;
  margin: 0 1rem;
  color: black;
  position: relative;
  padding-bottom: 0.7rem;
}

.container-navbar .navbar-list a::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s linear;
}

.container-navbar .navbar-list a:hover::after {
  transform: scaleX(0.7);
}

.container-navbar .navbar-extra a {
  color: black;
  margin: 0 0.5rem;
}

.container-navbar .navbar-extra a:hover {
  color: var(--primary-color);
}

.container-navbar .navbar-list {
  margin-top: 12px;
}

#hamburger-menu {
  display: none;
}

/* --- Language Dropdown --- */
.language-dropdown {
  position: relative;
  display: inline-block;
  margin-right: 10px;
  z-index: 1000;
  transform: translateY(-4px);
}

.language-dropdown .lang-btn {
  background-color: transparent;
  color: #333;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.language-dropdown .lang-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.language-dropdown .lang-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  transition: transform 0.2s ease;
  position: relative;
  top: 1px;
}

.language-dropdown:hover .lang-btn svg {
  transform: rotate(180deg);
}

.language-dropdown .lang-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: white;
  min-width: 160px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.language-dropdown .lang-content a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  font-size: 15px;
  transition: background 0.2s ease;
}

.language-dropdown .lang-content a:hover {
  background-color: #f3f3f3;
}

.language-dropdown:hover .lang-content {
  display: block;
}

/* --- Product Dropdown (Submenu) --- */
.nav-item-dropdown {
  position: relative;
  display: inline-block;
  margin: 0 1rem;
  padding-bottom: 0.7rem;
}

.nav-item-dropdown .dropdown-btn {
  display: flex;
  align-items: center;
  padding-bottom: 0;
  margin: 0;
}

.dropdown-icon {
  width: 1rem;
  height: 1rem;
  margin-left: 0.3rem;
  transition: transform 0.3s ease;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  min-width: 250px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
  border-radius: 5px;
  z-index: 1000;
  padding: 0.5rem 0;
}

.submenu-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: black;
  font-size: 1.2rem;
  margin: 0;
}
.submenu-link:hover {
  background-color: #f0f0f0;
  color: var(--primary-color);
}
.submenu-link::after {
  display: none;
}

.nav-item-dropdown:hover .dropdown-menu {
  display: block;
}

.nav-item-dropdown:hover .dropdown-icon {
  transform: rotate(180deg);
}

/* --- Navbar Extra & Search Form --- */
.navbar-extra {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Jarak rapat antar ikon */
}

.navbar-extra a {
  margin-left: 0;
  margin-right: 0;
  padding: 0;
}

.navbar-extra a#shopping-bag,
.navbar-extra a#hamburger-menu {
  margin-left: 0.5rem; /* Jarak antar ikon utama */
}

/* Styling Form Pencarian (Default Sembunyi) */
.search-form-inline {
  display: flex;
  align-items: center;
  position: relative;
  max-width: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}

/* Form Search Aktif (via JS) */
.search-form-inline.active {
  max-width: 180px !important; /* Lebar form saat aktif */
  opacity: 1;
  margin-right: 0.5rem;
}

.search-form-inline input[type="search"] {
  width: 180px;
  padding: 8px 80px 8px 15px; /* Ruang untuk 2 tombol */
  border: 1px solid var(--primary-color);
  border-radius: 50px;
  font-size: 1rem;
  background-color: #fff;
  -webkit-appearance: none;
  appearance: none;
}
.search-form-inline input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-form-inline button[type="submit"] {
  position: absolute;
  right: 0px;
  top: 0;
  bottom: 0;
  height: 100%;
  width: 40px;
  background: none;
  color: var(--primary-color);
  cursor: pointer;
  border-radius: 0 50px 50px 0;
  border: none;
  padding: 0;
}
.search-form-inline button[type="submit"] i {
  width: 20px;
  height: 20px;
}

/* Tombol Reset (Silang) */
#reset-search-btn {
  position: absolute;
  right: 40px; /* Di sebelah kiri tombol submit */
  top: 0;
  bottom: 0;
  height: 100%;
  width: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #666;
  z-index: 1000;
  display: none; /* Sembunyi by default, diatur JS */
}
#reset-search-btn i {
  width: 1.2rem;
  height: 1.2rem;
}

/* --- Product Hero Section --- */
.product-hero {
  padding: 150px 7% 50px 7%;
  text-align: center;
  background-color: #f0f8ff;
}

.product-hero h1 {
  font-size: 3em;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.product-hero p {
  font-size: 1.2em;
  color: #333;
}

/* --- Product Category Section --- */
.product-category-section {
  padding: 4rem 7%;
}

.product-category-section .category-main-title {
  font-size: 2.5em;
  color: #333;
  margin-bottom: 3rem;
  text-align: center;
  font-weight: 700;
}

/* Judul Sub-Kategori */
.subcategory-title {
  font-size: 1.8em;
  color: var(--primary-color);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  text-align: left;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

/* --- Product Grid & Cards --- */
.product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: flex-start; /* Produk mulai dari kiri */
}

.product-card {
  flex: 1 1 calc(25% - 30px);
  max-width: calc(25% - 30px);
  display: flex;
  flex-direction: column;
  /* justify-content: space-between; (Ini diganti oleh flex-grow) */
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 20px;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-card img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  margin-bottom: 15px;
}

/* Judul Produk (H3) */
.product-card h3 {
  font-size: 1.3em;
  color: #333;
  margin-bottom: 5px;
  /* Kunci Kesejajaran (Tinggi Min 3 baris) */
  min-height: 5.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Paragraf umum di dalam kartu */
.product-card p {
  font-size: 0.9em;
  color: #333;
  line-height: 1.5;
  text-align: left;
  margin-bottom: 5px; /* Jarak antar baris info */
}

/* Wrapper Info Produk (meregang) */
.product-info-wrapper {
  flex-grow: 1; /* Kunci Kesejajaran (Mendorong ke bawah) */
  text-align: left;
  margin-bottom: 15px;
  width: 100%;
}

.product-info-wrapper p strong {
  color: #000;
  font-weight: 600;
}

/* Tombol TKDN */
.tkdn-button {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--primary-color);
  background-color: #eaf6ff;
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.tkdn-button:hover {
  background-color: #d4eaff;
  text-decoration: none;
}

/* Info Stok */
.product-card .stock {
  display: block;
  color: #28a745;
  font-weight: 600;
  margin-bottom: 15px;
}

/* Tombol Detail */
.product-card .detail-link {
  display: block;
  background-color: var(--primary-color);
  color: white;
  padding: 10px;
  border-radius: 5px;
  transition: background-color 0.3s;
  margin-top: auto; /* Kunci Kesejajaran (Dorong ke bawah) */
}

.product-card .detail-link:hover {
  background-color: #0056b3;
}

/* --- Floating WA Button --- */
.floating-whatsapp {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px 10px 10px;
  min-width: 60px;
  height: 60px;
  background-color: #25d366;
  color: white;
  border-radius: 45%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s;
  overflow: hidden;
}

.floating-whatsapp i {
  width: 30px;
  height: 30px;
}

.floating-whatsapp:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.whatsapp-text {
  white-space: nowrap;
  font-size: 1em;
  font-weight: 500;
  color: white;
  margin-left: 10px;
  opacity: 0;
  max-width: 0;
  transition: opacity 0.3s, width 0.5s ease-in-out;
}

.floating-whatsapp.show-text .whatsapp-text {
  opacity: 1;
  max-width: 150px;
}

/* --- Footer --- */
.container-footer {
  background-color: #333;
  color: white;
  padding: 3rem 7%;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.footer-left {
  max-width: 45%;
  padding-right: 20px;
}

.footer-left .h2-footer {
  font-size: 1.8em;
  margin-bottom: 10px;
  font-weight: 700;
}

.footer-left .h3-footer {
  font-size: 1em;
  font-weight: 400;
  line-height: 1.6;
  opacity: 0.8;
}

.footer-right {
  max-width: 50%;
  display: flex;
  flex-direction: column;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 15px;
}

.contact-item i {
  width: 20px;
  height: 20px;
  color: var(--primary-color);
  margin-top: 5px;
  flex-shrink: 0;
}

.contact-item p {
  font-size: 1em;
  line-height: 1.4;
  margin: 0;
}

/* ==================================================================== */
/* =========== BLOK MEDIA QUERY (SEMUA DI BAWAH) ========= */
/* ==================================================================== */

/* Laptop */
@media (max-width: 1366px) {
  html {
    font-size: 75%;
  }
}

/* Tablet (Lebar) */
@media (max-width: 1200px) {
  .product-card {
    flex: 1 1 calc(33.333% - 30px);
    max-width: calc(33.333% - 30px);
  }
}

/* Tablet (Sempit) & HP (Besar) */
@media (max-width: 768px) {
  .product-card {
    flex: 1 1 calc(50% - 30px);
    max-width: calc(50% - 30px);
  }
}

/* Tablet & HP (Umum) */
@media (max-width: 758px) {
  html {
    font-size: 62.5%;
  }

  /* --- Perbaikan Navbar Mobile --- */
  #hamburger-menu {
    display: inline-block;
  }

  /* 1. Mengecilkan Logo di Mobile */
  .img-navbar {
    width: 180px;
    margin-left: -15px;
  }

  /* 2. Menyembunyikan Teks "Bahasa" di Mobile */
  .language-dropdown .lang-btn .lang-text {
    display: none; /* Sembunyikan teks */
  }
  .language-dropdown .lang-btn {
    padding: 8px; /* Kecilkan padding tombolnya */
    gap: 2px; /* Rapatkan ikon globe dan panah */
  }
  /* --- Akhir Perbaikan Navbar --- */

  .container-navbar .navbar-list {
    position: absolute;
    top: 100%;
    right: -100%;
    background-color: white;
    width: 30rem;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    transition: right 0.3s ease;
    display: flex;
    margin: 0;
    font-size: 2rem;
    z-index: 9999;
  }

  .container-navbar .navbar-list.active {
    right: 0;
  }

  .container-navbar .navbar-list a::after {
    display: none;
  }

  /* Dropdown "PRODUCTS" (Mobile) */
  .container-navbar .navbar-list.active .nav-item-dropdown {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .container-navbar .navbar-list.active .nav-item-dropdown .dropdown-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0;
    margin: 1.5rem 0;
    font-size: 2rem;
  }
  .container-navbar .navbar-list.active .dropdown-icon {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    transition: transform 0.3s ease;
    transform: rotate(0deg);
  }
  .container-navbar
    .navbar-list.active
    .nav-item-dropdown.active
    .dropdown-icon {
    transform: rotate(180deg);
  }
  .container-navbar .navbar-list.active .dropdown-menu {
    position: static;
    display: none;
    width: 100%;
    background-color: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
  }
  .container-navbar
    .navbar-list.active
    .nav-item-dropdown.active
    .dropdown-menu {
    display: block;
  }
  .container-navbar .navbar-list.active .dropdown-menu .submenu-link {
    display: block;
    font-size: 1.8rem; /* Font submenu lebih kecil */
    color: #555;
    margin: 0;
    padding: 0.7rem 0 0.7rem 1.6rem; /* Indentasi */
    width: 100%;
  }
  .container-navbar .navbar-list.active .submenu-link::after {
    display: none;
  }
  .container-navbar .navbar-list.active > a.a-navbar,
  .container-navbar .navbar-list.active > .nav-item-dropdown {
    margin: 1rem 0;
    padding: 0;
    width: 100%;
  }
  .container-navbar .navbar-list.active .nav-item-dropdown .dropdown-btn {
    margin: 0;
  }

  .container-hero {
    padding-top: 80px;
  }

  /* Form Pencarian (Mobile) */
  .search-form-inline {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.5rem 7%;
    background-color: transparent;
    box-shadow: none;
    border-top: none;
    z-index: 999;
    max-width: 0;
    width: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    overflow: visible;
  }

  .search-form-inline.active {
    max-width: 100%;
    opacity: 1;
  }

  .search-form-inline input[type="search"] {
    flex: 1;
    margin-right: 0.5rem;
    /* Perbaikan form terpotong */
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 1.4rem;
  }
  .search-form-inline button {
    height: auto;
    padding: 6px 8px;
  }
  .search-form-inline button i {
    width: 18px;
    height: 18px;
  }

  /* Footer (Mobile) */
  .container-footer {
    flex-direction: column;
    text-align: center;
  }
  .footer-left,
  .footer-right {
    max-width: 100%;
    padding: 0;
    margin-bottom: 30px;
    text-align: center;
  }
  .footer-right {
    align-items: center;
  }
  .contact-item {
    align-items: center;
    flex-direction: column;
    text-align: center;
    gap: 5px;
  }
  .contact-item i {
    margin-top: 0;
  }
}

/* HP (Lebar Sangat Sempit) */
@media (max-width: 480px) {
  .product-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* HP (Umum) */
@media (max-width: 450px) {
  html {
    font-size: 55%;
  }

  /* Floating WA (Mobile) */
  .floating-whatsapp {
    height: 50px;
    min-width: 50px;
    border-radius: 25px;
    padding: 5px 15px 5px 5px;
  }
  .floating-whatsapp i {
    width: 25px;
    height: 25px;
  }
}
