/* ==========================================================================
   Bokaja.com — Component Library
   Built on the "Creative Warm" design token system.
   Mobile-first. Accessible. Production-ready.

   Token contract (defined elsewhere, referenced here):
     --color-primary:   #FF6B6B   coral
     --color-secondary: #4A4063   plum
     --color-accent:    #FFB74D   gold
     --bg-base:         #FFF9F5
     --bg-surface:      #FFE8E8
     --text-primary:    #2D2D2D
     --text-secondary:  #6B6B6B
     --color-success:   #7CB342   green
     --color-error:     #E53935   red
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Local component tokens & fallbacks
   Derived values kept local so the component layer is self-sufficient even
   if the global token sheet only ships the base palette.
   -------------------------------------------------------------------------- */
:root {
  /* Palette fallbacks (no-op if globals already define them) */
  --color-primary: #FF6B6B;
  --color-secondary: #4A4063;
  --color-accent: #FFB74D;
  --bg-base: #FFF9F5;
  --bg-surface: #FFE8E8;
  --text-primary: #2D2D2D;
  --text-secondary: #6B6B6B;
  --color-success: #7CB342;
  --color-error: #E53935;

  /* Derived tints/shades */
  --color-primary-hover: #F25555;
  --color-primary-active: #DB4848;
  --color-primary-soft: #FFE3E3;
  --color-secondary-hover: #3A3150;
  --color-accent-hover: #F0A538;
  --color-success-hover: #6BA239;
  --color-error-hover: #CB322D;

  /* Surfaces */
  --surface-card: #FFFFFF;
  --surface-muted: #F4ECE7;
  --border-subtle: #F0DADA;
  --border-strong: #E2C7C7;

  /* Focus ring */
  --focus-ring: 0 0 0 3px rgba(255, 107, 107, 0.45);
  --focus-ring-dark: 0 0 0 3px rgba(74, 64, 99, 0.40);

  /* Typography */
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Fira Code", ui-monospace,
    Menlo, Consolas, monospace;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(45, 45, 45, 0.06), 0 1px 3px rgba(45, 45, 45, 0.08);
  --shadow-md: 0 4px 12px rgba(45, 45, 45, 0.10);
  --shadow-lg: 0 12px 28px rgba(74, 64, 99, 0.16);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-slow: 250ms;

  /* Spacing scale (used by components) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
}

/* --------------------------------------------------------------------------
   1. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--color-primary);
  --btn-fg: #fff;
  --btn-border: transparent;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.25rem;
  min-height: 44px; /* touch target */
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden; /* clip the shine sweep */
  color: var(--btn-fg);
  background-color: var(--btn-bg);
  border: 2px solid var(--btn-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

/* Diagonal light sweep — opt-in via .btn-shine, automatic on primary CTAs.
   A thin band of light slides across the button face on hover. */
.btn-shine::after,
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-180%) skewX(-18deg);
  opacity: 0;
}
.btn-shine:hover::after,
.btn-primary:hover::after {
  animation: btn-shine-sweep var(--dur-slow) var(--ease-out) forwards;
}
@keyframes btn-shine-sweep {
  0% { transform: translateX(-180%) skewX(-18deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateX(280%) skewX(-18deg); opacity: 0; }
}

.btn:hover {
  background-color: var(--color-primary-hover);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Variants */
.btn-primary {
  --btn-bg: var(--color-primary);
  --btn-fg: #fff;
}
.btn-primary:hover { background-color: var(--color-primary-hover); }
.btn-primary:active { background-color: var(--color-primary-active); }

.btn-secondary {
  --btn-bg: transparent;
  --btn-fg: var(--color-secondary);
  --btn-border: var(--color-secondary);
}
.btn-secondary:hover {
  background-color: var(--color-secondary);
  color: #fff;
}
.btn-secondary:active { background-color: var(--color-secondary-hover); }
.btn-secondary:focus-visible { box-shadow: var(--focus-ring-dark); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--color-secondary);
  --btn-border: transparent;
}
.btn-ghost:hover { background-color: var(--surface-muted); }
.btn-ghost:active { background-color: var(--border-subtle); }
.btn-ghost:focus-visible { box-shadow: var(--focus-ring-dark); }

.btn-danger {
  --btn-bg: var(--color-error);
  --btn-fg: #fff;
}
.btn-danger:hover { background-color: var(--color-error-hover); }

/* Sizes */
.btn-sm {
  padding: 0.375rem 0.875rem;
  min-height: 36px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 0.875rem 1.75rem;
  min-height: 52px;
  font-size: 1.0625rem;
}

/* Icon-only square button */
.btn-icon {
  padding: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex: 0 0 auto;
}
.btn-icon.btn-sm { width: 36px; height: 36px; min-height: 36px; }
.btn-icon.btn-lg { width: 52px; height: 52px; min-height: 52px; }

.btn-block { display: flex; width: 100%; }

/* --------------------------------------------------------------------------
   2. Product Card  — the hero component
   -------------------------------------------------------------------------- */
.product-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .product-card-grid { gap: var(--space-5); }
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}
.product-card:hover,
.product-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* Quick-view eye — fades/zooms in at the top-right of the media on hover */
.product-card__quickview {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--color-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: scale(0.8) translateY(-4px);
  transition: opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.product-card:hover .product-card__quickview,
.product-card:focus-within .product-card__quickview {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.product-card__quickview:hover {
  background-color: var(--color-primary);
  color: #fff;
}
.product-card__quickview:focus-visible {
  outline: none;
  opacity: 1;
  transform: scale(1) translateY(0);
  box-shadow: var(--focus-ring);
}

/* Image area — 1:1 */
.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--surface-muted);
}
.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}
.product-card:hover .product-card__image,
.product-card:focus-within .product-card__image {
  transform: scale(1.05);
}

/* Hover overlay with sliding Add to Cart */
.product-card__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-3);
  display: flex;
  justify-content: center;
  background: linear-gradient(
    to top,
    rgba(45, 45, 45, 0.55),
    rgba(45, 45, 45, 0)
  );
  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-out);
}
.product-card:hover .product-card__overlay,
.product-card:focus-within .product-card__overlay {
  transform: translateY(0);
  opacity: 1;
}
.product-card__overlay .btn { width: 100%; box-shadow: var(--shadow-md); }

/* Body */
.product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
}
.product-card__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  /* 2-line clamp */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.7em; /* reserve 2 lines for grid alignment */
}
.product-card__title a {
  color: inherit;
  text-decoration: none;
}
.product-card__title a:hover { color: var(--color-primary); }

.product-card__price {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-secondary);
  letter-spacing: -0.01em;
}
.product-card__price del {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: var(--space-2);
}

.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Badges (positioned, top-left stack) */
.product-card__badges {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}
.badge-sale,
.badge-new,
.badge-bestseller {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.badge-sale { background-color: var(--color-accent); color: var(--text-primary); }
.badge-new { background-color: var(--color-success); }
.badge-bestseller { background-color: var(--color-primary); }

/* SALE gets a playful "sticker" tilt; straightens on card hover for life */
.badge-sale {
  transform: rotate(-8deg);
  transform-origin: center;
  transition: transform var(--dur-base) var(--ease-out);
}
.product-card:hover .badge-sale,
.product-card:focus-within .badge-sale {
  transform: rotate(0deg) scale(1.04);
}

/* --------------------------------------------------------------------------
   3. Trust Badges
   -------------------------------------------------------------------------- */
.trust-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
}
@media (min-width: 768px) {
  .trust-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    gap: var(--space-5);
    padding: var(--space-5) var(--space-6);
  }
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
}
.trust-item i,
.trust-item .trust-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  font-size: 1.125rem;
  color: var(--color-primary);
  background-color: var(--color-primary-soft);
  border-radius: var(--radius-pill);
}
.trust-item__label { line-height: 1.3; }
.trust-item__label small {
  display: block;
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Footer variant — muted on dark/plum footer */
.trust-bar--footer {
  background-color: transparent;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
}

/* Compact inline product-page trust signals */
.trust-bar--product {
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background-color: var(--bg-base);
  border: 1px solid var(--border-subtle);
}
@media (min-width: 768px) {
  .trust-bar--product { flex-direction: column; align-items: flex-start; }
}
.trust-bar--product .trust-item { font-size: 0.875rem; }
.trust-bar--product .trust-item i,
.trust-bar--product .trust-item .trust-item__icon {
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   4. Badge / Pill system
   -------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
  background-color: var(--surface-muted);
  color: var(--text-primary);
  white-space: nowrap;
}

.pill-sale { background-color: var(--color-accent); color: var(--text-primary); }
.pill-new { background-color: var(--color-success); color: #fff; }
.pill-bestseller { background-color: var(--color-primary); color: #fff; }
.pill-featured { background-color: var(--color-secondary); color: #fff; }
.pill-limited {
  background-color: transparent;
  color: var(--color-error);
  border: 1.5px solid var(--color-error);
}

.pill-sm { padding: 0.125rem 0.5rem; font-size: 0.6875rem; }
.pill-lg { padding: 0.375rem 1rem; font-size: 0.875rem; }

/* --------------------------------------------------------------------------
   5. Form elements
   -------------------------------------------------------------------------- */
.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
@media (min-width: 768px) {
  .form-row--inline { flex-direction: row; align-items: flex-end; }
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}
.form-label .req { color: var(--color-error); margin-left: 2px; }

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  min-height: 44px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background-color: var(--surface-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
  appearance: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--text-secondary); }

.textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.5;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%236B6B6B' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

/* Error state */
.input.is-error,
.textarea.is-error,
.select.is-error,
.form-row.is-error .input,
.form-row.is-error .textarea,
.form-row.is-error .select {
  border-color: var(--color-error);
}
.input.is-error:focus-visible,
.textarea.is-error:focus-visible,
.select.is-error:focus-visible {
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.35);
}
.form-error {
  font-size: 0.8125rem;
  color: var(--color-error);
  font-weight: 500;
}

/* Disabled */
.input:disabled,
.textarea:disabled,
.select:disabled {
  background-color: var(--surface-muted);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Input group (prepend/append icons) */
.input-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background-color: var(--surface-card);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.input-group:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}
.input-group .input {
  border: none;
  border-radius: 0;
  flex: 1 1 auto;
}
.input-group .input:focus-visible { box-shadow: none; }
.input-group__addon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.875rem;
  color: var(--text-secondary);
  background-color: var(--surface-muted);
  font-size: 0.9375rem;
}
.input-group.is-error { border-color: var(--color-error); }

/* --------------------------------------------------------------------------
   6. Breadcrumb (schema.org BreadcrumbList compatible markup)
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.breadcrumb__item a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.breadcrumb__item a:hover { color: var(--color-primary); }
.breadcrumb__item a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}
.breadcrumb__item[aria-current="page"],
.breadcrumb__item--current {
  color: var(--text-primary);
  font-weight: 600;
}
.breadcrumb__sep {
  color: var(--border-strong);
  user-select: none;
}
.breadcrumb__sep::before { content: "/"; }

/* --------------------------------------------------------------------------
   7. Star rating display (fractional via width %)
   -------------------------------------------------------------------------- */
.stars {
  --star-size: 1rem;
  --star-fill: var(--color-accent);
  --star-empty: var(--border-strong);
  --star-pct: 100%;

  display: inline-block;
  position: relative;
  font-size: var(--star-size);
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* empty layer */
.stars::before {
  content: "★★★★★";
  color: var(--star-empty);
  letter-spacing: 0.1em;
}
/* filled layer clipped to percentage — clip-path keeps the cut crisp
   even on fractional widths (no anti-alias bleed at the clip edge) */
.stars::after {
  content: "★★★★★";
  color: var(--star-fill);
  letter-spacing: 0.1em;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 calc(100% - var(--star-pct)) 0 0);
  -webkit-clip-path: inset(0 calc(100% - var(--star-pct)) 0 0);
}
.stars-sm { --star-size: 0.8125rem; }
.stars-lg { --star-size: 1.375rem; }

.stars__count {
  margin-left: var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   8. Skeleton loaders
   -------------------------------------------------------------------------- */
.skeleton {
  --sk-base: var(--surface-muted);
  --sk-sheen: #fff;
  position: relative;
  background-color: var(--sk-base);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 40%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0.35) 60%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.8s var(--ease-out) infinite;
}
@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}

.skeleton-text {
  height: 0.75rem;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-pill);
}
.skeleton-text:last-child { width: 60%; margin-bottom: 0; }

.skeleton-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.skeleton-card .skeleton-image { margin-bottom: var(--space-1); }

/* --------------------------------------------------------------------------
   9. Toast notifications
   -------------------------------------------------------------------------- */
.toast-region {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;

  /* mobile: top, full width */
  top: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
}
@media (min-width: 768px) {
  .toast-region {
    /* desktop: bottom-right */
    top: auto;
    left: auto;
    bottom: var(--space-5);
    right: var(--space-5);
    width: 360px;
  }
}

.toast {
  --toast-accent: var(--color-secondary);
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--surface-card);
  color: var(--text-primary);
  border-left: 4px solid var(--toast-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: toast-in var(--dur-slow) var(--ease-out);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 768px) {
  @keyframes toast-in {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
  }
}

.toast__icon {
  flex: 0 0 auto;
  font-size: 1.125rem;
  color: var(--toast-accent);
  line-height: 1.4;
}
.toast__body { flex: 1 1 auto; font-size: 0.875rem; line-height: 1.4; }
.toast__title { font-weight: 700; margin: 0 0 2px; }
.toast__close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  border-radius: var(--radius-sm);
}
.toast__close:hover { color: var(--text-primary); }
.toast__close:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* auto-dismiss progress bar */
.toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background-color: var(--toast-accent);
  transform-origin: left center;
  animation: toast-progress 4s linear forwards;
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.toast-success { --toast-accent: var(--color-success); }
.toast-error { --toast-accent: var(--color-error); }
.toast-info { --toast-accent: var(--color-secondary); }
.toast-warning { --toast-accent: var(--color-accent); }

/* Type icons — render a glyph in the accent color when the icon slot is
   left empty, so every toast variant is recognizable at a glance.
   (If markup already supplies a Font Awesome <i>, that takes precedence.) */
.toast__icon:empty::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: var(--radius-pill);
  background-color: var(--toast-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}
.toast-success .toast__icon:empty::before { content: "\2713"; }   /* checkmark */
.toast-error   .toast__icon:empty::before { content: "\2715"; }   /* x */
.toast-info    .toast__icon:empty::before { content: "i"; font-style: italic; font-family: Georgia, serif; }
.toast-warning .toast__icon:empty::before { content: "!"; color: var(--text-primary); }

/* --------------------------------------------------------------------------
   10. Newsletter signup
   -------------------------------------------------------------------------- */
.newsletter {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: linear-gradient(135deg, var(--bg-surface), var(--color-primary-soft));
  border-radius: var(--radius-lg);
  text-align: center;
}
@media (min-width: 768px) {
  .newsletter { padding: var(--space-6); }
}
.newsletter__heading {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
}
.newsletter__subtext {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.newsletter__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
@media (min-width: 768px) {
  .newsletter__form {
    flex-direction: row;
    max-width: 460px;
    margin-inline: auto;
    width: 100%;
  }
  .newsletter__form .input { flex: 1 1 auto; }
}
.newsletter__form .input {
  background-color: var(--surface-card);
}

/* Success state */
.newsletter__success {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--color-success);
  opacity: 0;
}
.newsletter.is-success .newsletter__form { display: none; }
.newsletter.is-success .newsletter__success {
  display: flex;
  animation: newsletter-pop var(--dur-slow) var(--ease-out) forwards;
}
.newsletter__success i,
.newsletter__success .newsletter__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-success);
  color: #fff;
  font-size: 0.875rem;
}
@keyframes newsletter-pop {
  0% { opacity: 0; transform: scale(0.85); }
  60% { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

/* Sparkle burst — a few CSS dots pop and fade around the success message.
   Add <span class="newsletter__sparkles" aria-hidden="true"></span> inside
   .newsletter__success, or it appears automatically via the success layer. */
.newsletter__success { position: relative; }
.newsletter.is-success .newsletter__success::before,
.newsletter.is-success .newsletter__success::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  /* layered dots via radial-gradient "confetti" */
  background:
    radial-gradient(circle, var(--color-accent) 60%, transparent 62%) 0 0 / 6px 6px no-repeat;
  box-shadow:
    -42px -10px 0 -1px var(--color-primary),
    44px -6px 0 -1px var(--color-success),
    -28px 16px 0 -2px var(--color-accent),
    34px 14px 0 -2px var(--color-secondary);
  opacity: 0;
  animation: newsletter-sparkle 700ms var(--ease-out) 120ms forwards;
}
.newsletter.is-success .newsletter__success::after {
  animation-delay: 220ms;
  filter: hue-rotate(40deg);
}
@keyframes newsletter-sparkle {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(1.15); }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .product-card:hover,
  .product-card:focus-within { transform: none; }
  .product-card:hover .product-card__image,
  .product-card:focus-within .product-card__image { transform: none; }
  .product-card__overlay { transition: opacity var(--dur-fast) linear; }
  .btn:active { transform: none; }
  .btn-shine:hover::after,
  .btn-primary:hover::after { animation: none; opacity: 0; }
  .badge-sale { transform: rotate(-8deg); transition: none; }
  .product-card:hover .badge-sale,
  .product-card:focus-within .badge-sale { transform: rotate(-8deg); }
  .newsletter.is-success .newsletter__success::before,
  .newsletter.is-success .newsletter__success::after { animation: none; opacity: 0; }
  .skeleton::after { animation: none; }
  .toast__progress { animation: none; transform: scaleX(0); }
}
