/* =======================
   VARIABLES
======================= */
:root {
  --primary: #021d33;
  --primary-mid: #032c4a;
  --accent: #38bdf8;
  --accent2: #2563eb;
  --bg: #f0f4f8;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* =======================
   HEADER
======================= */
header {
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
  padding: 0 40px;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(56,189,248,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

header img { height: 42px; object-fit: contain; }

header nav { display: flex; gap: 28px; }

header a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  position: relative;
  transition: color 0.25s;
}

header a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.25s;
}

header a:hover { color: var(--accent); }
header a:hover::after { width: 100%; }

/* =======================
   TÍTULO
======================= */
.page-title {
  text-align: center;
  margin: 44px 0 8px;
  letter-spacing: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.page-title + h1 {
  text-align: center;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 32px;
}

h1 {
  text-align: center;
  margin: 44px 0 32px;
  letter-spacing: 4px;
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
}

/* =======================
   LAYOUT
======================= */
.carrito-container {
  max-width: 980px;
  margin: 0 auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

/* =======================
   LISTA DE ITEMS
======================= */
.items-panel {
  background: var(--card);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
  border: 1px solid var(--border);
}

.items-panel-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* =======================
   ITEM
======================= */
.item {
  display: flex;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
  transition: all 0.28s ease;
  align-items: center;
  overflow: visible;
}

.item:last-child { margin-bottom: 0; }

.item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  border-color: rgba(56,189,248,0.3);
  background: white;
}

.item img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  background: white;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.item-info { flex: 1; }

.item-info h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.item-info p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.precio {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
}

.btn-eliminar {
  background: rgba(239,68,68,0.08);
  color: var(--danger);
  border: 1.5px solid rgba(239,68,68,0.35);
  min-width: 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 0;
  line-height: 1;
}

.btn-eliminar:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(239,68,68,0.35);
}

/* =======================
   PANEL RESUMEN
======================= */
.resumen-panel {
  background: var(--primary);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(2,29,51,0.25);
  position: sticky;
  top: 90px;
  overflow: hidden;
}

/* decoración */
.resumen-panel::before {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(56,189,248,0.07);
  pointer-events: none;
}

.resumen-panel::after {
  content: "";
  position: absolute;
  bottom: -40px; left: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(56,189,248,0.04);
  pointer-events: none;
}

.resumen-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.resumen-linea {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  position: relative;
  z-index: 1;
}

.resumen-linea span:last-child { font-weight: 600; color: rgba(255,255,255,0.85); }

.resumen-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 18px 0;
  position: relative;
  z-index: 1;
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.total-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}

.total-precio {
  font-size: 28px;
  font-weight: 900;
  color: white;
}

/* Botones resumen */
.btn-pagar {
  display: block;
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.28s ease;
  position: relative;
  z-index: 1;
}

.btn-pagar:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(56,189,248,0.45);
}

.btn-seguir {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}

.btn-seguir:hover {
  background: rgba(255,255,255,0.13);
  color: white;
}

/* =======================
   CARRITO VACÍO
======================= */
.carrito-vacio {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.carrito-vacio i {
  font-size: 52px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.25;
}

.carrito-vacio p {
  font-size: 16px;
  margin-bottom: 24px;
}

/* =======================
   RESPONSIVE
======================= */
@media (max-width: 768px) {
  header { padding: 0 16px; }

  .carrito-container {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  .resumen-panel {
    position: static;
  }

  h1 {
    font-size: 22px;
    letter-spacing: 3px;
    margin: 28px 0 20px;
  }

  .item img {
    width: 80px;
    height: 64px;
  }
}

@media (max-width: 480px) {
  header { flex-direction: column; height: auto; padding: 14px 16px; gap: 10px; }
  header nav { gap: 20px; }
  .item { flex-wrap: wrap; }
  .btn-eliminar { width: 100%; height: 38px; border-radius: 8px; }
}