/* Gandalans - Beauty & Skincare (Light theme, Sociolla-style) */
:root {
  --bg: #fafafa;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --accent: #e91e63;
  --accent-hover: #c2185b;
  --accent-soft: rgba(233, 30, 99, 0.12);
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #eeeeee;
  --border-light: #f0f0f0;
  --danger: #d32f2f;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 1.4rem;
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-cart {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s;
}

.btn-cart:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cart-count {
  background: var(--accent);
  color: white;
  font-weight: 600;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-outline {
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-outline:hover {
  background: var(--accent);
  color: white;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(250, 250, 250, 0.85) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 48px 0;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 600;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 10px;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 24px;
}

.hero-search {
  display: flex;
  gap: 8px;
  max-width: 440px;
}

.hero-search input {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.hero-search input::placeholder {
  color: var(--text-muted);
}

.hero-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Sections */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 600;
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 8px;
  max-width: 720px;
  font-size: 0.95rem;
}

.section-desc:last-of-type {
  margin-bottom: 24px;
}

/* Features */
.features {
  padding: 48px 0;
  background: var(--bg-white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-hover);
}

.feature-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
}

.feature-card h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Categories */
.categories {
  padding: 48px 0;
  background: var(--bg);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.category-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  text-decoration: none;
  display: block;
  box-shadow: var(--shadow);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-card span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Brands / Skincare types */
.games {
  padding: 48px 0;
  background: var(--bg-white);
}

.games-slider,
.brands-slider {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.game-card,
.brand-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
  min-width: 160px;
  box-shadow: var(--shadow);
}

.game-card:hover,
.brand-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.game-card img,
.brand-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.game-card h3,
.brand-card h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 12px 4px;
  color: var(--text);
}

.game-card p,
.brand-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 12px 12px;
}

/* Products */
.topup,
.products-featured {
  padding: 48px 0;
  background: var(--bg);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow);
}

.product-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-card .product-info {
  padding: 16px;
}

.product-card h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.product-card .product-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.product-card .product-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.product-card .btn-add {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.product-card .btn-add:hover {
  background: var(--accent-hover);
}

.product-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-card-link img {
  display: block;
}

.product-title-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.98rem;
}

.product-title-link:hover {
  color: var(--accent);
}

.product-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-detail-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}

.btn-detail-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.product-card .product-card-actions .btn-add {
  flex: 1;
  min-width: 0;
}

.featured-grid .product-card img {
  height: 180px;
}

/* CTA */
.cta {
  padding: 48px 0;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  text-align: center;
}

.cta h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.cta p {
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Footer */
.footer {
  padding: 40px 0 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-brand .logo-icon {
  font-size: 1.3rem;
  color: var(--accent);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links h4 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform 0.3s;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  background: var(--bg-white);
}

.cart-items .cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-items .cart-item:last-child {
  border-bottom: none;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.cart-item-info p {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.cart-item-remove:hover {
  color: var(--danger);
}

.cart-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--text-muted);
}

.cart-summary {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-white);
}

/* Checkout form */
.checkout-form label {
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.checkout-form input,
.checkout-form select {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.checkout-form input:focus,
.checkout-form select:focus {
  outline: none;
  border-color: var(--accent);
}

.checkout-total {
  margin-top: 20px;
  padding: 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-white);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  z-index: 300;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  box-shadow: var(--shadow-hover);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Product Detail Modal */
.product-detail-modal {
  max-width: 720px;
}

.product-detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.product-detail-image img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 1;
  object-fit: cover;
}

.product-detail-info h3 {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.product-detail-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.product-detail-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.product-detail-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.product-detail-qty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.product-detail-qty label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.product-detail-qty input {
  width: 80px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text);
  font-size: 1rem;
  text-align: center;
}

.product-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.product-detail-actions .btn {
  flex: 1;
  min-width: 140px;
}

.btn-detail {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-detail:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Order Success */
.order-success-modal .modal-body {
  text-align: center;
  padding: 40px 24px;
}

.order-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.order-success-modal h2 {
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.order-success-modal .order-id,
.order-success-modal .order-total {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.order-success-modal .order-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.load-more-wrap {
  text-align: center;
  margin-top: 24px;
}

@media (max-width: 640px) {
  .product-detail-body {
    grid-template-columns: 1fr;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .games-slider,
  .brands-slider {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-white);
    padding: 16px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    box-shadow: var(--shadow);
  }

  .nav.nav-open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .header-actions .btn-primary {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .games-slider,
  .brands-slider {
    grid-template-columns: repeat(2, 1fr);
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-search {
    flex-direction: column;
  }

  .cta-buttons {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .game-card,
  .brand-card {
    min-width: 140px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}
