:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #10b981;
  --accent: #f59e0b;
  --danger: #ef4444;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #f9fafb;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  width: min(1200px, 92%);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  z-index: 50;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.brand {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  gap: 0.5rem;
}

.nav a {
  color: var(--text-light);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav a:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.nav a.active {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.cart-btn {
  border: none;
  background: var(--primary);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.cart-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cart-btn:active {
  transform: translateY(0);
}

.cart-btn span {
  background: white;
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* Header Actions - Customer Profile */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.customer-profile {
  position: relative;
}

.profile-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  transition: var(--transition);
}

.profile-btn:hover .profile-avatar {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 1000;
  border: 1px solid var(--border);
}

.profile-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-avatar-lg {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-info h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-info p {
  margin: 0.25rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu {
  padding: 0.5rem 0;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition);
  font-size: 0.95rem;
  font-weight: 500;
}

.profile-menu-item:hover {
  background: var(--bg);
  color: var(--primary);
}

.profile-menu-item i {
  width: 20px;
  text-align: center;
  color: var(--primary);
}

.profile-menu-item.logout-btn {
  color: var(--danger);
}

.profile-menu-item.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.profile-menu-item.logout-btn i {
  color: var(--danger);
}

.profile-dropdown hr {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero {
  background: var(--primary);
  color: white;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-illustration {
  font-size: 8rem;
  opacity: 0.2;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  color: var(--primary);
  text-decoration: none;
  padding: 0.875rem 1.75rem;
  border-radius: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn.outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn.outline:hover {
  background: var(--primary);
  color: white;
}

.btn.full {
  width: 100%;
  justify-content: center;
}

/* Main Content */
main {
  padding: 3rem 0;
}

h3 {
  font-size: 2rem;
  margin-bottom: 2rem;
  font-weight: 700;
  position: relative;
  padding-bottom: 0.5rem;
}

h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

/* Product Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  margin: 2rem 0 4rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: var(--transition);
}

.card:hover img {
  transform: scale(1.05);
}

.card .meta {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card .title {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.price {
  color: var(--secondary);
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0.5rem 0;
}

.small {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.actions button {
  flex: 1;
  border: none;
  padding: 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  font-size: 0.875rem;
}

.add {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.add:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.detail {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.detail:hover {
  background: var(--border);
}

/* Contact Section */
.contact {
  padding: 2rem 0 4rem;
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: 12px;
  transition: var(--transition);
}

.contact-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--primary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 10px;
  flex-shrink: 0;
}

.contact-item strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.contact-item p {
  margin: 0;
  color: var(--text-light);
}

.contact-item a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.contact-item a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background: var(--text);
  color: white;
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
}

.site-footer small {
  opacity: 0.8;
}

/* Cart Drawer */
.cart-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(450px, 100%);
  background: var(--card);
  box-shadow: var(--shadow-xl);
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
}

.cart-header h4 {
  font-size: 1.5rem;
  font-weight: 700;
}

.cart-header button {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-light);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-header button:hover {
  background: var(--danger);
  color: white;
}

.cart-items {
  padding: 1rem;
  flex: 1;
  overflow: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.cart-item:hover {
  box-shadow: var(--shadow-sm);
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}

.cart-item-info h5 {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-info .price {
  font-size: 1rem;
}

.qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border-radius: 10px;
  padding: 0.25rem;
  border: 1px solid var(--border);
}

.qty button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty button:hover {
  background: var(--primary);
  color: white;
}

.qty span {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 2px solid var(--border);
  background: var(--bg);
}

.totals {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--text-light);
}

.final-total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.final-total strong {
  color: var(--secondary);
}

.cart-footer .btn {
  margin-bottom: 0.75rem;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-illustration {
    display: none;
  }

  .hero-content h2 {
    font-size: 2rem;
  }

  .nav {
    display: none;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .card .meta {
    padding: 1rem;
  }

  .cart-drawer {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 1.5rem;
  }

  .cart-btn {
    padding: 0.5rem 0.875rem;
  }

  .hero-content h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #f9fafb;
    --text-light: #9ca3af;
    --bg: #111827;
    --card: #1f2937;
    --border: #374151;
  }

  .hero {
    background: #4f46e5;
  }

  .site-header {
    background: rgba(31, 41, 55, 0.95);
  }

  .brand {
    -webkit-text-fill-color: unset;
    background: linear-gradient(135deg, #818cf8, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .detail {
    background: #374151;
    color: var(--text);
    border-color: #4b5563;
  }

  .detail:hover {
    background: #4b5563;
  }

  .cart-item,
  .totals {
    background: #111827;
  }

  .qty {
    background: #111827;
  }

  .qty button {
    background: #374151;
    color: var(--text);
  }
}

.coupon-area {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.coupon-area input {
  flex-grow: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.9rem;
}

.coupon-area button {
  border: none;
  background: var(--secondary);
  color: white;
  padding: 0 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.coupon-area button:hover {
  opacity: 0.85;
}

.coupon-info {
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-align: center;
}

.coupon-info.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--secondary);
}

.coupon-info.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Badge Status */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
  text-transform: capitalize;
}

.badge.success {
  background-color: var(--secondary);
}
.badge.pending {
  background-color: var(--accent);
}
.badge.expired {
  background-color: #6c757d;
}
.badge.failed {
  background-color: var(--danger);
}
.badge.warning {
  background-color: #fd7e14;
}
.badge.default {
  background-color: var(--text-light);
}

/* Item list in table */
.item-list {
  list-style-type: none;
  padding-left: 0;
}

.history-discount {
  font-size: 0.8rem;
  color: var(--secondary);
  margin-top: 0.5rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}

/* Product Card Styles */
.product-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover img {
  transform: scale(1.08);
}

.product-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1rem 1rem 0.5rem;
  color: var(--text);
  line-height: 1.4;
}

.product-card .category {
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 0 1rem 0.5rem;
  font-style: italic;
}

.product-card .price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  padding: 0.5rem 1rem;
}

.product-card .btn {
  margin: 1rem;
  margin-top: auto;
  background: linear-gradient(135deg, var(--primary), #764ba2);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.product-card .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.product-card .btn:active {
  transform: translateY(0);
}
