:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.container--narrow { max-width: 720px; }

.main { min-height: calc(100vh - 160px); }

/* Accessibility utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 1px 0 rgba(99, 102, 241, 0.06);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: opacity 0.2s;
}

.logo:hover { opacity: 0.85; }

.logo__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.logo__mark svg {
  width: 20px;
  height: 20px;
}

.logo__img {
  max-height: 44px;
  max-width: 180px;
  object-fit: contain;
}

.logo__text { color: var(--text); }

.logo span { color: var(--primary); }

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.nav-cart { position: relative; }

.nav-btn-logout,
.nav-btn-register {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn-logout svg,
.nav-btn-register svg {
  width: 16px;
  height: 16px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: 0.2s;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.95rem;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover { color: var(--primary); }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge--paid { background: var(--success); }
.badge--pending { background: var(--warning); }
.badge--cancelled { background: var(--error); }

/* Hero */
.hero {
  position: relative;
  padding: 3.5rem 0 4rem;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 55%),
    linear-gradient(135deg, #eef2ff 0%, #f8fafc 45%, #fdf4ff 100%);
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__content { max-width: 560px; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
  margin: 0.5rem 0 1rem;
  letter-spacing: -0.03em;
}

.hero__text {
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(99, 102, 241, 0.15);
}

.hero__stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hero__stat strong {
  font-size: 1.1rem;
  color: var(--primary);
}

.hero__stat span {
  font-size: 0.82rem;
  color: var(--muted);
}

.hero__showcase {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
}

.hero__glow {
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-product {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: min(240px, 42vw);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: heroFloat 0.7s ease backwards;
  animation-delay: var(--delay, 0s);
  z-index: 1;
}

.hero-product:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 28px 60px rgba(99, 102, 241, 0.2);
  z-index: 3;
}

.hero-product--1 {
  top: 8%;
  left: 5%;
  transform: rotate(-4deg);
}

.hero-product--1:hover {
  transform: rotate(-2deg) translateY(-6px) scale(1.02);
}

.hero-product--2 {
  top: 28%;
  right: 0;
  transform: rotate(3deg);
  z-index: 2;
}

.hero-product--2:hover {
  transform: rotate(1deg) translateY(-6px) scale(1.02);
}

.hero-product--3 {
  bottom: 5%;
  left: 18%;
  transform: rotate(-2deg);
}

.hero-product--3:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
}

.hero-product__img {
  aspect-ratio: 1;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1rem;
}

.hero-product__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-product__info {
  padding: 0.85rem 1rem 1rem;
}

.hero-product__cat {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.hero-product__info h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-product__price {
  font-weight: 800;
  color: var(--primary);
  font-size: 1rem;
}

@keyframes heroFloat {
  from {
    opacity: 0;
    transform: translateY(24px) rotate(0deg);
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

/* Sections */
.section { padding: 3rem 0; }
.section--muted { background: #f1f5f9; }

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.link { color: var(--primary); font-weight: 600; }

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.feature {
  background: var(--surface);
  padding: 1.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

.feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.feature__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 1rem;
}

.feature__icon svg {
  width: 24px;
  height: 24px;
}

.feature__icon--indigo { background: #eef2ff; color: #6366f1; }
.feature__icon--amber { background: #fffbeb; color: #f59e0b; }
.feature__icon--emerald { background: #ecfdf5; color: #10b981; }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.products-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Product card */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.product-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  transition: transform 0.25s ease;
}

.product-card:hover .product-card__media img {
  transform: scale(1.04);
}

.product-card__badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.product-card__badge--warn {
  left: auto;
  right: 0.65rem;
  color: #b45309;
  background: rgba(255, 251, 235, 0.95);
  border-color: rgba(245, 158, 11, 0.25);
}

.product-card__badge--muted {
  left: auto;
  right: 0.65rem;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.95);
  border-color: var(--border);
}

.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
  padding: 1rem 1.1rem 1.1rem;
}

.product-card__title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__title a:hover {
  color: var(--primary);
}

.product-card__desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-top: 0.15rem;
}

.product-card__rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  min-width: 0;
}

.product-card__stars {
  display: inline-flex;
  gap: 0.05rem;
}

.product-card__stars .star {
  font-size: 0.82rem;
  line-height: 1;
}

.product-card__rating-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.product-card__reviews {
  font-size: 0.78rem;
  color: var(--muted);
}

.product-card__reviews--empty {
  font-style: italic;
}

.product-card__stock {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.product-card__stock--ok {
  color: var(--success);
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.product-card__price-wrap .price {
  font-size: 1.15rem;
}

.product-card__unavailable {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.price { font-weight: 700; color: var(--primary); }
.price--lg { font-size: 1.75rem; }

.rating { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; }
.rating small, .rating span { color: var(--muted); font-size: 0.85rem; margin-left: 0.25rem; }
.star { color: #cbd5e1; }
.star.filled { color: #fbbf24; }
.rating--lg .star { font-size: 1.25rem; }

/* Product detail */
.pd {
  padding: 1.5rem 0 3rem;
}

.pd-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.pd-breadcrumb a:hover {
  color: var(--primary);
}

.pd-breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 2.5rem;
  align-items: start;
}

.pd-gallery__frame {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pd-gallery__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.pd-gallery:hover .pd-gallery__frame img {
  transform: scale(1.03);
}

.pd-gallery__thumbs {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.pd-gallery__thumb {
  width: 72px;
  height: 72px;
  padding: 0.35rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.pd-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pd-gallery__thumb:hover,
.pd-gallery__thumb.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.hero-product__link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.hero-product__dismiss {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 4;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.75;
  transform: scale(1);
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.hero-product__dismiss svg {
  width: 14px;
  height: 14px;
}

.hero-product:hover .hero-product__dismiss,
.hero-product__dismiss:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.hero-product__dismiss:hover {
  background: rgba(239, 68, 68, 0.9);
}

.hero-product--out {
  animation: heroDismiss 0.28s ease forwards;
  pointer-events: none;
}

.hero-product--in {
  animation: heroFloat 0.55s ease backwards;
}

@keyframes heroDismiss {
  to {
    opacity: 0;
    transform: scale(0.85) translateY(-12px);
  }
}

.pd-info__sticky {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: 1rem;
}

.pd-badge {
  display: inline-flex;
  align-self: start;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: #eef2ff;
  border-radius: 999px;
}

.pd-badge:hover {
  background: #e0e7ff;
}

.pd-title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.pd-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.pd-rating__stars {
  display: inline-flex;
  gap: 0.1rem;
}

.pd-rating__stars .star {
  font-size: 1.05rem;
}

.pd-rating__value {
  font-weight: 700;
  font-size: 0.95rem;
}

.pd-rating__link {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pd-rating__link:hover {
  color: var(--primary);
}

.pd-rating__empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.pd-price-block {
  padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, #fafafa 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pd-price {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.pd-price-note {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.pd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.pd-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.pd-meta__item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pd-meta__item--ok {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.pd-meta__item--out {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.pd-desc {
  padding-top: 0.25rem;
}

.pd-desc__title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.pd-desc p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}

.pd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.pd-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.pd-qty__btn {
  width: 42px;
  height: 46px;
  border: none;
  background: #f8fafc;
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.15s;
}

.pd-qty__btn:hover {
  background: #eef2ff;
  color: var(--primary);
}

.pd-qty__input {
  width: 52px;
  height: 46px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font: inherit;
  font-weight: 600;
  -moz-appearance: textfield;
}

.pd-qty__input::-webkit-outer-spin-button,
.pd-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pd-actions__cart {
  flex: 1;
  min-width: 180px;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.pd-share {
  display: grid;
  gap: 0.65rem;
  padding-top: 1rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.pd-share__label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.pd-share__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pd-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.pd-share__btn svg {
  width: 16px;
  height: 16px;
}

.pd-share__btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #fafaff;
}

.pd-reviews__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pd-reviews__head h2 {
  margin: 0 0 0.35rem;
}

.pd-reviews__summary {
  margin: 0;
  color: var(--muted);
}

.pd-reviews__score {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.pd-review-form {
  margin-bottom: 1.5rem;
}

.pd-review-hint {
  margin-bottom: 1.25rem;
}

.pd-review-item .review-item__head {
  align-items: flex-start;
}

.pd-review-author {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--primary);
  background: #eef2ff;
  border-radius: 50%;
  flex-shrink: 0;
}

.pd-review-meta {
  display: grid;
  gap: 0.15rem;
}

.pd-review-title {
  margin: 0.75rem 0 0.35rem;
  font-size: 1rem;
}

.pd-review-text {
  margin: 0;
  line-height: 1.65;
  color: #334155;
}

.pd-reviews__empty {
  text-align: center;
  padding: 2rem;
}

.in-stock { color: var(--success); font-weight: 600; }
.out-stock { color: var(--error); font-weight: 600; }

.qty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Forms */
.form, .filters__form { display: grid; gap: 1rem; }

.form-row { display: grid; gap: 0.35rem; }

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid--2 {
  grid-template-columns: 1fr 1fr;
}

.label-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

.input, .select, .textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: white;
}

.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
}

.input--sm { width: 70px; text-align: center; }

.inline-form { display: inline; }

.alert {
  list-style: none;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin: 0 0 1rem;
}

.alert--error { background: #fef2f2; color: #b91c1c; }
.alert--success { background: #ecfdf5; color: #047857; }

.form-message { min-height: 1.25rem; font-size: 0.9rem; }
.form-message.success { color: var(--success); }
.form-message.error { color: var(--error); }

.hint { color: var(--muted); font-size: 0.95rem; }

/* Auth */
.auth-section { padding: 3rem 0; }
.auth-card { max-width: 480px; margin: 0 auto; }
.auth-switch { text-align: center; margin-top: 1rem; color: var(--muted); }
.auth-switch a { color: var(--primary); font-weight: 600; }

/* Filters */
.filters { margin-bottom: 2rem; }

.filters__form {
  grid-template-columns: 2fr 1fr 1fr;
  align-items: end;
}

.products-results {
  transition: opacity 0.2s ease;
}

.products-results.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

/* Cart */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0 1.5rem;
  font-size: 1.1rem;
}

/* Reviews */
.review-form { margin: 1.5rem 0; }

.star-input { display: flex; gap: 0.25rem; }

.star-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #cbd5e1;
  cursor: pointer;
}

.star-btn.active { color: #fbbf24; }

.reviews-list { display: grid; gap: 1rem; margin-top: 1.5rem; }

.review-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.review-item time { color: var(--muted); font-size: 0.85rem; }

.review-comments {
  margin: 1rem 0 0 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.review-comment {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.comment-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Checkout & Map */
.checkout-page__head h1 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.checkout-page__head h1 svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.checkout-layout { max-width: 760px; }

.checkout-form__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.checkout-form__section-head h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.15rem;
}

.checkout-form__section-head h2 svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.checkout-form {
  display: grid;
  gap: 1rem;
}

.checkout-pay-btn {
  margin-top: 0.5rem;
  padding: 0.95rem 1.25rem;
  font-size: 1rem;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.checkout-item--total {
  font-size: 1.1rem;
  border-bottom: none;
  padding-top: 1rem;
}

.map {
  height: 320px;
  border-radius: var(--radius);
  margin: 1rem 0;
  border: 1px solid var(--border);
  z-index: 1;
}

.map--sm { height: 240px; }

/* Profile */
.profile-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.orders-list { list-style: none; padding: 0; margin: 0; }

.order-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

/* Result */
.result-card { text-align: center; padding: 3rem 2rem; }

.result-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.result-card--success .result-card__icon { background: #d1fae5; color: var(--success); }
.result-card--failure .result-card__icon { background: #fee2e2; color: var(--error); }
.result-card--pending .result-card__icon { background: #fef3c7; color: var(--warning); }

.result-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

/* Footer */
.footer {
  background: var(--text);
  color: #cbd5e1;
  padding: 2rem 0 1rem;
  margin-top: 2rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer__links { display: flex; gap: 1rem; }
.footer__links a:hover { color: white; }
.footer__copy {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 1.5rem;
  color: #94a3b8;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: white;
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero__showcase {
    min-height: 340px;
    order: -1;
  }

  .hero-product {
    width: min(200px, 38vw);
  }

  .hero-product--1 { top: 5%; left: 0; }
  .hero-product--2 { top: 22%; right: 0; }
  .hero-product--3 { bottom: 0; left: 12%; }

  .form-grid--2 {
    grid-template-columns: 1fr;
  }

  .pd-layout,
  .product-detail__grid,
  .cart-layout,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .filters__form {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "img info"
      "qty subtotal"
      "remove remove";
  }

  .cart-item img { grid-area: img; width: 64px; height: 64px; }
  .cart-item__info { grid-area: info; }
  .cart-item__qty { grid-area: qty; }
  .cart-item__subtotal { grid-area: subtotal; text-align: right; }
  .remove-item { grid-area: remove; justify-self: end; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    inset: 72px 0 auto 0;
    background: white;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s;
    box-shadow: var(--shadow);
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 12px;
  }

  .nav-btn-register,
  .inline-form .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Banner modo test checkout ─────────────────────────────────────────────── */
.checkout-test-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: #78350f;
  line-height: 1.6;
}
.checkout-test-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #d97706;
}
.checkout-test-banner a {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
}
.checkout-test-banner code {
  background: rgba(0,0,0,0.07);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  letter-spacing: 0.05em;
}
