/* Global Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Material Symbols Icon Alignment */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-normal);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-logo .logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--matcha-600), var(--matcha-800));
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
}

.brand-logo .badge-green {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: var(--matcha-200);
  color: var(--matcha-800);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

/* Search Bar */
.search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 46px;
  background-color: var(--matcha-50);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.search-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--matcha-500);
  box-shadow: 0 0 0 4px rgba(82, 183, 136, 0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-secondary-matcha {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background-color: var(--matcha-50);
  color: var(--matcha-800);
  border: 1px solid var(--border-matcha);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary-matcha:hover {
  background-color: var(--matcha-200);
  border-color: var(--matcha-400);
}

.btn-primary-matcha {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--matcha-600), var(--matcha-700));
  color: var(--text-on-matcha);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.2);
  transition: var(--transition-fast);
}

.btn-primary-matcha:hover {
  background: linear-gradient(135deg, var(--matcha-700), var(--matcha-800));
  box-shadow: 0 6px 18px rgba(45, 106, 79, 0.3);
  transform: translateY(-1px);
}

.cart-btn-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-matcha);
  background: var(--matcha-50);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 2px 6px rgba(27, 67, 50, 0.06);
}

.cart-btn-trigger:hover {
  background-color: var(--matcha-100);
  border-color: var(--matcha-400);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(82, 183, 136, 0.2);
}

.cart-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--gradient-matcha);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.badge-pop {
  animation: badgePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.cart-nav-total {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--matcha-700);
}

/* Hero Section */
.hero-section {
  padding: 56px 0 40px;
  background: radial-gradient(circle at 50% 0%, var(--matcha-50) 0%, var(--bg-page) 70%);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.hero-banner {
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background-color: var(--matcha-200);
  color: var(--matcha-800);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -1px;
  margin-bottom: 18px;
}

.hero-title span {
  color: var(--matcha-600);
  position: relative;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 36px;
  background: #ffffff;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background-color: var(--matcha-50);
  color: var(--matcha-700);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-number {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Category Filter Bar */
.filter-section {
  padding: 32px 0 24px;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-behavior: smooth;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.pill-btn:hover {
  border-color: var(--matcha-400);
  color: var(--matcha-700);
}

.pill-btn.active {
  background-color: var(--matcha-700);
  border-color: var(--matcha-700);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.2);
}

.sort-select-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-matcha {
  height: 40px;
  padding: 0 36px 0 14px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%25232d6a4f'%3E%3Cpath d='M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}

.select-matcha:focus {
  outline: none;
  border-color: var(--matcha-500);
}

/* Products Grid */
.products-section {
  padding-bottom: 64px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.products-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* Product Card */
.product-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-normal);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--matcha-300);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 20px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-bestseller {
  background-color: var(--matcha-200);
  color: var(--matcha-800);
}

.badge-verified {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-freebie {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-hot {
  background-color: #fee2e2;
  color: #991b1b;
}

.card-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-body {
  padding: 0 20px 16px;
  flex: 1;
}

.product-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tech-tag {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--matcha-50);
  color: var(--matcha-700);
  border: 1px solid var(--border-light);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px dashed var(--border-light);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.rating-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--text-main);
}

.rating-box .material-symbols-outlined {
  color: var(--accent-gold);
  font-size: 18px;
  font-variation-settings: 'FILL' 1;
}

.card-footer {
  padding: 16px 20px 20px;
  background-color: var(--matcha-50);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price-box {
  display: flex;
  flex-direction: column;
}

.current-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--matcha-700);
}

.free-price {
  color: #16a34a;
  font-weight: 800;
  font-size: 1.2rem;
}

.original-price {
  font-size: 0.78rem;
  color: var(--text-light);
  text-decoration: line-through;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-matcha {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-matcha);
  background-color: #ffffff;
  color: var(--matcha-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon-matcha:hover {
  background-color: var(--matcha-200);
  border-color: var(--matcha-500);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  grid-column: 1 / -1;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background-color: var(--matcha-50);
  color: var(--matcha-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.empty-desc {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 20px;
}

/* Slide-over Cart Drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 34, 25, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 460px;
  background-color: #ffffff;
  z-index: 1001;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.drawer-header-left {
  display: flex;
  flex-direction: column;
}

.drawer-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-title-icon {
  color: var(--matcha-600);
  font-size: 24px;
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background-color: var(--matcha-50);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.close-btn:hover {
  background-color: var(--matcha-200);
}

.purchase-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--matcha-50);
  border-bottom: 1px solid var(--border-light);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-light);
}

.step-item.active {
  color: var(--matcha-700);
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.step-item.active .step-num {
  background-color: var(--matcha-600);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(45, 106, 79, 0.3);
}

.step-arrow {
  color: var(--text-light);
  display: flex;
  align-items: center;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px;
}

.cart-item-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.cart-item-card:hover {
  border-color: var(--border-matcha);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.cart-item-icon-box {
  width: 42px;
  height: 42px;
  background: var(--gradient-matcha-light);
  border: 1px solid var(--border-matcha);
  border-radius: var(--radius-md);
  color: var(--matcha-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cart-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  word-break: break-word;
}

.cart-item-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  flex-wrap: wrap;
}

.cart-tech-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background-color: var(--matcha-50);
  color: var(--matcha-700);
  border: 1px solid var(--border-matcha);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.cart-license-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.cart-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.cart-author-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cart-item-price-tag {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--matcha-700);
}

.remove-item-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.remove-item-btn:hover {
  color: var(--accent-red);
  background-color: #fee2e2;
}

.empty-cart-view {
  text-align: center;
  padding: 48px 16px;
}

.empty-cart-illustration {
  width: 72px;
  height: 72px;
  background-color: var(--matcha-50);
  border: 1px solid var(--border-matcha);
  color: var(--matcha-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 36px;
}

.empty-cart-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-cart-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto 16px;
}

.drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
  background-color: var(--matcha-50);
}

.trust-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-matcha);
}

.trust-badge-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-body);
}

.cart-summary-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  padding-top: 10px;
  border-top: 1px dashed var(--border-matcha);
  margin-bottom: 0;
}

.summary-row.total .total-amount {
  color: var(--matcha-700);
}

.subtotal-amount {
  font-weight: 700;
  color: var(--text-main);
}

.discount-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.btn-checkout-glow {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--gradient-matcha);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(45, 106, 79, 0.35);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-checkout-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 106, 79, 0.45);
}

.btn-checkout-glow:after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: rotate(30deg);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(30deg); }
  100% { transform: translateX(100%) rotate(30deg); }
}

.btn-checkout-content {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1;
}

.btn-checkout-arrow {
  display: flex;
  align-items: center;
  z-index: 1;
  transition: transform 0.2s ease;
}

.btn-checkout-glow:hover .btn-checkout-arrow {
  transform: translateX(4px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 34, 25, 0.5);
  backdrop-filter: blur(8px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--matcha-50);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--matcha-50);
}

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

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--matcha-500);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Toast Notifications with Progress Bar */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 18px;
  background-color: var(--matcha-900);
  color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--matcha-700);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-icon {
  color: var(--matcha-400);
}

.toast-message {
  font-size: 0.88rem;
  font-weight: 600;
}

.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-accent);
  width: 100%;
  animation: toastProgress 3.2s linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

.toast-hiding {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

/* Checkout Stepper Header & Inner Content */
.checkout-stepper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.chk-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-light);
}

.chk-step.active {
  color: var(--matcha-700);
}

.chk-step.done {
  color: var(--matcha-600);
}

.chk-step-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.chk-step.active .chk-step-icon {
  background: var(--matcha-600);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.3);
}

.chk-step.done .chk-step-icon {
  background: var(--matcha-200);
  color: var(--matcha-800);
}

.chk-line {
  flex: 1;
  height: 2px;
  background: var(--border-light);
  margin: 0 10px;
}

.chk-line.active, .chk-line.done {
  background: var(--matcha-400);
}

.checkout-summary-box {
  background: var(--matcha-50);
  border: 1px solid var(--border-matcha);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.chk-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chk-summary-title {
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.chk-total-badge {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--matcha-700);
  background: #ffffff;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-matcha);
}

.chk-items-mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chk-item-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.chk-item-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-main);
}

.chk-item-price {
  font-weight: 700;
  color: var(--matcha-700);
}

.form-row-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 6px;
}

.pay-method-card {
  border: 2px solid var(--border-light);
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.pay-method-card:hover {
  border-color: var(--matcha-400);
}

.pay-method-card.active {
  border-color: var(--matcha-600);
  background: var(--matcha-50);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.pay-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qr-icon {
  background: var(--matcha-200);
  color: var(--matcha-800);
}

.momo-icon {
  background: #fce7f3;
  color: #be185d;
}

.pay-card-info {
  flex: 1;
}

.pay-card-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.pay-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pay-card-badge {
  position: absolute;
  top: -8px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--gradient-matcha);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

/* VietQR Live Box */
.vietqr-container {
  background: var(--matcha-50);
  border: 1.5px dashed var(--matcha-400);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 16px;
}

.vietqr-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-matcha);
}

.vietqr-body {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: center;
}

.qr-code-frame {
  position: relative;
  width: 160px;
  height: 160px;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 2px solid var(--matcha-300);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.qr-scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-accent);
  box-shadow: 0 0 8px var(--matcha-500);
  animation: scanQR 2.2s ease-in-out infinite alternate;
}

@keyframes scanQR {
  0% { top: 5%; }
  100% { top: 92%; }
}

.qr-big-icon {
  font-size: 80px;
  color: var(--matcha-700);
}

.qr-brand-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--matcha-800);
  background: var(--matcha-100);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}

.qr-details-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qr-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qr-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.qr-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.qr-value-bold {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.qr-value-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--matcha-700);
}

.qr-value-memo {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--matcha-800);
  background: #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-matcha);
  font-family: monospace;
}

.qr-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-copy-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid var(--border-matcha);
  color: var(--matcha-700);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-copy-sm:hover {
  background: var(--matcha-200);
  border-color: var(--matcha-500);
}

.btn-copy-sm.highlight {
  background: var(--matcha-600);
  color: #ffffff;
  border-color: var(--matcha-600);
}

.btn-copy-sm.highlight:hover {
  background: var(--matcha-700);
}

.qr-live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-matcha);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--matcha-500);
  box-shadow: 0 0 0 0 rgba(82, 183, 136, 0.7);
  animation: pulseDot 1.6s infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(82, 183, 136, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(82, 183, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(82, 183, 136, 0); }
}

.freebie-notice-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  color: #92400e;
  font-size: 0.88rem;
}

/* Success View */
.success-purchase-hero {
  text-align: center;
  padding: 16px 0 20px;
}

.success-animated-icon {
  width: 72px;
  height: 72px;
  background: var(--gradient-matcha-light);
  color: var(--matcha-700);
  border: 2px solid var(--border-matcha);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: var(--shadow-glow);
  animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-animated-icon .material-symbols-outlined {
  font-size: 44px;
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.success-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.license-vault-card {
  background: var(--matcha-50);
  border: 1px solid var(--border-matcha);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 16px 0 20px;
}

.vault-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-matcha);
}

.vault-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.license-item-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.license-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.license-item-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.license-key-box {
  background: var(--matcha-50);
  border: 1.5px solid var(--border-matcha);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.key-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
}

.key-code {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--matcha-900);
  letter-spacing: 0.5px;
}

.btn-copy-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--matcha-600);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-copy-key:hover {
  background: var(--matcha-700);
}

.license-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.license-validity {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-download-zip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--gradient-matcha);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.25);
  transition: var(--transition-fast);
}

.btn-download-zip:hover {
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.35);
  transform: translateY(-1px);
}

.finish-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 48px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--matcha-600);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 992px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-container {
    height: auto;
    padding: 12px 0;
    flex-wrap: wrap;
  }
  .search-wrapper {
    order: 3;
    max-width: 100%;
  }
  .hero-title {
    font-size: 2rem;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .products-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
