/* ------------------------------
   CARRITO CAPO — ALINEADO AL INDEX
   (mismo look & feel: fondo claro radial, cards blancas, sombras soft)
------------------------------ */

/* ------------------------------
   VARIABLES / THEME (igual que index)
------------------------------ */

:root {
  --capo-purple: #9a6bff;
  --capo-purple-dark: #6b3fd6;
  --capo-pink: #ff6ecd;
  --capo-blue: #6ec8ff;
  --capo-blue-dark: #427ee0;
  --capo-bg-gradient: linear-gradient(135deg, #6ec8ff, #9a6bff, #ff6ecd);
  --capo-white: #ffffff;
  --capo-dark: #1b1233;
  --capo-card-bg: rgba(255, 255, 255, 0.9);
  --capo-shadow-soft: 0 18px 40px rgba(23, 10, 52, 0.18);
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 0.2s ease-out;
  --transition-med: 0.35s ease-out;
}

/* ------------------------------
   PAGE
------------------------------ */

.cart-page {
  /* mismo feeling que body.capo-theme */
  background: radial-gradient(
    circle at top,
    #f4e9ff 0,
    #f9f6ff 35%,
    #fdfbff 70%,
    #ffffff 100%
  );
  min-height: 100vh;
  padding: 3rem 0;
  color: var(--capo-dark);
}

/* Por si tu layout usa container del index */
.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ------------------------------
   HEADER
------------------------------ */

.cart__header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.cart__title {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: clamp(2rem, 2.4vw + 1rem, 2.6rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--capo-dark);
}

.cart__subtitle {
  max-width: 560px;
  margin: 0 auto;
  color: #4e446d;
  font-size: 0.98rem;
}

/* ------------------------------
   LAYOUT
------------------------------ */

.cart__layout {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .cart__layout {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------
   EMPTY
------------------------------ */

.hidden {
  display: none !important;
}

.cart-empty {
  background: var(--capo-card-bg);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  text-align: center;
  box-shadow: var(--capo-shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.75);
  position: relative;
  overflow: hidden;
}

.cart-empty::before {
  content: "";
  position: absolute;
  inset: -30%;
  background-image: radial-gradient(
      circle at top left,
      rgba(158, 108, 255, 0.13) 0,
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(255, 110, 205, 0.14) 0,
      transparent 55%
    );
  opacity: 0.9;
  pointer-events: none;
}

.cart-empty h2 {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 1;
}

.cart-empty p {
  color: #5b4c88;
  position: relative;
  z-index: 1;
}

.cart-empty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  color: var(--capo-white);
  background-image: var(--capo-bg-gradient);
  box-shadow: 0 10px 18px rgba(43, 12, 86, 0.15);
  position: relative;
  z-index: 1;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cart-empty__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(45, 17, 107, 0.32);
}

/* ------------------------------
   LIST
------------------------------ */

.cart-list {
  display: grid;
  gap: 1.4rem; /* más aire entre cards */
}

/* ------------------------------
   ITEM CARD (look igual a product-card del index)
------------------------------ */

.cart-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1.4rem; /* ✅ separación imagen/texto */
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius-lg);
  background: var(--capo-card-bg);
  box-shadow: 0 14px 26px rgba(34, 12, 74, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.65);
  align-items: center;
  transition: transform var(--transition-med), box-shadow var(--transition-med);
  position: relative;
  overflow: hidden;
}

.cart-item::before {
  content: "";
  position: absolute;
  inset: -30%;
  background-image: radial-gradient(
      circle at top left,
      rgba(158, 108, 255, 0.10) 0,
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(255, 110, 205, 0.11) 0,
      transparent 55%
    );
  opacity: 0.9;
  pointer-events: none;
}

.cart-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 52px rgba(34, 12, 74, 0.35);
}

.cart-item__img {
  width: 120px;
  height: 92px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(154, 107, 255, 0.18);
  position: relative;
  z-index: 1;
}

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

/* Info */
.cart-item__info {
  position: relative;
  z-index: 1;
}

.cart-item__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--capo-dark);
}

.cart-item__meta {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.cart-item__unit {
  font-weight: 700;
  color: var(--capo-purple-dark);
}

.cart-item__sub {
  font-weight: 800;
  color: #2a1c52;
}

/* Actions */
.cart-item__actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ------------------------------
   QTY CONTROL (paleta Capo, estilo index)
------------------------------ */

.qty-control {
  keep: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(154, 107, 255, 0.12);
  border: 1px solid rgba(154, 107, 255, 0.28);
  border-radius: 999px;
  padding: 0.25rem 0.45rem;
}

.qty-btn {
  background: var(--capo-bg-gradient);
  border: none;
  color: var(--capo-white);
  font-size: 1.05rem;
  font-weight: 800;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 10px 18px rgba(43, 12, 86, 0.14);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    opacity var(--transition-fast);
}

.qty-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(45, 17, 107, 0.25);
}

.qty-value {
  min-width: 30px;
  text-align: center;
  color: var(--capo-dark);
  font-weight: 800;
}

/* Eliminar (rosa Capo) */
.remove-btn {
  background: rgba(255, 110, 205, 0.12);
  color: #a12e78;
  border: 1px solid rgba(255, 110, 205, 0.35);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast),
    box-shadow var(--transition-fast);
  box-shadow: 0 10px 18px rgba(88, 46, 135, 0.12);
}

.remove-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 110, 205, 0.18);
  box-shadow: 0 18px 32px rgba(88, 46, 135, 0.18);
}

/* ------------------------------
   SUMMARY (card blanca igual)
------------------------------ */

.summary-card {
  position: sticky;
  top: 110px;
  background: var(--capo-card-bg);
  border-radius: var(--radius-xl);
  padding: 1.4rem;
  box-shadow: var(--capo-shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background-image: radial-gradient(
      circle at top left,
      rgba(158, 108, 255, 0.12) 0,
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(255, 110, 205, 0.12) 0,
      transparent 55%
    );
  opacity: 0.9;
  pointer-events: none;
}

.summary-card__title {
  position: relative;
  z-index: 1;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--capo-dark);
}

.summary-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.65rem 0;
  color: #4e446d;
  font-weight: 500;
}

.summary-row strong {
  color: var(--capo-dark);
}

.summary-divider {
  position: relative;
  z-index: 1;
  height: 1px;
  background: rgba(154, 107, 255, 0.16);
  margin: 1rem 0;
}

.summary-note {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  color: #5b4c88;
  margin-bottom: 1rem;
}

/* Botones resumen (igual lógica btn del index) */
.summary-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.75rem;
  background-image: var(--capo-bg-gradient);
  color: var(--capo-white);
  box-shadow: 0 10px 18px rgba(43, 12, 86, 0.15);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    opacity var(--transition-fast);
}

.summary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(45, 17, 107, 0.32);
}

.summary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.summary-btn--ghost {
  background: #ffffff;
  color: var(--capo-purple-dark);
  border: 1px solid rgba(154, 107, 255, 0.32);
}

.summary-btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

/* ------------------------------
   MOBILE TUNING (evitar amontonado)
------------------------------ */

@media (max-width: 650px) {
  .cart-item {
    grid-template-columns: 96px 1fr;
    grid-template-rows: auto auto;
    padding: 1.15rem;
    row-gap: 0.85rem; /* ✅ aire entre filas */
  }

  .cart-item__img {
    width: 96px;
    height: 82px;
  }

  /* Acciones abajo, separadas */
  .cart-item__actions {
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 0.9rem;
    padding-top: 0.3rem;
  }

  /* Un poco más de aire entre imagen y texto */
  .cart-item__info {
    padding-top: 0.1rem;
  }
}

@media (max-width: 420px) {
  .container {
    width: min(1120px, 100% - 1.5rem);
  }

  .cart__title {
    font-size: 2rem;
  }

  .cart-item {
    gap: 1.05rem;
  }
}

/* =========================
   LIGHTBOX (FULLSCREEN IMG)
========================= */

.lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.lb--hidden {
  display: none;
}

.lb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 3, 36, 0.75);
  backdrop-filter: blur(8px);
}

.lb__panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.25rem;
}

.lb__img {
  max-width: min(1100px, 96vw);
  max-height: 86vh;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(5, 0, 24, 0.55);
  background: #ffffff;
}

.lb__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  background: rgba(16, 6, 41, 0.78);
  box-shadow: 0 10px 26px rgba(5, 0, 24, 0.55);
}

/* Evita scroll cuando el lightbox está abierto */
html.lb--open,
body.lb--open {
  overflow: hidden;
}

.product-card__desc {
  font-size: 0.86rem;
  color: #6a5b96;
  margin-bottom: 0.8rem;
  line-height: 1.25;
}
