/* 1. VARIABLE WARNA */
:root {
  --color-cream: #fdfbf7;
  --color-light-brown: #8d6e63;
  --color-dark-brown: #5d4037;
  --color-white: #ffffff;
  --color-red: #c62828;
  --color-green: #2e7d32;
  --color-orange-vibrant: #d84315;
  --bg-gradient-rich: linear-gradient(135deg, #ffffff 0%, #f3e5f5 0%, #fdfbf7 30%, #efe6dd 100%);
  --bg-gradient-soft: linear-gradient(to bottom right, #fffcf9, #f2e6d9);
}

/* 2. GLOBAL RESET & BASE STYLE */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-gradient-soft);
  background-attachment: fixed;
  background-size: cover;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: #4e342e;
  font-size: 14px;
  line-height: 1.5;
}

/* 3. LOGIN & REGISTER PAGE */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(93, 64, 55, 0.15);
  width: 100%;
  max-width: 400px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
}

.login-container header h1 {
  color: var(--color-dark-brown);
  margin-bottom: 5px;
  font-size: 1.8em;
  font-weight: 800;
}

.login-container header p {
  color: #8d6e63;
  margin-top: 0;
  font-size: 0.95em;
  margin-bottom: 25px;
}

.login-form h2 {
  color: var(--color-dark-brown);
  margin-bottom: 20px;
  border-bottom: 3px solid var(--color-light-brown);
  padding-bottom: 10px;
  display: inline-block;
  width: 100%;
  font-weight: 700;
}

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

.input-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--color-dark-brown);
  font-weight: 700;
  font-size: 0.9em;
}

.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"],
.input-group input[type="date"],
.input-group input[type="file"],
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #efebe9;
  border-radius: 12px;
  box-sizing: border-box;
  font-size: 1em;
  background-color: #fafafa;
  transition: all 0.3s;
  color: #4e342e;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--color-light-brown);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(141, 110, 99, 0.15);
}

.btn-login,
.btn-primary {
  background: linear-gradient(to right, #795548, #5d4037);
  color: var(--color-white);
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.05em;
  font-weight: bold;
  width: 100%;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(93, 64, 55, 0.2);
  letter-spacing: 0.5px;
  margin-top: 10px;
}

.btn-login:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(93, 64, 55, 0.3);
  background: linear-gradient(to right, #6d4c41, #4e342e);
}

.signup-link {
  margin-top: 25px;
  color: #795548;
  font-size: 0.9em;
}

.signup-link a {
  color: var(--color-dark-brown);
  text-decoration: none;
  font-weight: bold;
  border-bottom: 2px solid var(--color-light-brown);
}

/* 4. HEADER DASHBOARD SANGAT KECIL & RAMPING */
.header-dashboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 5%;
  min-height: 48px;
  background: linear-gradient(to right, #6d4c41, #5d4037) !important;
  color: var(--color-white);
  box-shadow: 0 4px 15px rgba(93, 64, 55, 0.15);
  position: sticky;
  top: 0;
  z-index: 2000;
}

.header-dashboard h1,
.header-dashboard h2 {
  margin: 0;
  font-size: 1.05em;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--color-white) !important;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left div {
  font-size: 0.75em;
}

.logo-app {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.3s ease;
}

.logo-app:hover {
  transform: scale(1.15);
  cursor: pointer;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-icons a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  position: relative;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-icons a:hover {
  color: #fff;
  transform: scale(1.1);
}

.nav-icons .login-btn-header {
  padding: 4px 12px;
  font-size: 0.85em;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--color-white) !important;
}

.notification-badge,
.cart-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background-color: #ef5350;
  color: white;
  border-radius: 12px;
  padding: 2px 4px;
  font-size: 0.6em;
  font-weight: bold;
  line-height: 1;
  z-index: 5;
  border: 2px solid #5d4037;
}

.section-title {
  color: var(--color-dark-brown);
  padding: 0 5%;
  margin-top: 30px;
  margin-bottom: 10px;
  font-weight: 800;
  font-size: 1.8em;
  letter-spacing: -0.5px;
  text-align: center;
}

/* 5. CONTAINER STYLES */
.cart-container,
.checkout-container,
.admin-container {
  max-width: 1000px;
  padding: 30px;
  background-color: #ffffff;
  border-radius: 24px;
  margin: 30px auto;
  color: #4e342e;
  box-shadow: 0 10px 30px rgba(93, 64, 55, 0.08);
}

.back-button {
  margin-bottom: 25px;
  display: inline-flex;
  align-items: center;
  color: var(--color-white);
  text-decoration: none;
  font-weight: 700;
  background: var(--color-dark-brown);
  padding: 10px 20px;
  border-radius: 30px;
  border: none;
  transition: all 0.2s;
  font-size: 0.9em;
}

.back-button:hover {
  background-color: var(--color-orange-vibrant);
  transform: translateX(-5px);
}

.back-button i {
  margin-right: 8px;
}

/* Tabel Keranjang & Admin */
.cart-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  border: 1px solid #efe6dd;
  border-radius: 16px;
  overflow: hidden;
}

.cart-table th,
.cart-table td {
  padding: 15px;
  border-bottom: 1px solid #f5f5f5;
  text-align: left;
  vertical-align: middle;
}

.cart-table th {
  background-color: #fcfaf8;
  color: var(--color-dark-brown);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75em;
  letter-spacing: 1px;
}

.cart-table tr:last-child td {
  border-bottom: none;
}

.quantity-control input {
  width: 45px;
  text-align: center;
  padding: 8px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-weight: bold;
  color: var(--color-dark-brown);
}

.btn-remove {
  background: #fff0f0;
  border: none;
  color: #ef5350;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-remove:hover {
  background: #ffebee;
  transform: scale(1.1);
}

/* Ringkasan Checkout */
.checkout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.summary-box {
  background-color: #fbfbfb;
  padding: 25px;
  border-radius: 20px;
  border: 1px solid #efe6dd;
  height: fit-content;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.summary-box h3 {
  border-bottom: 2px solid var(--color-light-brown);
  padding-bottom: 15px;
  color: var(--color-dark-brown);
  margin-top: 0;
  font-weight: 800;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95em;
  color: #555;
}

.summary-total {
  font-size: 1.3em;
  font-weight: 800;
  color: var(--color-orange-vibrant);
  border-top: 2px dashed #ddd;
  padding-top: 20px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
}

/* Pesan Sukses/Error */
.message-success {
  background-color: #e8f5e9;
  border-left: 5px solid #2e7d32;
  color: #1b5e20;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(46, 125, 50, 0.1);
  font-weight: 600;
  font-size: 0.9em;
}

.message-error {
  background-color: #ffebee;
  border-left: 5px solid #c62828;
  color: #b71c1c;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(198, 40, 40, 0.1);
  font-weight: 600;
  font-size: 0.9em;
}

/* CSS Admin Menu */
.admin-menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  color: var(--color-dark-brown);
  padding: 18px 25px;
  margin-bottom: 15px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--color-light-brown);
  transition: all 0.3s;
}

.admin-menu a:hover {
  background-color: #fdfbf7;
  transform: translateX(5px);
  border-left-color: var(--color-orange-vibrant);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.admin-menu span i {
  margin-right: 15px;
  color: var(--color-dark-brown);
  font-size: 1.2em;
}

/* 6. MEDIA QUERIES */
@media (max-width: 900px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
  .checkout-form {
    order: 2;
  }
  .summary-box {
    order: 1;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .checkout-container,
  .cart-container,
  .admin-container {
    padding: 20px;
    margin: 15px auto;
    width: 95%;
    border-radius: 16px;
    box-sizing: border-box;
  }

  .cart-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .cart-table th,
  .cart-table td {
    padding: 12px 10px;
  }
}

@media (max-width: 480px) {
  .header-dashboard {
    padding: 6px 12px !important;
    min-height: 45px;
    gap: 5px;
  }
  .header-left {
    gap: 8px;
    flex: 1;
    overflow: hidden;
  }
  .logo-app {
    width: 28px;
    height: 28px;
  }
  .header-left h2 {
    font-size: 1em !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hide-on-mobile {
    display: none !important;
  }
  .nav-icons {
    gap: 12px;
  }
  .nav-icons a {
    font-size: 1.1em;
  }
  .login-btn-header {
    padding: 4px 10px !important;
    font-size: 0.8em !important;
  }
}

/* ==========================================================================
   PERBAIKAN HEADER MOBILE (TAMBAHKAN DI BARIS PALING BAWAH)
   ========================================================================== */

/* Target khusus untuk layar HP (Maksimal lebar 480px) */
@media (max-width: 480px) {
  .header-dashboard {
    padding: 6px 12px !important;
    min-height: 45px;
    gap: 5px;
  }
  
  .header-left {
    gap: 8px;
    flex: 1;
    overflow: hidden;
  }
  
  .logo-app {
    width: 28px;
    height: 28px;
  }
  
  .header-left h2 {
    font-size: 1em !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .hide-on-mobile {
    display: none !important;
  }
  
  .nav-icons {
    gap: 12px;
  }
  
  /* 1. Memaksa tautan icon navigasi menjadi warna putih solid */
  .nav-icons a {
    font-size: 1.1em;
    color: #ffffff !important; 
  }
  
  /* 2. Memaksa tag <i> (FontAwesome) di dalam navigasi menjadi putih solid */
  .nav-icons a i {
    color: #ffffff !important;
  }

  .login-btn-header {
    padding: 4px 10px !important;
    font-size: 0.8em !important;
  }
}