:root {
  --primary: #111;
  --accent: #3fd2e0;
  /* Match footer accent */
  --bg-site: #f8f8f8;
  --card-bg: rgba(255, 255, 255, 0.8);
  --text-main: #222;
  --text-muted: #666;
  --border: rgba(0, 0, 0, 0.05);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.main-carrito {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
}

.titulo-carrito {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 3rem;
  text-align: center;
}

/* Standardized Premium Button */
.btn-premium {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  background: #222;
}

.btn-premium.secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid #ddd;
  box-shadow: none;
}

.btn-premium.secondary:hover {
  background: #f5f5f5;
  border-color: #ccc;
  transform: none;
}

/* Glassmorphism Item Card */
.carrito-item {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.carrito-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
}

.carrito-item-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.carrito-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  background: #fff;
  flex-shrink: 0;
}

.carrito-info-detalles {
  flex: 1;
}

.carrito-producto-nombre {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 0.4rem 0;
}

.carrito-variantes {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.carrito-comentario {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.4rem;
  font-style: italic;
}

/* Controls Section */
.carrito-item-controles {
  display: contents;
  /* Allows children to participate in the grid */
}

.carrito-precio-unitario {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.carrito-cantidad-control {
  display: flex;
  align-items: center;
  background: #f3f3f3;
  border-radius: 10px;
  padding: 3px;
}

.btn-cantidad {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
  color: var(--text-main);
}

.btn-cantidad:hover {
  background: rgba(0, 0, 0, 0.05);
}

.input-cantidad {
  width: 35px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
}

/* Chrome, Safari, Edge, Opera */
.input-cantidad::-webkit-outer-spin-button,
.input-cantidad::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* Firefox */
.input-cantidad[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.carrito-item-subtotal {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 140px;
  border-left: 1px solid #eee;
  padding-left: 2rem;
}

.label-subtotal {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aaa;
  margin-bottom: 2px;
}

.valor-subtotal {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
}

.carrito-eliminar-btn {
  background: transparent;
  border: none;
  color: #ff4d4d;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carrito-eliminar-btn:hover {
  background: rgba(255, 77, 77, 0.08);
  transform: scale(1.15);
}

.carrito-eliminar-btn svg {
  width: 18px;
  height: 18px;
}

/* Shipping Selector */
.selector-envio {
  margin-top: 3rem;
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.selector-envio h3 {
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.selector-envio label {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.selector-envio input[type="radio"]:checked+span,
.selector-envio label:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: rgba(63, 210, 224, 0.05);
}

/* Summary Totals */
.carrito-totales {
  margin-top: 3rem;
  text-align: right;
  padding: 0 1rem;
}

#lineaEnvio {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.carrito-total-final {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
}

/* Actions */
.acciones-carrito {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
  .carrito-item {
    grid-template-columns: 1fr auto auto auto;
    gap: 1.5rem;
    padding: 1.2rem;
  }

  .carrito-item-subtotal {
    grid-column: span 4;
    border-left: none;
    border-top: 1px solid #f5f5f5;
    padding-left: 0;
    padding-top: 1rem;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .main-carrito {
    padding: 2.5rem 1rem;
  }

  .titulo-carrito {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .carrito-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .carrito-item-info {
    width: 100%;
  }

  .carrito-img {
    width: 75px;
    height: 75px;
  }

  .carrito-precio-unitario {
    display: block;
    font-size: 0.85rem;
  }

  .carrito-item-subtotal {
    order: 3;
  }

  .carrito-eliminar-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
}