/* ==========================================================================
   DTI Barcelona · Carrito (carrito.php)
   Estructura del master Innuro (hero + tarjeta WooCommerce + tira de servicios)
   con el diseño de DTI Barcelona: negro, crema y amarillo.
   Base y cabecera en header.css · Rótulos y migas en componentes.css
   ========================================================================== */

/* ==========================================================================
   HERO
   ========================================================================== */
.cart-hero { position: relative; overflow: hidden; padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 6vw, 80px); background: radial-gradient(70% 90% at 85% 10%, #2a2210 0%, #151208 35%, var(--bg) 70%); border-bottom: 1px solid var(--line); }
.cart-hero::after { content: ""; position: absolute; right: -6vw; bottom: -14vw; width: 34vw; height: 34vw; border-radius: 50%; border: 1px solid rgba(255, 194, 0, .12); box-shadow: 0 0 0 4vw rgba(255, 194, 0, .03), 0 0 0 8vw rgba(255, 194, 0, .02); pointer-events: none; }
.cart-hero .wrap { position: relative; z-index: 1; }
.cart-hero__title { font-size: clamp(52px, 7.4vw, 108px); }
.cart-hero p { color: var(--muted); max-width: 640px; margin: 22px 0 0; font-size: 18px; }
.cart-hero p strong { color: var(--cream); }
.cart-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.cart-badge-item { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line-2); color: var(--cream); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.cart-badge-item svg { width: 16px; height: 16px; fill: var(--yellow); flex: none; }

/* Enlaces de WooCommerce dentro de la tarjeta clara (la base pone los enlaces en amarillo) */
.cart-page-card a { color: inherit; }
.cart-page-card a:hover { color: var(--gold-ink); }

/* ==========================================================================
   Cuerpo Principal del Carrito (fondo crema de DTI Barcelona)
   ========================================================================== */
.cart-body {
  padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 7vw, 100px);
  background: var(--sand);
  color: var(--ink);
}

.cart-page-card {
  background: #ffffff;
  border: 0;
  border-radius: 26px;
  padding: clamp(24px, 3.4vw, 44px);
  box-shadow: 0 30px 70px rgba(60, 45, 20, .14);
  color: #1a202c;
}

/* ==========================================================================
   Layout en Grid (Productos a la izquierda + Totales a la derecha)
   ========================================================================== */
.woocommerce-cart .woocommerce,
.cart-page-card .woocommerce {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px !important;
  gap: 36px !important;
  align-items: start !important;
}

/* Notificaciones ocupan todo el ancho superior */
.woocommerce-cart .woocommerce .woocommerce-notices-wrapper,
.cart-page-card .woocommerce .woocommerce-notices-wrapper {
  grid-column: 1 / -1 !important;
  width: 100% !important;
}

/* Columna 1 (Izquierda): Formulario y tabla de productos del carrito */
.woocommerce-cart .woocommerce form.woocommerce-cart-form,
.cart-page-card .woocommerce form.woocommerce-cart-form {
  grid-column: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* Columna 2 (Derecha): Totales y finalizar compra */
.woocommerce-cart .woocommerce .cart-collaterals,
.cart-page-card .woocommerce .cart-collaterals {
  grid-column: 2 !important;
  width: 100% !important;
  min-width: 0 !important;
}

@media (max-width: 1100px) {
  .woocommerce-cart .woocommerce,
  .cart-page-card .woocommerce {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .woocommerce-cart .woocommerce form.woocommerce-cart-form,
  .cart-page-card .woocommerce form.woocommerce-cart-form,
  .woocommerce-cart .woocommerce .cart-collaterals,
  .cart-page-card .woocommerce .cart-collaterals {
    grid-column: 1 !important;
  }
}

/* ==========================================================================
   Tabla de Productos del Carrito (Escritorio y Tablet)
   ========================================================================== */
table.shop_table.cart {
  width: 100% !important;
  border-collapse: collapse !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  margin-bottom: 24px !important;
}

@media (min-width: 769px) {
  table.shop_table.cart {
    display: table !important;
    table-layout: auto !important;
  }
  table.shop_table.cart thead {
    display: table-header-group !important;
  }
  table.shop_table.cart thead th {
    display: table-cell !important;
    background: #f8fafc !important;
    color: #1a202c !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
    padding: 14px 16px !important;
    border-bottom: 2px solid #e2e8f0 !important;
  }
  table.shop_table.cart tbody {
    display: table-row-group !important;
  }
  table.shop_table.cart tbody tr {
    display: table-row !important;
  }
  table.shop_table.cart tbody td {
    display: table-cell !important;
    padding: 16px 14px !important;
    border-bottom: 1px solid #edf2f7 !important;
    color: #2d3748 !important;
    font-size: 14px !important;
    vertical-align: middle !important;
    text-align: left !important;
  }
  table.shop_table.cart tbody td::before {
    display: none !important;
    content: none !important;
  }
  table.shop_table.cart td.product-remove {
    width: 44px !important;
    text-align: center !important;
  }
  table.shop_table.cart td.product-thumbnail {
    width: 76px !important;
  }
  table.shop_table.cart td.product-name {
    min-width: 180px !important;
  }
  table.shop_table.cart td.product-price {
    width: 110px !important;
  }
  table.shop_table.cart td.product-quantity {
    width: 130px !important;
  }
  table.shop_table.cart td.product-subtotal {
    width: 110px !important;
    text-align: right !important;
  }
  table.shop_table.cart thead th.product-subtotal {
    text-align: right !important;
  }
  table.shop_table.cart td.actions {
    display: table-cell !important;
  }
}

/* Miniatura del Producto */
td.product-thumbnail img {
  width: 56px !important;
  height: 56px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  display: block !important;
}

/* Nombre del Producto */
td.product-name a {
  color: #1a202c !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  transition: color .15s ease !important;
}
td.product-name a:hover {
  color: var(--gold-ink) !important;
}

/* Precio unitario y Subtotal */
td.product-price {
  color: #4a5568 !important;
  font-weight: 600 !important;
}

td.product-subtotal {
  font-weight: 700 !important;
  color: #1a202c !important;
  font-size: 15px !important;
}

/* Selector de Cantidad */
.quantity input.qty {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1a202c !important;
  border-radius: 4px !important;
  padding: 8px !important;
  width: 60px !important;
  text-align: center !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  outline: none !important;
  transition: border-color .2s ease !important;
}
.quantity input.qty:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(255, 194, 0, 0.2) !important;
}

/* Botón Eliminar Artículo */
td.product-remove a.remove {
  display: grid !important;
  place-items: center !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  color: #e53e3e !important;
  font-size: 20px !important;
  text-decoration: none !important;
  background: #fee2e2 !important;
  transition: all .15s ease !important;
  line-height: 1 !important;
}
td.product-remove a.remove:hover {
  background: #e53e3e !important;
  color: #fff !important;
}

/* Barra de Acciones (Cupón y Actualizar Carrito) */
td.actions {
  background: #f8fafc !important;
  padding: 18px 16px !important;
  border-bottom: none !important;
}

td.actions .coupon {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  float: left !important;
  flex-wrap: wrap !important;
}

td.actions .coupon input#coupon_code {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  color: #1a202c !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  outline: none !important;
  min-width: 140px !important;
}
td.actions .coupon input#coupon_code:focus {
  border-color: var(--gold) !important;
}

td.actions .coupon button[name="apply_coupon"] {
  background: #2d3748 !important;
  border: none !important;
  color: #fff !important;
  border-radius: 4px !important;
  padding: 10px 16px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: all .2s ease !important;
}
td.actions .coupon button[name="apply_coupon"]:hover {
  background: var(--yellow-2) !important;
  color: var(--bg) !important;
}

td.actions button[name="update_cart"] {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  border-radius: 4px !important;
  padding: 10px 18px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  float: right !important;
  transition: all .2s ease !important;
}
td.actions button[name="update_cart"]:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* ==========================================================================
   Totales del Carrito (.cart_totals)
   ========================================================================== */
.cart-collaterals .cart_totals {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 24px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  position: sticky !important;
  top: 24px !important;
  float: none !important;
  width: 100% !important;
}

.cart_totals h2 {
  font-family: var(--display, "Anton", sans-serif) !important;
  font-size: 20px !important;
  letter-spacing: .03em !important;
  text-transform: uppercase !important;
  color: #1a202c !important;
  margin: 0 0 18px 0 !important;
  padding-bottom: 10px !important;
  border-bottom: 2px solid #edf2f7 !important;
}

.cart_totals table.shop_table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 20px !important;
  border: none !important;
}

.cart_totals table.shop_table th {
  text-align: left !important;
  color: #64748b !important;
  padding: 12px 0 !important;
  font-size: 13px !important;
  border-bottom: 1px solid #edf2f7 !important;
}

.cart_totals table.shop_table td {
  text-align: right !important;
  color: #1a202c !important;
  padding: 12px 0 !important;
  font-size: 13px !important;
  border-bottom: 1px solid #edf2f7 !important;
}

.cart_totals tr.order-total th,
.cart_totals tr.order-total td {
  border-top: 2px solid #e2e8f0 !important;
  border-bottom: none !important;
  padding: 16px 0 !important;
}

.cart_totals tr.order-total th {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #1a202c !important;
  text-transform: uppercase !important;
}

.cart_totals tr.order-total td strong .amount {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--gold-ink) !important;
}

/* Botón Ir a Checkout */
.wc-proceed-to-checkout a.checkout-button {
  background: var(--yellow) !important;
  color: var(--bg) !important;
  border: none !important;
  display: block !important;
  width: 100% !important;
  padding: 16px 20px !important;
  border-radius: 6px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(255, 194, 0, 0.3) !important;
  transition: filter .15s ease, transform .15s ease, box-shadow .15s ease !important;
  margin-top: 16px !important;
}

.wc-proceed-to-checkout a.checkout-button:hover {
  filter: brightness(1.08) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(255, 194, 0, 0.45) !important;
}

/* ==========================================================================
   Carrito Vacío (.cart-empty)
   ========================================================================== */
.cart-empty.woocommerce-info {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 32px 20px !important;
  text-align: center !important;
  font-size: 16px !important;
  color: #2d3748 !important;
  margin-bottom: 24px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

p.return-to-shop {
  text-align: center !important;
  margin-top: 20px !important;
}

p.return-to-shop a.button.wc-backward,
.cart-fallback-notice a.btn {
  background: var(--yellow) !important;
  color: var(--bg) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  padding: 12px 26px !important;
  border-radius: 4px !important;
  display: inline-block !important;
  transition: background .2s ease !important;
}

p.return-to-shop a.button.wc-backward:hover {
  background: var(--yellow-2) !important;
  color: var(--bg) !important;
}

/* ==========================================================================
   Notificaciones y Mensajes de WooCommerce (Alineación perfecta de iconos)
   ========================================================================== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  position: relative !important;
  border-radius: 8px !important;
  padding: 14px 22px 14px 54px !important;
  margin: 0 0 24px 0 !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  list-style: none outside !important;
  word-wrap: break-word !important;
  box-sizing: border-box !important;
  width: 100% !important;
  clear: both !important;
  display: block !important;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
  position: absolute !important;
  top: 14px !important;
  left: 18px !important;
  font-family: WooCommerce, sans-serif !important;
  font-size: 20px !important;
  line-height: 1 !important;
  display: inline-block !important;
}

.woocommerce-message {
  background: rgba(255, 194, 0, 0.08) !important;
  border: 1px solid rgba(255, 194, 0, 0.3) !important;
  border-left: 4px solid var(--gold) !important;
  color: #1a202c !important;
}

.woocommerce-message::before {
  content: "\e015" !important;
  color: var(--gold-ink) !important;
}

.woocommerce-info {
  background: #f0fdf4 !important;
  border: 1px solid #86efac !important;
  border-left: 4px solid #16a34a !important;
  color: #166534 !important;
}

.woocommerce-info::before {
  content: "\e028" !important;
  color: #16a34a !important;
}

.woocommerce-error {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  border-left: 4px solid #dc2626 !important;
  color: #991b1b !important;
}

.woocommerce-error::before {
  content: "\e016" !important;
  color: #dc2626 !important;
}

.woocommerce-error li,
.woocommerce-info li,
.woocommerce-message li {
  list-style: none outside !important;
  padding-left: 0 !important;
  margin: 0 0 6px 0 !important;
}

.woocommerce-error li:last-child,
.woocommerce-info li:last-child,
.woocommerce-message li:last-child {
  margin-bottom: 0 !important;
}

.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
  color: var(--gold-ink) !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
}

.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
  float: right !important;
  margin: -3px 0 0 16px !important;
  padding: 8px 18px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .03em !important;
  background: var(--yellow) !important;
  color: var(--bg) !important;
  border: none !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  box-shadow: 0 2px 8px rgba(255, 194, 0, 0.25) !important;
  transition: all .2s ease !important;
}

.woocommerce-message .button:hover,
.woocommerce-info .button:hover,
.woocommerce-error .button:hover {
  background: var(--yellow-2) !important;
  color: var(--bg) !important;
  box-shadow: 0 4px 12px rgba(255, 194, 0, 0.4) !important;
  transform: translateY(-1px) !important;
}

.woocommerce-message::after,
.woocommerce-info::after,
.woocommerce-error::after {
  content: "" !important;
  display: table !important;
  clear: both !important;
}

@media (max-width: 640px) {
  .woocommerce-message .button,
  .woocommerce-info .button,
  .woocommerce-error .button {
    float: none !important;
    display: block !important;
    margin: 10px 0 0 0 !important;
    text-align: center !important;
  }
}

@media (max-width: 768px) {
  .cart-body {
    padding: 20px 0 50px 0;
  }
  .cart-page-card {
    padding: 20px 16px;
    border-radius: 10px;
  }
  table.shop_table.cart {
    border: none !important;
    background: transparent !important;
  }
  table.shop_table.cart thead {
    display: none !important;
  }
  table.shop_table.cart tbody tr.cart_item {
    display: block !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    margin-bottom: 16px !important;
    padding: 16px !important;
    position: relative !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  }
  table.shop_table.cart tbody tr.cart_item td {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: right !important;
  }
  table.shop_table.cart tbody tr.cart_item td:last-child {
    border-bottom: none !important;
  }
  table.shop_table.cart tbody tr.cart_item td::before {
    content: attr(data-title) !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: .02em !important;
    text-align: left !important;
  }
  table.shop_table.cart tbody tr.cart_item td.product-remove {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    padding: 0 !important;
    border-bottom: none !important;
  }
  table.shop_table.cart tbody tr.cart_item td.product-remove::before {
    display: none !important;
  }
  table.shop_table.cart tbody tr.cart_item td.product-thumbnail {
    justify-content: center !important;
    padding-bottom: 12px !important;
  }
  table.shop_table.cart tbody tr.cart_item td.product-thumbnail::before {
    display: none !important;
  }
  table.shop_table.cart tbody tr.cart_item td.product-thumbnail img {
    width: 70px !important;
    height: 70px !important;
  }
  table.shop_table.cart tbody tr td.actions {
    display: block !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-top: 16px !important;
  }
  table.shop_table.cart tbody tr td.actions::before {
    display: none !important;
  }
  td.actions .coupon {
    float: none !important;
    margin-bottom: 12px !important;
    width: 100% !important;
  }
  td.actions .coupon input#coupon_code {
    width: 100% !important;
  }
  td.actions .coupon button[name="apply_coupon"] {
    width: 100% !important;
  }
  td.actions button[name="update_cart"] {
    float: none !important;
    width: 100% !important;
  }
}

/* Sizing protection for SVGs and Tailwind icon utility classes */
svg.w-3\.5, .w-3\.5 { width: 14px !important; height: 14px !important; max-width: 14px !important; max-height: 14px !important; }
svg.w-4, .w-4 { width: 16px !important; height: 16px !important; max-width: 16px !important; max-height: 16px !important; }
svg.w-5, .w-5 { width: 20px !important; height: 20px !important; max-width: 20px !important; max-height: 20px !important; }
svg.w-6, .w-6 { width: 24px !important; height: 24px !important; max-width: 24px !important; max-height: 24px !important; }
svg.h-3\.5, .h-3\.5 { height: 14px !important; max-height: 14px !important; }
svg.h-4, .h-4 { height: 16px !important; max-height: 16px !important; }
svg.h-5, .h-5 { height: 20px !important; max-height: 20px !important; }
svg.h-6, .h-6 { height: 24px !important; max-height: 24px !important; }
.mr-2 { margin-right: 8px !important; }
.mr-3 { margin-right: 12px !important; }
.mr-4 { margin-right: 16px !important; }
.flex-shrink-0, .shrink-0 { flex-shrink: 0 !important; }

.cart-hero-badge svg,
.checkout-badge svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex: 0 0 16px !important;
}

.cart-card svg:not(.cart),
.checkout-card svg:not(.cart),
.woocommerce svg:not(.cart) {
  max-width: 24px !important;
  max-height: 24px !important;
}

/* ==========================================================================
   TIRA DE SERVICIOS DE CONFIANZA (amarilla, antes del pie)
   ========================================================================== */
.service { background: var(--yellow); color: var(--bg); }
.service .wrap { display: grid; grid-template-columns: auto auto repeat(4, minmax(0, 1fr)); align-items: center; padding-block: 20px; }
.service .cell { display: flex; align-items: center; gap: 12px; padding: 6px 18px; border-left: 1.5px solid rgba(14, 14, 14, .22); min-width: 0; color: var(--bg); font: 700 14px/1.2 var(--body); letter-spacing: .04em; text-transform: uppercase; }
.service .cell:first-child { border: 0; padding-left: 0; white-space: nowrap; font: 400 clamp(20px, 2vw, 26px)/1.05 var(--display); letter-spacing: .01em; }
.service a.cell { transition: opacity .2s ease; }
.service a.cell:hover { color: var(--bg); opacity: .7; }
.service .cell svg { flex: none; width: 40px; height: 40px; fill: none; stroke: var(--bg); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.service .cell:first-child svg { width: 64px; height: 44px; }
.service .pill { background: var(--bg); border-radius: 999px; padding: 12px 24px; margin-inline: 18px; }
.service .pill img { display: block; width: 140px; height: auto; }

@media (max-width: 1260px) {
  .service .wrap { grid-template-columns: 1fr 1fr; gap: 14px 0; }
  .service .cell:first-child { grid-column: 1 / -1; }
  .service .pill { display: none; }
  .service .cell:nth-child(3), .service .cell:nth-child(5) { border-left: 0; padding-left: 0; }
}
@media (max-width: 560px) {
  .service .wrap { grid-template-columns: 1fr; }
  .service .cell { border-left: 0; padding: 6px 0; }
  .service .cell svg { width: 32px; height: 32px; }
}
