* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: #f4f4f4;  display: flex;
  flex-direction: column;
    min-height: 100vh; /* isi 1 layar penuh */
  display: flex;
}
html, body {
  margin: 0;
}

/* Full-width container to avoid limiting grid columns */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-left: 8px;
  padding-right: 8px;
}

/* Global: remove underline from all links */
a, a:link, a:visited, a:hover, a:active {
  text-decoration: none !important;
}

/* HEADERZ — judul halaman */
.headerz {
  width: 100%;
  text-align: center;
  color: #6a1b9a;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 20px 0 5px; /* 🔥 dikurangi jarak bawah */
  position: relative;
  font-family: 'Poppins', sans-serif;
}

/* garis dekoratif bawah judul */
.headerz::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #6a1b9a, #8e24aa);
  margin: 5px auto 0; /* 🔥 jarak atas kecil banget */
  border-radius: 4px;
}

/* versi kecil di mobile */
@media (max-width: 600px) {
  .headerz {
    font-size: 20px;
    margin: 15px 0 4px;
  }
  .headerz::after {
    width: 60px;
    height: 3px;
    margin: 4px auto 0;
  }
}



  .search-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 1050;
    transition: all 0.3s ease;
  }

  .search-input {
    width: 0;
    opacity: 0;
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    outline: none;
    transition: all 0.4s ease;
    background: #fff;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
    font-size: 14px;
  }

  .search-input.active {
    width: 200px;
    opacity: 1;
    margin-right: 10px;
  }

  .search-btn {
    background: #8c2fff;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
  }

  .search-btn:hover {
    transform: scale(1.1);
    background: #7a1fff;
  }

  @media (max-width: 576px) {
    .search-input.active {
      width: 160px;
    }
  }
main {
  flex-grow: 1; /* Memastikan main mengisi ruang yang tersedia, mendorong footer ke bawah */
}

/* Produk Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 kolom default */
    gap: 2px; padding:2px;
    
}

.card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    padding: 2px;
    max-height:300px;
}
.card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  gap:2px;
}
.card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.card img {
    width: auto;              /* Pastikan gambar isi penuh card */
    height: 120px;            /* Atur tinggi tetap agar grid rapi */
    object-fit: cover;        /* Potong gambar tanpa distorsi */
    border-radius: 10px;
    margin:0 auto;
    display: block;           /* Hilangkan jarak bawah gambar */
}
.card-link {
  text-decoration: none;
  color: inherit;
}
.card-body {
    padding:2px;
}
.card-link .card {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.card-link .card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Padding khusus card di grid produk */
.product-grid .card {
  padding: 4px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.card p {
    font-size: 14px;
    color: #555;
}

.card .btn-secondary {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 15px;
    background-color: #6a1b9a;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
}

.card .btn-secondary:hover {
    background-color: #5a137a;
}

/* ===== LOGIN BOX ===== */
.box1 {
  max-width: 400px;
  margin: 0 auto;
  background: #ffffff;
  padding: 40px 30px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(128, 0, 128, 0.15);
  text-align: center;
  font-family: "Poppins", sans-serif;
  transition: transform 0.3s ease;
}

.box1:hover {
  transform: translateY(-3px);
}

.box1 h2 {
  color: #6a0dad;
  font-size: 1.8rem;
  margin-bottom: 5px;
  font-weight: 600;
}

.box1 .input-group {
  text-align: left;
  margin-bottom: 20px;
}

.box1 .input-group label {
  display: block;
  font-weight: 600;
  color: #5c2d91;
  margin-bottom: 8px;
}

.box1 .input-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0c8ff;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.box1 .input-group input:focus {
  border-color: #8b3fff;
  box-shadow: 0 0 6px rgba(139, 63, 255, 0.4);
}

.box1 .btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #8b3fff, #6a0dad);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.box1 .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106, 13, 173, 0.3);
}

.box1 p {
  margin-top: 20px;
  font-size: 0.95rem;
  color: #555;
}

.box1 p a {
  color: #6a0dad;
  text-decoration: none;
  font-weight: 600;
}

.box1 p a:hover {
  text-decoration: underline;
}

.box1 .error-message {
  background: rgba(255, 0, 0, 0.1);
  border-left: 4px solid #e63946;
  padding: 10px 15px;
  color: #d62828;
  font-weight: 500;
  margin-bottom: 20px;
  border-radius: 8px;
}

/* Responsif */
@media (max-width: 480px) {
  .box1 {
    margin: 40px 20px;
    padding: 30px 20px;
  }

  .box1 h2 {
    font-size: 1.5rem;
  }
}

/* Footer */
footer {
  background-color: #6a1b9a;
  color: white;
  text-align: center;
  margin-top: auto;
  
  display: flex;
  align-items: center;   /* Tengah vertikal */
  justify-content: center; /* Tengah horizontal */
  height: 40px;          /* Tambahkan tinggi tetap */
  padding: 0;            /* Hapus padding biar pas */
}

footer, footer p, footer a {
  color: white !important;
  margin: 0; /* Pastikan teks nggak nambah jarak */
}


/* Responsivitas */
@media (max-width: 991px) {
    /* Footer */
footer {
    background-color: #6a1b9a;
    color: white !important;
    padding: 5px 0;
    text-align: center;
    margin-top: auto; /* Ini memastikan footer selalu di bawah */
}

.card {padding:2px;}
footer, footer p, footer a {
  color: white !important;
  margin: 0; /* Pastikan teks nggak nambah jarak */
}
    .nav-links {
        display: none;
        width: 100%;
        text-align: left;
        background-color: #6a1b9a;
        position: absolute;
        top: 60px;
        left: 0;
        padding: 10px 0;
        flex-direction: column; /* Vertikal */
    }

    .nav-links li {
        margin: 10px 0;
        padding-left: 20px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links.active {
        display: flex;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 kolom untuk mobile */
    }

    .search-bar {
        top: 120px; /* Agar pencarian berada setelah navbar dan search */
    }

    /* Pencarian di luar navbar untuk mobile */
    .search-desktop {
        display: none;
    }
}



/* Login Section */
.login-section {
    background-color: #fff;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* === BOX2: DETAIL PRODUK === */
.box2 {
  max-width: 800px;
  margin: 60px auto;
  background: #fff;
  border-radius: 20px;
  padding: 30px 40px;
  box-shadow: 0 6px 20px rgba(106, 13, 173, 0.1);
  font-family: "Poppins", sans-serif;
  color: #333;
}

.box2 a.btn-link {
  display: inline-block;
  color: #6a0dad;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 20px;
  transition: color 0.2s ease;
}

.box2 a.btn-link:hover {
  color: #9c4eff;
}

.box2 h2 {
  font-size: 1.8rem;
  color: #6a0dad;
  margin-bottom: 10px;
}

.box2 p {
  margin: 8px 0;
  font-size: 1rem;
  line-height: 1.5;
}

.box2 hr {
  margin: 25px 0;
  border: none;
  height: 2px;
  background: #eee;
}

/* === ACTION BUTTONS === */
.box2 .action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.box2 .btn {
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.box2 .btn:hover {
  transform: translateY(-2px);
}

/* Tombol warna */
.box2 .btn-success {
  background: linear-gradient(135deg, #6a0dad, #9b4dff);
  color: #fff;
}

.box2 .btn-success:hover {
  box-shadow: 0 4px 10px rgba(106, 13, 173, 0.3);
}

.box2 .buy-now {
  background: linear-gradient(135deg, #8b3fff, #6a0dad);
  color: #fff;
}

.box2 .contact-seller {
  background: #ff9f00;
  color: #fff;
}

.box2 .deliver-now {
  background: #1e90ff;
  color: #fff;
}

/* === INPUT JUMLAH === */
.box2 input[type="number"] {
  border: 2px solid #d3b3ff;
  border-radius: 6px;
  padding: 5px;
  text-align: center;
  width: 70px;
  font-size: 1rem;
}

.box2 input[type="number"]:focus {
  border-color: #8b3fff;
  outline: none;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .box2 {
    padding: 25px;
    margin: 30px 15px;
  }

  .box2 .action-buttons {
    flex-direction: column;
  }

  .box2 .btn {
    width: 100%;
  }
}

/* === BOX3: MODAL LOGIN === */
.box3 .modal {
  display: none; 
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.box3 .modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 30px 40px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 25px rgba(106, 13, 173, 0.2);
  text-align: center;
  font-family: "Poppins", sans-serif;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.box3 .modal-content h2 {
  color: #6a0dad;
  margin-bottom: 20px;
}

.box3 .modal-content input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 8px;
  border: 2px solid #e0c8ff;
  font-size: 1rem;
  transition: 0.2s ease;
}

.box3 .modal-content input:focus {
  border-color: #8b3fff;
  box-shadow: 0 0 6px rgba(139, 63, 255, 0.4);
}

.box3 .modal-content button {
  background: linear-gradient(135deg, #8b3fff, #6a0dad);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  width: 100%;
  cursor: pointer;
  margin-top: 10px;
}

.box3 .close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}


/* Error Message */
.error-message {
    color: red;
    font-size: 14px;
    margin-bottom: 10px;
}

/* Input Group */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: #6a1b9a;
    outline: none;
}

/* Submit Button */
button {
    background-color: #6a1b9a;
    color: white;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #5a137a;
}

/* Link to Registration */
p {
    font-size: 14px;
    color: #333;
}

p a {
    color: #6a1b9a;
    text-decoration: none;
    font-weight: 600;
}

p a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 600px) {
    .login-section {
        padding: 30px 20px;
        width: 90%;
    }

    .login-section h2 {
        font-size: 20px;
    }
}

/* Kategori Grid */
.kategori-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 kolom default di desktop lebar */
    gap: 4px;
    padding: 6px;
    width: 100%;
    margin-top: 20px;
}

/* Padding khusus card di grid kategori */
.kategori-grid .card {
    padding: 4px;
}

.kategori-grid .card h3 {
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
}

.kategori-grid .card p {
    font-size: clamp(0.8rem, 0.95vw, 1rem);
}

.card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

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

/* Gambar Kategori */
.card img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Nama Kategori */
.card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #6a1b9a;
    margin-bottom: 10px;
}

/* Keterangan Kategori */
.card p {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
}

/* Tombol Lihat Produk */
.card a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6a1b9a;
    color: white;
    font-weight: 500;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.card a:hover {
    background-color: #5a137a;
}

/* Responsive kolom untuk kategori: turun bertahap sesuai lebar layar */
@media (max-width: 1200px) {
    .kategori-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 992px) {
    .kategori-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 576px) {
    .kategori-grid { grid-template-columns: repeat(3, 1fr); padding: 10px; }
    .kategori-grid .card img { max-height: 150px; }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}