/**
 * Mimin Woo - Main Stylesheet (< 30KB Budget)
 * High-performance, clean modern aesthetics, mobile-first.
 */

:root {
  --wac-primary: #128c7e;
  --wac-wa-green: #25d366;
  --wac-wa-hover: #1ebd5a;
  --wac-wa-dark: #075e54;
  --wac-bg: #f8fafc;
  --wac-surface: #ffffff;
  --wac-text: #0f172a;
  --wac-text-muted: #64748b;
  --wac-border: #e2e8f0;
  --wac-radius: 12px;
  --wac-radius-sm: 8px;
  --wac-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --wac-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --wac-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--wac-font);
  background-color: var(--wac-bg);
  color: var(--wac-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.wac-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Site Header */
.wac-header {
  background: var(--wac-surface);
  border-bottom: 1px solid var(--wac-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.wac-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.wac-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--wac-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.wac-logo-badge {
  font-size: 0.6875rem;
  background: #ecfdf5;
  color: var(--wac-primary);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}
.wac-nav {
  display: flex;
  gap: 16px;
}
.wac-nav a {
  font-size: 0.875rem;
  color: var(--wac-text-muted);
  font-weight: 500;
  transition: color 0.15s;
}
.wac-nav a:hover {
  color: var(--wac-primary);
}

/* Hero / Banner */
.wac-hero {
  padding: 32px 0 16px;
  text-align: center;
}
.wac-hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--wac-text);
}
.wac-hero-desc {
  font-size: 0.95rem;
  color: var(--wac-text-muted);
  margin-top: 6px;
}

/* Category Filter Bar */
.wac-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 24px;
  scrollbar-width: none;
}
.wac-filter-bar::-webkit-scrollbar {
  display: none;
}
.wac-pill {
  white-space: nowrap;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--wac-surface);
  border: 1px solid var(--wac-border);
  color: var(--wac-text-muted);
  transition: all 0.15s;
}
.wac-pill:hover, .wac-pill.active {
  background: var(--wac-text);
  color: #fff;
  border-color: var(--wac-text);
}

/* Product Catalog Grid */
.wac-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
@media (min-width: 640px) {
  .wac-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}
@media (min-width: 1024px) {
  .wac-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

/* Product Card */
.wac-card {
  background: var(--wac-surface);
  border-radius: var(--wac-radius);
  border: 1px solid var(--wac-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.wac-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--wac-shadow-hover);
}
.wac-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  overflow: hidden;
}
.wac-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.wac-card:hover .wac-card-img {
  transform: scale(1.04);
}
.wac-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}
.wac-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--wac-text);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--wac-radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}
.wac-badge-sale {
  background: #ef4444;
}
.wac-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.wac-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wac-card-title a:hover {
  color: var(--wac-primary);
}
.wac-card-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--wac-primary);
  margin-bottom: 12px;
}
.wac-card-price del {
  color: var(--wac-text-muted);
  font-size: 0.8125rem;
  font-weight: 400;
  margin-right: 4px;
}
.wac-card-price ins {
  text-decoration: none;
}
.wac-card-actions {
  margin-top: auto;
}

/* WhatsApp Buttons */
.wac-wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--wac-radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
  text-align: center;
  border: none;
}
.wac-wa-btn:active {
  transform: scale(0.98);
}
.btn-wa-primary {
  background-color: var(--wac-wa-green);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 211, 102, 0.25);
}
.btn-wa-primary:hover {
  background-color: var(--wac-wa-hover);
  color: #ffffff;
}
.btn-wa-secondary {
  background-color: var(--wac-surface);
  color: var(--wac-text);
  border: 1px solid var(--wac-border);
}
.btn-wa-secondary:hover {
  background-color: #f1f5f9;
}
.wac-btn-full {
  width: 100%;
}
.btn-wa-icon-only {
  padding: 10px 14px;
  font-size: 1.1rem;
}
.btn-wa-flex {
  flex-grow: 1;
}

/* Single Product Page Layout */
.wac-single-wrap {
  padding: 32px 0 64px;
}
.wac-single-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}
@media (min-width: 768px) {
  .wac-single-grid {
    grid-template-columns: 4.5fr 5.5fr;
    gap: 40px;
  }
}
@media (min-width: 1024px) {
  .wac-single-grid {
    grid-template-columns: 4.5fr 5.5fr;
    gap: 48px;
  }
}
.wac-single-gallery {
  position: relative;
}
.wac-main-image {
  border-radius: var(--wac-radius);
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--wac-border);
  aspect-ratio: 1 / 1;
  position: relative;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.wac-main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}
.wac-main-image:hover img {
  transform: scale(1.02);
}
.wac-zoom-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  border: 1px solid var(--wac-border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  color: var(--wac-text);
  pointer-events: none;
  transition: transform 0.15s ease;
  z-index: 5;
}
.wac-main-image:hover .wac-zoom-hint {
  transform: scale(1.1);
}
.wac-gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  padding-top: 2px;
}
.wac-gallery-thumbs::-webkit-scrollbar {
  display: none;
}
.wac-thumb-item {
  width: 68px;
  height: 68px;
  aspect-ratio: 1 / 1;
  border-radius: var(--wac-radius-sm);
  border: 2px solid transparent;
  background: #f8fafc;
  padding: 4px;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.65;
  transition: all 0.15s ease;
}
.wac-thumb-item:hover,
.wac-thumb-item.active {
  border-color: var(--wac-primary);
  opacity: 1;
  transform: translateY(-2px);
}
.wac-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Product Info Box (Desktop Sticky) */
.wac-single-info {
  position: relative;
}
@media (min-width: 768px) {
  .wac-single-info {
    position: sticky;
    top: 84px;
  }
}
.wac-info-title {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
}
.wac-info-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--wac-text-muted);
  margin-bottom: 16px;
}
.wac-info-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--wac-primary);
  margin-bottom: 24px;
}
.wac-info-price del {
  color: var(--wac-text-muted);
  font-size: 1.125rem;
  font-weight: 400;
  margin-right: 8px;
}

/* Variations UI (Hybrid Chips & Dropdowns) */
.wac-variants-box {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--wac-surface);
  border-radius: var(--wac-radius);
  border: 1px solid var(--wac-border);
}
.wac-variant-group {
  margin-bottom: 14px;
}
.wac-variant-group:last-child {
  margin-bottom: 0;
}
.wac-variant-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--wac-text-muted);
  margin-bottom: 6px;
}
.wac-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.wac-chip-btn {
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--wac-border);
  border-radius: var(--wac-radius-sm);
  background: #ffffff;
  color: var(--wac-text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wac-chip-btn:hover {
  border-color: var(--wac-text);
}
.wac-chip-btn.active {
  background: var(--wac-text);
  color: #ffffff;
  border-color: var(--wac-text);
}
.wac-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--wac-radius-sm);
  border: 1px solid var(--wac-border);
  background: #fff;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--wac-text);
  outline: none;
}
.wac-select:focus {
  border-color: var(--wac-primary);
}

/* Native HTML5 Lightbox */
dialog.wac-lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  outline: none;
  overflow: hidden;
}
dialog.wac-lightbox::backdrop {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
}
.wac-lb-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 1.75rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background-color 0.15s;
}
.wac-lb-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
.wac-lb-body {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 20px;
  box-sizing: border-box;
}
.wac-lb-figure {
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.wac-lb-figure img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.wac-lb-nav {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 2.2rem;
  line-height: 1;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  flex-shrink: 0;
  transition: background-color 0.15s, transform 0.1s;
}
.wac-lb-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}
.wac-lb-nav:active {
  transform: scale(0.95);
}
.wac-lb-footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #f1f5f9;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 1000;
}

/* Quantity & CTA Row */
.wac-buy-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}
.wac-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wac-qty-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wac-text-muted);
}
.wac-qty-counter {
  display: inline-flex;
  border: 1px solid var(--wac-border);
  border-radius: var(--wac-radius-sm);
  overflow: hidden;
  background: #fff;
}
.wac-qty-btn {
  background: #f8fafc;
  border: none;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--wac-text);
  transition: background 0.15s;
}
.wac-qty-btn:hover {
  background: #e2e8f0;
}
.wac-qty-input {
  width: 48px;
  border: none;
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: inherit;
}
.wac-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 480px) {
  .wac-action-buttons {
    flex-direction: row;
  }
  .wac-action-buttons .wac-wa-btn {
    flex: 1;
  }
}

/* Description Section */
.wac-desc-box {
  background: var(--wac-surface);
  border-radius: var(--wac-radius);
  border: 1px solid var(--wac-border);
  padding: 24px;
  margin-top: 32px;
}
.wac-desc-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.wac-desc-content {
  color: #334155;
  line-height: 1.7;
}

/* Sticky Mobile Bottom Bar */
.wac-sticky-mobile-bar {
  display: none;
}
@media (max-width: 767px) {
  .wac-sticky-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--wac-border);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
  }
  .wac-sticky-info {
    display: flex;
    flex-direction: column;
    max-width: 45%;
  }
  .wac-sticky-title {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .wac-sticky-price {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--wac-primary);
  }
  .wac-sticky-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-end;
  }
  /* Give space to body so sticky bar does not cover content */
  body.single-product {
    padding-bottom: 80px;
  }
}

/* Site Footer */
.wac-footer {
  background: var(--wac-surface);
  border-top: 1px solid var(--wac-border);
  padding: 32px 0;
  margin-top: 64px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--wac-text-muted);
}
.wac-footer-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.wac-speed-badge {
  color: var(--wac-primary);
  font-weight: 600;
}
