/* ============================================================
   VantiShop — Estilos globales
   ============================================================ */

:root {
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --accent: #ec4899;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7f0;
  --success: #059669;
  --success-bg: #ecfdf5;
  --danger: #e11d48;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --ring: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Barra de anuncio ---------- */
.announce {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  padding: 0.45rem 1rem;
  letter-spacing: 0.01em;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: #eef0f8;
}

.nav-link.active {
  color: var(--primary-dark);
  background: #eef0ff;
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  background: var(--text);
  color: #fff;
  transition: background 0.15s;
}

.cart-link:hover {
  background: #1e293b;
}

.cart-link svg {
  width: 17px;
  height: 17px;
}

.badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero {
  padding: 5rem 0 4rem;
  background:
    linear-gradient(100deg, rgba(15, 23, 42, 0.88) 0%, rgba(15, 23, 42, 0.6) 50%, rgba(15, 23, 42, 0.25) 100%),
    url("../img/hero.jpg") center 22% / cover no-repeat;
  color: #fff;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  max-width: 22ch;
}

.hero h1 span {
  background: linear-gradient(90deg, #c4b5fd, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin-top: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 52ch;
  font-size: 1.05rem;
}

/* ---------- Barra de herramientas (buscador + filtros) ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0 1.4rem;
}

.search {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.search input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.search svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.88rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- Grid de productos ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.card:hover .card-media img {
  transform: scale(1.05);
}

.card-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.card-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.87rem;
  color: var(--muted);
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.price {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

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

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

.btn-outline {
  border-color: var(--border);
  background: var(--surface);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-ghost {
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Estado vacío ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 3.5rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 3rem;
}

.empty strong {
  display: block;
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.empty .btn {
  margin-top: 1rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  translate: -50% 200%;
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transition: translate 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  z-index: 100;
  max-width: calc(100vw - 2rem);
  text-align: center;
  pointer-events: none;
}

.toast.show {
  translate: -50% 0;
}

/* ---------- Encabezado de página ---------- */
.page-head {
  padding: 2.2rem 0 1.4rem;
}

.page-head h1 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

.page-head p {
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ---------- Página del carrito ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 3rem;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.cart-thumb {
  width: 74px;
  height: 74px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eef0f8;
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-info h3 {
  font-size: 0.98rem;
  font-weight: 700;
}

.unit-price {
  font-size: 0.84rem;
  color: var(--muted);
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.qty-btn:hover {
  background: #eef0ff;
  color: var(--primary-dark);
}

.qty-value {
  min-width: 2ch;
  text-align: center;
  font-weight: 600;
  font-size: 0.92rem;
}

.cart-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.line-total {
  font-size: 1.02rem;
  font-weight: 800;
}

.remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  transition: color 0.15s;
}

.remove-btn:hover {
  color: var(--danger);
}

.remove-btn svg {
  width: 14px;
  height: 14px;
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* ---------- Resumen del pedido ---------- */
.summary {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.summary h2 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.ship-progress {
  background: #f1f3fb;
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.95rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.ship-progress strong {
  color: var(--text);
}

.ship-progress .bar {
  height: 6px;
  background: #e2e5f2;
  border-radius: 999px;
  margin-top: 0.55rem;
  overflow: hidden;
}

.ship-progress .bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: inherit;
  transition: width 0.3s;
}

.ship-progress.done {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 600;
}

.ship-progress.done strong {
  color: var(--success);
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.95rem;
  color: var(--muted);
}

.summary-row strong {
  color: var(--text);
  font-weight: 600;
}

.summary-row.total {
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
  margin-top: 0.3rem;
  font-size: 1.05rem;
}

.summary-row.total strong {
  font-size: 1.25rem;
  font-weight: 800;
}

.free {
  color: var(--success);
  font-weight: 700;
}

/* ---------- Formulario de checkout ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
}

.form-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfbfe;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: #fff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.note {
  display: none;
  background: var(--success-bg);
  color: var(--success);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.note.show {
  display: block;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer a {
  font-weight: 600;
  color: var(--primary-dark);
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .summary {
    position: static;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 2.6rem 0 2rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    max-width: none;
  }

  .cart-item {
    grid-template-columns: 60px 1fr;
  }

  .cart-thumb {
    width: 60px;
    height: 60px;
    font-size: 1.05rem;
  }

  .cart-side {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border);
    padding-top: 0.7rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
