/* -------------------------
   FUENTES
------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Monoton&display=swap');

@font-face {
  font-family: 'EurostileExtended';
  src: url('../../fonts/EurostileExtended-Black.woff2') format('woff2'),
       url('../../fonts/EurostileExtended-Black.woff') format('woff');
  font-weight: bold;
  font-style: normal;
}

/* -------------------------
   RESET
------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Poppins', sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* -------------------------
   LAYOUT
------------------------- */
main {
  flex: 1;
  max-width: 1100px;
  margin: 50px auto 70px;
  padding: 0 20px;
}

/* -------------------------
   TITULOS
------------------------- */
.title_compras {
  text-align: center;
  margin-bottom: 45px;
  font-size: 30px;
  font-weight: 600;
  color: #222;
}

.total_pagar {
  margin-top: 50px;
  font-size: 24px;
  font-weight: 600;
  text-align: right;
  border-top: 1px solid #eee;
  padding-top: 20px;
  color: #222;
}

/* -------------------------
   TABLA
------------------------- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
}

thead {
  background-color: #82b7df;
  color: #fff;
}

th {
  padding: 18px;
  font-size: 14px;
  text-transform: uppercase;
}

tbody tr {
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}

tbody tr:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

td {
  padding: 18px;
  border: none;
  font-size: 15px;
}

td:first-child {
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 500;
}

td img {
  width: 75px;
  border-radius: 8px;
}

/* -------------------------
   BOTONES
------------------------- */
button[type="submit"] {
  background-color: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.2s ease;
  cursor: pointer;
}

button[type="submit"]:hover {
  background-color: #e74c3c;
  color: #fff;
}

.btn__checkout {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 30px 0 0 auto;
  background-color: #2ecc71;
  color: #fff;
  padding: 16px;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn__checkout:hover {
  background-color: #27ae60;
  transform: translateY(-2px);
}

/* -------------------------
   CONTROL CANTIDAD
------------------------- */
.cantidad-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.input-cantidad {
  width: 55px;
  text-align: center;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-weight: 500;
}

.btn-sumar,
.btn-restar {
  width: 28px;
  height: 28px;
  border: none;
  background: #82b7df;
  color: white;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-sumar:hover,
.btn-restar:hover {
  background: #5da2d3;
}

/* ===============================
   LAYOUT E-COMMERCE PROFESIONAL
================================= */

.carrito-layout {
  max-width: 1200px;
  margin: 50px auto 80px;
  padding: 0 20px;
}

.carrito-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 50px;
  align-items: flex-start;
}

/* ===============================
   PRODUCTOS IZQUIERDA
================================= */

.carrito-productos {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.producto-card {
  display: flex;
  gap: 25px;
  background: #fff;
  padding: 25px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
  transition: 0.25s ease;
}

.producto-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.producto-img img {
  width: 130px;
  border-radius: 10px;
}

.producto-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.producto-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}

.talle {
  font-size: 14px;
  color: #777;
  margin-bottom: 12px;
}

/* PRECIOS */

.precio {
  margin-bottom: 15px;
}

.precio-original {
  text-decoration: line-through;
  color: #999;
  font-size: 14px;
  margin-right: 10px;
}

.precio-final {
  font-size: 20px;
  font-weight: 600;
  color: #2ecc71;
}

/* ===============================
   CONTROL CANTIDAD MODERNO
================================= */

.cantidad-control {
  display: flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.input-cantidad {
  width: 60px;
  text-align: center;
  border: none;
  padding: 8px;
  font-weight: 500;
}

.input-cantidad:focus {
  outline: none;
}

.btn-sumar,
.btn-restar {
  width: 35px;
  height: 35px;
  border: none;
  background: #f4f4f4;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-sumar:hover,
.btn-restar:hover {
  background: #e0e0e0;
}

/* BOTÓN ELIMINAR MÁS LIMPIO */

.btn-eliminar {
  margin-top: 10px;
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-eliminar:hover {
  text-decoration: underline;
}

/* ===============================
   RESUMEN DERECHO STICKY
================================= */

.carrito-resumen {
  background: #fff;
  padding: 35px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  position: sticky;
  top: 120px;
}

.carrito-resumen h3 {
  margin-bottom: 25px;
  font-size: 20px;
  font-weight: 600;
}

.resumen-linea {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 15px;
  color: #555;
}

.resumen-total {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  font-size: 20px;
  font-weight: 600;
  color: #222;
}

/* BOTÓN CHECKOUT MÁS PRO */

.btn-checkout,
.carrito-resumen .btn__checkout {
  display: block;
  width: 100%;
  margin-top: 30px;
  padding: 16px;
  background: #111;
  color: #fff;
  text-align: center;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: 0.3s ease;
}

.btn-checkout:hover,
.carrito-resumen .btn__checkout:hover {
  background: #333;
  transform: translateY(-2px);
}

/* ===============================
   RESPONSIVE REAL
================================= */

@media (max-width: 992px) {

  .carrito-container {
    grid-template-columns: 1fr;
  }

  .carrito-resumen {
    position: relative;
    top: 0;
  }

  .producto-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .producto-img img {
    width: 110px;
  }

  .cantidad-control {
    margin: 0 auto;
  }
}

/* ===============================
   DESACTIVAMOS TABLA VIEJA
================================= */

table,
thead,
tbody,
th,
td,
tr {
  display: none !important;
}

/* =========================================
   CARRITO - MEJORAS FINALES
========================================= */

.envio-gratis-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: #f6f6f6;
  color: #444;
  font-size: 0.9rem;
  line-height: 1.4;
}

.envio-gratis-box strong {
  color: #111;
}

.producto-img {
  width: 130px;
  height: 160px;
  background: #f3f3f3;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.producto-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.producto-card {
  align-items: stretch;
}

.btn-eliminar {
  width: fit-content;
  padding: 0;
}

.carrito-resumen .resumen-linea.envio {
  color: #666;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .producto-card {
    padding: 18px;
  }

  .producto-img {
    width: 100%;
    height: 300px;
  }

  .producto-info {
    width: 100%;
  }
}