:root {
  /* HSL Tailored Color Palette - Nam A Bank Theme (Blue & Gold) */
  --bg: hsl(215, 55%, 7%); /* Deep corporate navy background */
  --card-bg: hsl(215, 40%, 13%); /* Midnight blue cards */
  --card-hover-bg: hsl(215, 40%, 18%);
  --text-main: hsl(215, 20%, 96%);
  --text-muted: hsl(215, 15%, 72%);
  --primary: hsl(42, 100%, 52%); /* Nam A Bank Bright Gold */
  --primary-hover: hsl(42, 100%, 45%);
  --accent: hsl(212, 100%, 40%); /* Nam A Bank Corporate Blue */
  --accent-hover: hsl(212, 100%, 32%);
  --danger: hsl(354, 70%, 54%);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow-premium: 0 8px 30px rgba(0, 0, 0, 0.4);
  --glass-effect: backdrop-filter: blur(12px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: 70px; /* Space for sticky header */
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Logo */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(15, 20, 30, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: var(--glass-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

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

.logo-area h1 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.logo-area p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Cart Trigger Badge */
.cart-trigger {
  position: relative;
  width: 45px;
  height: 45px;
  background: var(--card-bg);
  border: var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-premium);
}

.cart-trigger:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.cart-icon {
  font-size: 1.2rem;
  transition: var(--transition-smooth);
}

.cart-trigger:hover .cart-icon {
  transform: scale(1.1);
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

/* Hero Section */
.hero {
  padding: 40px 0;
  text-align: center;
  background: radial-gradient(circle at center, rgba(38, 90, 55, 0.15) 0%, transparent 70%);
}

.hero h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Products Grid & Cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 20px 0 60px 0;
}

.product-card {
  background-color: var(--card-bg);
  border: var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  background-color: var(--card-hover-bg);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px; /* Fixed height for consistency */
}

.product-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-actions {
  display: flex;
  gap: 8px;
}

.btn-view-detail, .btn-add-cart {
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-view-detail {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  width: 36px;
  height: 36px;
}

.btn-view-detail:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-add-cart {
  background: var(--primary);
  color: #000;
  padding: 8px 16px;
  height: 36px;
}

.btn-add-cart:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Modals & Backdrop */
.modal-backdrop, .drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active, .drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--card-bg);
  border: var(--glass-border);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  padding: 30px;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--shadow-premium);
}

.modal-backdrop.active .modal-content {
  transform: scale(1);
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.close-btn:hover {
  color: #fff;
}

/* Drawer CSS */
.drawer {
  position: absolute;
  right: -400px;
  top: 0;
  bottom: 0;
  width: 400px;
  background: var(--card-bg);
  border-left: var(--glass-border);
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.drawer-backdrop.active .drawer {
  right: 0;
}

.drawer-header {
  padding: 20px;
  border-bottom: var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Cart list items */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-info h5 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.cart-item-info p {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: var(--transition-smooth);
}

.qty-btn:hover {
  background: var(--primary);
  color: #000;
}

.cart-summary {
  background: rgba(255, 255, 255, 0.03);
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 25px;
  border: var(--glass-border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.summary-row strong {
  color: var(--primary);
  font-size: 1.15rem;
}

/* Checkout Form */
.checkout-form h4 {
  font-family: var(--font-heading);
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input, .form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: var(--glass-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.15);
}

/* Payment Options */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 5px;
}

.payment-option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: var(--glass-border);
  border-radius: 10px;
  padding: 12px 15px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.payment-option-card:hover {
  background: rgba(255, 255, 255, 0.07);
}

.payment-option-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.option-details span {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.option-details small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-checkout {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
  margin-top: 15px;
}

.btn-checkout:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* QR Code Modal custom */
.qr-modal-content {
  text-align: center;
  max-width: 450px;
}

.qr-body img {
  width: 250px;
  height: 250px;
  border-radius: 12px;
  margin: 15px auto;
  display: block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-close-qr {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: var(--glass-border);
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
  margin-top: 20px;
}

.btn-close-qr:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Loading Spinners & Indicators */
.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 0;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  body {
    padding-top: 60px;
  }
  .header {
    height: 60px;
  }
  .drawer {
    width: 100%;
    right: -100%;
  }
  .drawer-backdrop.active .drawer {
    right: 0;
  }
  .hero h2 {
    font-size: 1.6rem;
  }
}
