/* ==========================================================================
   HUWII EVENTS STORE — ecommerce add-ons.
   Loaded AFTER assets/site.css (the main design system). Only contains
   store-specific components; everything else comes from site.css.
   ========================================================================== */

:root {
  --color-success: #1a7f37;
  --color-success-soft: #e6f4ea;
  --color-danger: #b3261e;
  --color-danger-soft: #fdecea;
  --color-whatsapp: #25d366;
}

/* Button variants on top of site.css .btn ---------------------------------- */

.btn--whatsapp { background: var(--color-whatsapp); color: #fff !important; border-color: transparent; }
.btn--whatsapp:hover { background: #1eb85a; color: #fff; }
.btn--danger { background: var(--color-danger); color: #fff !important; border-color: transparent; }
.btn--danger:hover { background: #8f1e18; color: #fff; }
.btn--sm { padding: 0.4rem 1rem; font-size: var(--text-xs); }
.btn--block { display: block; width: 100%; text-align: center; }

button.btn { cursor: pointer; font-family: var(--font-display); }

.cart-badge {
  background: #fff; color: var(--color-primary-dark);
  border-radius: var(--radius-pill); padding: 0 0.45rem;
  font-size: var(--text-xs); display: inline-block; min-width: 1.2em;
}

/* Flash messages ------------------------------------------------------------ */

.flash {
  margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md); font-weight: 600;
}
.flash--success { background: var(--color-success-soft); color: var(--color-success); }
.flash--error { background: var(--color-danger-soft); color: var(--color-danger); }

/* Page head for store utility pages (cart, login, account…) ------------------ */

.page-head { padding: var(--space-5) 0 var(--space-3); }
.page-head p { color: var(--color-muted); max-width: 640px; }

/* Shop product cards (distinct from site.css .product-card teasers) ---------- */

.shop-grid {
  display: grid; gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  padding: 0; margin: 0; list-style: none;
}

.shop-card {
  background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shop-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.shop-card__img {
  aspect-ratio: 1 / 1; object-fit: cover; width: 100%;
  background: var(--color-primary-soft);
}
.shop-card__body { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); flex: 1; }
.shop-card__cat { color: var(--color-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; }
.shop-card__name { font-size: var(--text-md); margin: 0; }
.shop-card__name a { color: var(--color-ink); text-decoration: none; }
.shop-card__name a:hover { color: var(--color-primary-dark); }
.shop-card__price { font-family: var(--font-display); color: var(--color-primary-dark); margin-top: auto; }
.shop-card__actions { padding: 0 var(--space-3) var(--space-3); display: grid; gap: var(--space-2); }

.badge--out { background: var(--color-danger-soft); color: var(--color-danger); }
.badge--enquire { background: var(--color-primary-soft); color: var(--color-primary-dark); }

/* Product detail -------------------------------------------------------------- */

.product-detail {
  display: grid; gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start; padding: var(--space-5) 0;
}
.product-detail__img {
  border-radius: var(--radius-lg); border: 1px solid var(--color-line);
  width: 100%; object-fit: cover; background: var(--color-surface);
}
.product-detail__price { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-primary-dark); }
.qty-input { width: 5.5rem; }

@media (max-width: 760px) {
  .product-detail { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* Filter bar + pagination (shop) ---------------------------------------------- */

.filter-bar {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  align-items: center; margin-bottom: var(--space-4);
}
.filter-bar form { display: flex; gap: var(--space-2); flex: 1; min-width: 220px; }
.filter-bar input[type="search"] { flex: 1; }

.fchip {
  text-decoration: none; font-size: var(--text-sm); font-weight: 600;
  padding: 0.3rem 1rem; border-radius: var(--radius-pill);
  border: 1px solid var(--color-line); color: var(--color-text); background: var(--color-surface);
}
.fchip:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }
.fchip--active { background: var(--color-ink); color: #fff !important; border-color: var(--color-ink); }

.pagination { display: flex; gap: var(--space-2); justify-content: center; align-items: center; padding: var(--space-4) 0; }

/* Store forms (login, checkout, admin…) — bare inputs inside .field ------------ */

.form-card {
  background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: var(--radius-lg); padding: var(--space-4);
  box-shadow: var(--shadow-card);
}
.form-narrow { max-width: 480px; margin: 0 auto; }

.field { margin-bottom: var(--space-3); }
.field label { display: block; font-weight: 600; margin-bottom: var(--space-1); font-size: var(--text-sm); }

.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="tel"], .field input[type="number"], .field input[type="file"],
.field select, .field textarea,
.qty-input, .filter-bar input[type="search"] {
  width: 100%; padding: 0.6rem 0.9rem;
  border: 2px solid var(--color-line); border-radius: var(--radius-md);
  font: inherit; color: var(--color-text); background: var(--color-surface);
}
.field textarea { min-height: 110px; resize: vertical; }
.qty-input { width: 5.5rem; }

.field-hint { color: var(--color-muted); font-size: var(--text-xs); margin-top: 0.2rem; }

/* site.css .form-grid supports .form-field--full; add support for .field too */
@media (min-width: 640px) {
  .form-grid .field--full { grid-column: 1 / -1; }
}

/* Tables (cart, orders, admin) — collapse to cards on small screens ------------ */

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; }
.data-table th, .data-table td {
  text-align: left; padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-line); vertical-align: middle;
}
.data-table th {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: var(--text-xs); letter-spacing: 0.05em; color: var(--color-muted);
  background: var(--color-paper);
}
.data-table img.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); }

@media (max-width: 700px) {
  .data-table--stack thead { display: none; }
  .data-table--stack tr { display: block; border-bottom: 6px solid var(--color-paper); }
  .data-table--stack td {
    display: flex; justify-content: space-between; align-items: center;
    gap: var(--space-3); border-bottom: 1px dashed var(--color-line);
  }
  .data-table--stack td::before {
    content: attr(data-label);
    font-family: var(--font-display); font-size: var(--text-xs);
    text-transform: uppercase; color: var(--color-muted);
  }
}

/* Order status pills ------------------------------------------------------------ */

.status { display: inline-block; padding: 0.1rem 0.75rem; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 700; text-transform: capitalize; }
.status--pending    { background: #fff4d6; color: #8a6400; }
.status--confirmed  { background: #e0f0ff; color: #14508c; }
.status--processing { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.status--delivered  { background: var(--color-success-soft); color: var(--color-success); }
.status--cancelled  { background: var(--color-danger-soft); color: var(--color-danger); }

/* Order summary / checkout -------------------------------------------------------- */

.summary-card {
  background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: var(--radius-lg); padding: var(--space-4);
}
.summary-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) 0; }
.summary-row--total {
  border-top: 2px solid var(--color-ink); margin-top: var(--space-2); padding-top: var(--space-2);
  font-family: var(--font-display); font-size: var(--text-md);
}

.checkout-grid { display: grid; gap: var(--space-4); grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 820px) { .checkout-grid { grid-template-columns: 1fr; } }

/* Account / Admin dashboards -------------------------------------------------------- */

.dash { display: grid; gap: var(--space-4); grid-template-columns: 230px 1fr; align-items: start; padding: var(--space-5) 0; }
.dash-nav {
  background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: var(--radius-lg); padding: var(--space-3); position: sticky; top: 90px;
}
.dash-nav ul { list-style: none; margin: 0; padding: 0; }
.dash-nav a {
  display: block; padding: var(--space-2) var(--space-3);
  text-decoration: none; color: var(--color-text); font-weight: 600;
  border-radius: var(--radius-md); font-size: var(--text-sm);
}
.dash-nav a:hover { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.dash-nav a.active { background: var(--color-ink); color: #fff; }

@media (max-width: 820px) {
  .dash { grid-template-columns: 1fr; }
  .dash-nav { position: static; }
  .dash-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-1); }
  .dash-nav li { flex: 1 1 auto; }
  .dash-nav a { text-align: center; padding: var(--space-2); }
}

.stat-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: var(--space-4); }
.stat-card {
  background: var(--color-surface); border: 1px solid var(--color-line);
  border-radius: var(--radius-lg); padding: var(--space-3);
}
.stat-card__num { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-ink); }
.stat-card__label { color: var(--color-muted); font-size: var(--text-sm); }

.dash-head { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.dash-head h1 { font-size: var(--text-xl); margin: 0; text-transform: uppercase; }

/* Floating WhatsApp button ------------------------------------------------------------ */

.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--color-whatsapp); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lift); transition: transform 0.15s ease;
}
.wa-float:hover { transform: scale(1.08); color: #fff; }

/* Motion layer (paired with assets/site.js) --------------------------------------------- */

.site-header {
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
/* Full uncropped logo, sized for presence without clipping */
.brand img { height: 56px; width: auto; }
.site-header.is-scrolled {
  background: rgba(22, 19, 15, 0.88);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Audience strip marquee (activated by site.js) */
.audience-strip.fx-marquee ul { overflow-x: visible; will-change: transform; }

/* Hero decor: floating gradient shapes injected by site.js */
.fx-hero { position: relative; overflow: hidden; }
.fx-hero .container { position: relative; z-index: 2; }
.fx-shape {
  position: absolute; z-index: 1; pointer-events: none;
  border-radius: 38% 62% 55% 45% / 45% 40% 60% 55%;
  filter: blur(2px); opacity: 0.55; will-change: transform;
}
.fx-shape--1 { width: 160px; height: 160px; top: 12%; right: 8%;
  background: linear-gradient(135deg, var(--color-primary), transparent 75%); }
.fx-shape--2 { width: 90px; height: 90px; top: 58%; right: 22%;
  background: linear-gradient(45deg, var(--color-accent), transparent 70%); opacity: 0.4; }
.fx-shape--3 { width: 60px; height: 60px; top: 24%; left: 6%; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd166, var(--color-primary) 70%); opacity: 0.35; }
.fx-shape--4 { width: 220px; height: 220px; bottom: -60px; left: 18%;
  background: linear-gradient(160deg, var(--color-primary-dark), transparent 70%); opacity: 0.25; }

/* Give tilted cards visible depth + smoother media hovers */
.pillar-card, .shop-card, .product-card, .testimonial, .growth-card {
  will-change: transform;
  transform-style: preserve-3d;
}
.shop-card__img, .pillar-card__media img, .product-card img {
  transition: transform 0.5s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.shop-card:hover .shop-card__img { transform: scale(1.06); }

/* Reviews: richer card treatment + avatar (injected by site.js) */
.testimonial {
  position: relative;
  border-top: 4px solid var(--color-primary);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
.testimonial:hover { box-shadow: var(--shadow-lift); }
.testimonial::before {
  content: "\201C";
  position: absolute; top: -6px; right: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 6.5rem; line-height: 1;
  color: var(--color-primary-soft);
  pointer-events: none;
}
.testimonial__stars { color: #f5a623; font-size: var(--text-base); position: relative; }
.testimonial blockquote { position: relative; }
.testimonial cite { display: flex; align-items: center; gap: var(--space-2); }
.testimonial__avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: var(--text-sm); color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  box-shadow: 0 4px 12px rgba(224, 82, 0, 0.35);
}

/* WhatsApp button: soft radar pulse (motion-safe users only) */
@media (prefers-reduced-motion: no-preference) {
  .wa-float::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
    animation: wa-pulse 2.4s ease-out infinite;
  }
  @keyframes wa-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
    70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
  }
}

/* Utilities ---------------------------------------------------------------------------- */

.muted { color: var(--color-muted); }
.text-right { text-align: right; }
.empty-state {
  text-align: center; padding: var(--space-6) var(--space-3);
  background: var(--color-surface); border: 1px dashed var(--color-line);
  border-radius: var(--radius-lg);
}
.empty-state .btn { margin-top: var(--space-2); }
