/* Reset dasar */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  padding-top: 80px;
  justify-content: center;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  font-size: 14px;
  background-color: #ffffff;
  color: #222;
  line-height: 1.6;
}

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


.page-container > footer {
  margin-top: auto;
  background-color: #9d0000;
  color: white;
  text-align: center;
  padding: 12px 20px;
  font-size: 14px;
  border-top: 1px solid #ddd;
}

/* =================== HEADER =================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 25px 32px;
  background-color: #e2e2e2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
  gap: 10px;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.logo img {
  display: block;
  height: 50px;
}

/* =================== NAVIGASI =================== */
.Navigasi {
  display: flex;
  justify-content: center;
  background-color: #9d0000;
  border-radius: 5px;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.0888);
}

.Sub-Navigasi {
  list-style-type: none;
  display: flex;
  gap: 4px;
}

.Sub-Navigasi > li {
  position: relative;
}

.Sub-Navigasi a {
  color: white;
  font-weight: bold;
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s;
}

.Sub-Navigasi a:hover {
  background-color: white;
  color: black;
}

.Sub-Kategori {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ecf0f1;
  min-width: 190px;
  z-index: 1;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  list-style: none;
}

.Sub-Kategori li {
  border-bottom: 1px solid #ccc;
}

.Sub-Kategori li:last-child {
  border-bottom: none;
}

.Sub-Kategori a {
  color: #2c3e50;
  padding: 10px 16px;
  text-decoration: none;
}

.Sub-Kategori a:hover {
  background-color: #9d0000;
  color: white;
}

/* Desktop: tampil saat hover */
@media (min-width: 768px) {
  .Menu-Kategori:hover .Sub-Kategori {
    display: block;
    margin-bottom: 100px;
  }
}

/* =================== SEARCH BOX =================== */
.search-box {
  background: #eee;
  width: 40%;
  border-radius: 8px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
}

.search-box input[type="search"] {
  border: none;
  background: transparent;
  outline: none;
  padding: 5px 10px;
  width: 100%;
}

/* =================== HEADER NAV & BUTTON =================== */
.header-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-icon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.toko-button,
.profil-button {
  width: 40px;
  height: 40px;
  background-color: #9d0000;
  border-radius: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.3s ease;
  position: relative;
}

.toko-button:hover,
.profil-button:hover {
  background-color: white;
}

.toko-button img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.profil-button img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 20%;
}

.tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background-color: #9d0000;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: auto;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #9d0000 transparent;
}

.nav-icon:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

.tooltip:hover {
  color: #ccc;
}

.tooltip-profil {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background-color: #9d0000;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
  z-index: 100;
  text-align: left;
}

.tooltip-profil::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #9d0000 transparent;
}

.profil-button:hover ~ .tooltip-profil,
.tooltip-profil:hover {
  opacity: 1;
  visibility: visible;
}

.profil-nama,
.logout-link {
  color: white;
  text-decoration: none;
  display: block;
}

.profil-nama {
  font-weight: bold;
  margin-bottom: 4px;
}

.profil-nama:hover,
.logout-link:hover {
  color: #ccc;
}

.tooltip-divider {
  border: 0;
  height: 1px;
  background-color: white;
  margin: 4px 0;
  opacity: 0.4;
}
.Keranjang-Button {
  padding: 8px 16px;
  background-color: #9d0000;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.Keranjang-Button:hover {
  background-color: white;
  color: #222;
}

.cart-icon {
  width: 20px;
  height: 20px;
  fill: white;
  transition: fill 0.3s ease;
}

.cart-icon:hover {
  fill: #222;
}

.Register-Login-Button a {
  padding: 8px 16px;
  background-color: #9d0000;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.Register-Login-Button a:hover {
  background-color: #ffffff;
  color: #222;
}



/* =================== MODAL LOGIN & REGISTER =================== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fff;
  margin: 6% auto;
  padding: 30px;
  border-radius: 10px;
  width: 380px;
  box-shadow: 0 5px 10px rgba(0,0,0,0.3);
  position: relative;
  transition: width 0.3s ease;
}

.modal-content.register-active {
  width: 500px;
}

.close {
  position: absolute;
  top: 1px;
  right: 10px;
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #9d0000;
}

.tab-buttons {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  cursor: pointer;
  background-color: #f1f1f1;
  border: none;
  font-weight: bold;
}

.tab-btn.active {
  background-color: #9d0000;
  color: white;
}

.tab-content {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  height: 0;
  overflow: hidden;
  display: none;
}

.tab-content.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  height: auto;
  display: block;
}

.modal-content form {
  display: flex;
  flex-direction: column;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  padding: 8px;
  margin: 8px 0 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  resize: none;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  border-color: #9d0000;
  outline: none;
}

.btn-cancel, .btn-submit {
  padding: 10px;
  background-color: #9d0000;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.btn-cancel:hover, .btn-submit:hover {
  background-color: #117a65;
}

.btn-submit:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.form-group {
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 1px;
  color: #333;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 48%;
}

.login-link a {
  text-decoration: none;
  color: #9d0000;
}

.login-link a:hover {
  color: #117a65;
}

/* NAVIGATOR NAVBAR */
.container-navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 7vh;
  background: #e2e2e2;
  font-family: monospace;
  margin-top: 100px;
}

.ul-navbar {
  font-family: Arial, Helvetica, sans-serif;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 10px;
  box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.0888);
}

.li-navbar {
  display: block;
  padding: 10px 20px;
  cursor: pointer;
}

.ul-navbar:hover li:not(:hover):not(.active) {
  opacity: .2;
}

.li-navbar a {
  display: inline-block;
  color: rgb(0, 0, 0);
  text-decoration: none;
  transition: transform 0.3s ease, color 0.3s ease;
}

.li-navbar a:hover {
  transform: translateY(-3px);
  color: #34495e;
}

.li-navbar.active a {
  font-weight: bold;
  color: #000000;
  text-decoration: underline;
}

/* === Produk Section === */
.product-section {
  padding: 20px;
}

.daftar-produk {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
  margin-top: 20px;
}

.card-produk {
  width: 280px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 16px;
  box-sizing: border-box;
  text-align: left;
  margin-right: 20px;
}

.card-produk img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
}

.card-produk h3 {
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
}

.tabel-produk-info {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}

.tabel-produk-info th {
  text-align: left;
  vertical-align: top;
  padding-right: 8px;
  font-weight: bold;
  width: 80px;
}

.tabel-produk-info td {
  text-align: left;
  vertical-align: top;
  text-decoration: none
}

.card-link:hover .card-produk {
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
  transform: scale(1.02);
  transition: 0.3s;
  cursor: pointer;
}

.card-link {
  text-decoration: none;
  color: #222;
}


/* =================== FOOTER =================== */
footer {
  background-color: #9d0000;
  color: white;
  padding: 18px;
  text-align: center;
  font-size: 14px;
}

.footer-detail {
  max-width: 100%;   /* atau 1100px, sesuaikan */
  margin:  auto;
  padding: 10px 20px;
  background-color: #ebe9e9;
  position: relative;
}



@media (max-width: 768px) {
  .page-container {
    width: 1200px;
    max-width: 100%;
  }
  /* Header */
  .header {
    padding: 8px 8px;
    gap: 10px;
  }

  .header-center {
    flex-direction: row;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
  }

  .logo img {
    height: 40px;
  }
  
    .header-nav {
    display: none;
  }


  /* Menu utama (Home, Kategori, Tentang) */
.menu {
  display: flex;
  gap: 20px;
}

  .Menu-Kategori {
    position: relative;
  }

  .Menu-Kategori > .Sub-Kategori {
    display: none;
    position: static !important;  /* override paksa absolute */
    width: 100% !important;
    margin: 5px 0px 0px 0px;
    padding: 0;
    list-style: none;
    border: 1px solid #ccc;
    border-radius: 0 0 8px 8px;
    box-shadow: none;
    background: #fff;
  }

  /* --- Tampilan Mobile (klik/tekan) --- */
  .Menu-Kategori { position: relative; }
  .Menu-Kategori:focus-within .Sub-Kategori {
    display: block;
    position: static; /* biar mengalir ke bawah */
  }

  .Button-Menu {
    cursor: pointer;
    padding: 8px;
    color: #fff;
    border-radius: 0px;
  }


  .Navigasi {
  background: #9d0000; /* Merah */
  height: 40px;
  width: 100%;
  padding: 0px;
}


.Sub-Navigasi {
    position: relative;
    z-index: 2000; /* lebih tinggi */
    bottom: 0px;
    height: 100%;
    width: 100%;
}

.Sub-Navigasi > li {
    width: 100%;
    align-items: center;
}

.Sub-Navigasi > li a {
    width: 100%;
    text-align: center;
    padding: 9px 0px 9px 0px;
}

.Sub-Kategori > li {
    border-bottom :none;
}

.Sub-Kategori > li a {
    padding: 2px 0px 2px 10px;
    display: block;
    color: rgb(50, 50, 50);
    font-weight: bold;
    text-decoration: none;
    font-weight: normal;
    text-align: left;
}

  .container-navbar {
    display: none;
  }

  .search-box {
    width: 100%;
  }

.modal {
  display: none;
  justify-content: center; /* Center horizontal */
  align-items: flex-start;     /* Center vertical */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  overflow-y: auto;
  margin-top: auto;
  padding: 75px; /* biar ada jarak di layar kecil */
  padding-top: 0px;
}

.modal.show {
  display: flex;
}



.modal-content {
  background-color: #ffffff;
  padding: 25px;
  border-radius: 7px;
  width: auto;
  max-width: 100%; /* Biar nggak terlalu lebar */
  box-shadow: 0 5px 10px rgba(0,0,0,0.3);
  position: relative;
  margin: auto; /* pastikan auto center */
}

.form-group {
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-row {
  flex: 2;
  max-width: 100%;
}

.tab-buttons {
  display: flex;
  justify-content: center;
  margin-top: 0px;
  margin-bottom: 12px;
  width: 100%;
}

  .modal-content {
    margin-top: 210px;
  }

.close {
  position: absolute;
  top: -1px;
  right: 6px;
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
}

/* Produk */
  .product-section {
    margin-top: 150px;
    padding : 10px 10px 10px 10px;
  }
  
  .product-section h1 {
    font-size: 14px;
    padding: 10px 0px 0px 0px;
  }

  .card-link h3 {
    font-size: 13px;
    padding: 0px;
    margin: 0;
  }

  .harga-produk {    
    font-size: 12px;
  }


  .tabel-produk-info {
    font-size: 12px;
  }

  .tabel-produk-info th {
    width: 10px;
    color: #117a65;
  }

  .daftar-produk {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0px;
    margin-top: 0px;
  }

  .card-produk {
    width: 100%; /* satu kolom di HP */
    padding: 4px;
    height: 250px;
    overflow-y: auto;
  }

  .card-produk img {
    height: 140px;
  }

  /* Footer */
  footer {
    font-size: 12px;
    padding: 12px;
  }

}
