/* ========== RESET & GLOBAL ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* System Font Stack - Lebih cepat dari Google Fonts */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #faf9fc;
  color: #1e1b2e;
  line-height: 1.5;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ========== TOAST NOTIFICATION ========== */
.toast-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: white;
  border-radius: 16px;
  padding: 14px 20px;
  min-width: 260px;
  max-width: 350px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease forwards;
  border-left: 4px solid;
}

.toast.success {
  border-left-color: #22c55e;
}
.toast.success i {
  color: #22c55e;
}

.toast.error {
  border-left-color: #ef4444;
}
.toast.error i {
  color: #ef4444;
}

.toast.warning {
  border-left-color: #f97316;
}
.toast.warning i {
  color: #f97316;
}

.toast i {
  font-size: 1.3rem;
}

.toast .toast-content {
  flex: 1;
}

.toast .toast-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.toast .toast-message {
  font-size: 0.75rem;
  color: #64748b;
}

.toast .toast-close {
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.toast .toast-close:hover {
  color: #1e293b;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast.hide {
  animation: fadeOut 0.3s ease forwards;
}

/* ========== HEADER ========== */
.main-header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-container {
  display: flex;
  justify-content: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo i {
  font-size: 1.8rem;
  color: #f97316;
}

.logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
}

.logo span {
  color: #f97316;
}

/* ========== NAVBAR ========== */
.navbar {
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  position: sticky;
  top: 70px;
  z-index: 99;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Tombol Hamburger - Sembunyi di desktop */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #334155;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
}

.menu-toggle:hover {
  color: #f97316;
}

/* Menu navigasi default (desktop) */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
}

.nav-menu li a {
  text-decoration: none;
  font-weight: 600;
  color: #334155;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  color: #f97316;
  border-bottom-color: #f97316;
}

/* ========== HERO ========== */
.hero-section {
  background: linear-gradient(135deg, #1e1b2e 0%, #2d2a44 100%);
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(249,115,22,0.2), transparent);
  top: -100px;
  right: -100px;
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: rgba(249,115,22,0.2);
  backdrop-filter: blur(4px);
  padding: 6px 18px;
  border-radius: 40px;
  font-size: 0.8rem;
  color: #f97316;
  margin-bottom: 1.5rem;
}

.hero-content h2 {
  font-size: 3rem;
  color: white;
  margin-bottom: 1rem;
}

.hero-content h2 span {
  color: #f97316;
}

.hero-content p {
  color: #cbd5e1;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(249,115,22,0.4); }
  70% { box-shadow: 0 0 0 12px rgba(249,115,22,0); }
  100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}

.btn-primary {
  background: #f97316;
  border: none;
  padding: 12px 32px;
  border-radius: 40px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  background: #ea580c;
  transform: translateY(-2px);
}

/* ========== SECTION TITLE ========== */
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1e1b2e, #f97316);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.title-line {
  width: 60px;
  height: 3px;
  background: #f97316;
  margin: 12px auto 0;
  border-radius: 10px;
}

.section-title p {
  color: #64748b;
  margin-top: 12px;
}

/* ========== PRODUCT CARDS ========== */
.products-section {
  padding: 5rem 0;
  background: #ffffff;
}

.product-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.card {
  background: white;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 35px -12px rgba(0,0,0,0.08);
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  flex: 1 1 220px;
  min-width: 210px;
  max-width: 260px;
  border: 1px solid rgba(0,0,0,0.03);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 40px -15px rgba(249,115,22,0.2);
}

.card-image {
  background: linear-gradient(145deg, #fef3e8, #fff4e6);
  padding: 0;
  text-align: center;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-body {
  padding: 1rem 1rem 1.5rem;
  text-align: center;
}

.card-body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.price {
  font-weight: 800;
  color: #f97316;
  font-size: 1.2rem;
  margin: 8px 0;
}

.btn-buy-trigger {
  background: #f1f5f9;
  border: none;
  padding: 8px 20px;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1e293b;
  text-decoration: none;
}

.btn-buy-trigger:hover {
  background: #f97316;
  color: white;
}

/* ========== FORM PEMESANAN ========== */
.order-section {
  padding: 5rem 0;
  background: #f8fafc;
}

.glass-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-radius: 32px;
  padding: 2rem;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 20px 35px -12px rgba(0,0,0,0.1);
}

.form-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #1e293b;
}

.required {
  color: #ef4444;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-family: inherit;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.radio-group, .checkbox-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 8px;
}

.radio-group label, .checkbox-group label {
  font-weight: 400;
  gap: 6px;
  cursor: pointer;
}

.error-message {
  color: #dc2626;
  font-size: 0.7rem;
  margin-top: 6px;
  padding-left: 12px;
}

.success-message {
  background: #dcfce7;
  color: #15803d;
  padding: 14px;
  border-radius: 20px;
  text-align: center;
  margin-top: 1.5rem;
  font-weight: 500;
}

.btn-submit {
  background: #1e293b;
  width: 100%;
  padding: 14px;
  border-radius: 40px;
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
}

.btn-submit:hover {
  background: #f97316;
  transform: translateY(-2px);
}

/* ========== DYNAMIC SECTION ========== */
.dynamic-section {
  padding: 5rem 0;
  background: #ffffff;
}

.dynamic-controls {
  margin-bottom: 2.5rem;
}

.add-item-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.add-item-form input {
  flex: 1;
  min-width: 160px;
  padding: 12px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 60px;
  font-size: 0.9rem;
  transition: 0.2s;
}

.add-item-form input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.file-upload-btn {
  background: #eef2ff;
  padding: 12px 24px;
  border-radius: 60px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
}

.file-upload-btn:hover {
  background: #e0e7ff;
}

.dynamic-item-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: flex-start;
}

.item-card {
  background: white;
  border-radius: 24px;
  width: 230px;
  overflow: hidden;
  transition: all 0.2s;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  border: 1px solid #f1f1f1;
}

.item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px -10px rgba(0,0,0,0.1);
}

.item-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f1f5f9;
  display: block;
}

.item-info {
  padding: 1rem;
  text-align: center;
}

.item-info h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.item-info p {
  font-weight: 700;
  color: #f97316;
}

.delete-item {
  background: #fee2e2;
  border: none;
  width: 100%;
  padding: 10px;
  font-weight: 600;
  color: #b91c1c;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.delete-item:hover {
  background: #fecaca;
}

/* ========== FOOTER ========== */
.main-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 2rem 0;
  text-align: center;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.social-icons i {
  font-size: 1.4rem;
  margin-left: 16px;
  cursor: pointer;
  transition: color 0.2s;
}

.social-icons i:hover {
  color: #f97316;
}

/* ========== RESPONSIVE TABLET ========== */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .add-item-form {
    flex-direction: column;
  }
  
  .add-item-form input,
  .file-upload-btn,
  .add-item-form .btn-primary {
    width: 100%;
  }
  
  .dynamic-item-grid {
    justify-content: center;
  }
  
  .toast-container {
    top: 80px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    max-width: none;
    width: auto;
    min-width: auto;
  }
}

/* ========== MOBILE TERKECIL (max-width: 480px) DENGAN TOGGLE ========== */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  /* Tampilkan tombol toggle */
  .menu-toggle {
    display: block;
  }
  
  /* Menu navigasi default disembunyikan */
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    gap: 0;
    padding: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-radius: 0 0 20px 20px;
    z-index: 100;
  }
  
  /* Menu saat aktif (toggle terbuka) */
  .nav-menu.active {
    display: flex;
  }
  
  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid #f1f5f9;
  }
  
  .nav-menu li a {
    padding: 1rem 1.5rem;
    justify-content: flex-start;
    border-bottom: none;
  }
  
  .nav-menu li a:hover,
  .nav-menu li a.active {
    background: #fef3e8;
    color: #f97316;
    border-bottom: none;
  }
  
  .hero-content h2 {
    font-size: 1.5rem;
  }
  
  .btn-primary {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  
  .section-title h2 {
    font-size: 1.3rem;
  }
  
  .glass-card {
    padding: 1rem;
  }
  
  .card {
    min-width: 160px;
    max-width: 100%;
    width: 100%;
  }
  
  .card-image {
    height: 350px;
  }
  
  .toast-container {
    top: 70px;
    left: 10px;
    right: 10px;
  }
  
  .toast {
    padding: 10px 14px;
  }
  
  .toast .toast-title {
    font-size: 0.8rem;
  }
  
  .toast .toast-message {
    font-size: 0.7rem;
  }
}

/* ========== OPTIMASI LOADING GAMBAR ========== */

/* 1. Beri ukuran tetap agar tidak layout shift */
.card-image {
  background: linear-gradient(145deg, #fef3e8, #fff4e6);
  padding: 0;
  text-align: center;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* fallback warna background saat gambar loading */
  background-color: #f1f5f9;
}

/* 2. Gambar responsif dengan object-fit */
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  /* Animasi fade-in saat gambar muncul */
  animation: fadeIn 0.3s ease-in-out;
}

/* 3. Efek fade-in saat gambar selesai loading */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 4. Skeleton loading effect untuk gambar */
.card-image img[loading="lazy"] {
  background: #e2e8f0;
}

/* 5. Pastikan gambar tidak blur saat loading */
.card-image img {
  image-rendering: auto;
  image-rendering: crisp-edges;
}

/* 6. Optimasi untuk gambar di mobile */
@media (max-width: 480px) {
  .card-image {
    aspect-ratio: 1 / 1;
  }
}

/* 7. Preload gambar penting (opsional - tambahkan di HTML) */
/* 8. Hindari repaint saat scroll */
.card {
  will-change: transform;
}