/* ================================
   General Layout Styles
================================= */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* agar footer terdorong ke bawah */
    padding: 20px;     /* pakai padding bukan margin biar tidak ganggu fixed element */
    box-sizing: border-box;
    padding-bottom: 80px; /* ruang ekstra agar konten tidak ketutup navbar mobile */
}

main {
    flex: 1; /* konten utama fleksibel dorong footer */
}

/* ================================
   Product List Styles (Index Page)
================================= */
.product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product {
    border: 1px solid #dee2e6;
    padding: 10px;
    width: 200px;
    text-align: center;
}

.product img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* ================================
   Table Styles (Admin Page)
================================= */
table {
    width: 100%;
    border-collapse: collapse;
}

table, th, td {
    border: 1px solid #dee2e6;
    padding: 10px;
}

table img {
    max-width: 100px;
    height: auto;
}

/* ================================
   Form Styles (Admin Page)
================================= */
form {
    margin-bottom: 20px;
}

form label {
    display: block;
    margin: 5px 0;
}

form input,
form textarea {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
}

form input[type="file"] {
    padding: 3px;
}

/* ================================
   Button Styles
================================= */
button {
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background-color: #218838;
}

/* ================================
   Image Preview (Admin Form)
================================= */
#image-preview {
    margin-top: 10px;
    max-width: 100px;
}

/* ================================
   Footer Styles
================================= */
.footer {
    margin-top: auto;              
    text-align: center;
    padding: 10px 0;
    color: #000 !important;
    font-size: 0.9rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ================================
   Mobile Bottom Navigation
================================= */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #fff;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1050;
}

.mobile-bottom-nav .mobile-nav-items {
  display: flex;
  justify-content: space-around;
  width: 100%;
}

.mobile-bottom-nav .mobile-nav-item {
  flex: 1;
  text-align: center;
  color: #555;
  font-size: 12px;
  text-decoration: none;
  padding: 6px 0;
}

.mobile-bottom-nav .mobile-nav-item i {
  display: block;
  font-size: 18px;
  margin-bottom: 2px;
}

.mobile-bottom-nav .mobile-nav-item.active,
.mobile-bottom-nav .mobile-nav-item:hover {
  color: #007bff;
}

/* ================================
   Responsive Adjustments
================================= */

/* Sembunyikan bottom nav di layar besar */
@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
}

/* Atur font lebih kecil + 2 kolom di mobile */
@media (max-width: 576px) {
  body {
    font-size: 14px; /* font default kecil */
  }

  .card-title {
    font-size: 14px;
  }

  .card-text {
    font-size: 12px;
  }

  .mobile-bottom-nav .mobile-nav-item span {
    font-size: 10px;
  }

  /* produk jadi 2 kolom */
  .product-list {
    gap: 10px;
  }

  .product {
    width: calc(50% - 10px);
  }

  .product-card .card-img-top {
    height: 150px; /* lebih kecil di mobile */
  }
}
