/* =========================================================
   GLASSIP CART - CSS FINAL OPTIMIZADO
   ========================================================= */

/* Reset específico para la página del carrito */
.page-template-page-cart {
  background: #000 !important;
}

.page-template-page-cart .site-content {
  padding: 0 !important;
  margin: 0 !important;
}

/* Contenedor principal */
.glassip-cart-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
}

/* Header del carrito */
.glassip-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem 1rem 1.3rem 1rem;
  border-bottom: 2px solid #c5e82e;
}

.glassip-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.glassip-header-icon {
  width: 40px;
  height: 40px;
}

.glassip-header-icon img {
  width: 100%;
  height: auto;
}

.glassip-cart-title {
  font-family: "Days One", sans-serif;
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: #c5e82e;
  text-transform: uppercase;
}

.cart-items-count {
  background: #c5e82e;
  color: #000;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Layout principal */
.glassip-cart-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

/* Sección de productos */
.glassip-cart-items {
  background: #0f141d;
  border: 2px solid #c5e82e;
  border-radius: 12px;
  padding: 1.2rem;
}

.cart-section-title,
.glassip-cart-items h2 {
  font-family: "Days One", sans-serif;
  color: #c5e82e;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  text-align: center;
}

/* Producto individual */
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #2a2f3a;
  position: relative;
}

.cart-item:last-child {
  border-bottom: none;
}

/* Imagen del producto */
.item-image {
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #c5e82e;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Detalles del producto */
.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.item-name {
  font-family: "Days One", sans-serif;
  color: #c5e82e;
  font-size: clamp(1rem, 2vw, 1.1rem);
  margin: 0;
  line-height: 1.2;
}

.item-variations {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.variation {
  color: #d1d1d1;
  font-size: 0.8rem;
}

.item-price {
  color: #c5e82e;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 0.2rem;
}

/* Controles de cantidad y total */
.item-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  min-width: 120px;
}

/* Controles de cantidad */
.quantity-controls {
  display: flex;
  align-items: center;
  background: #1b2029;
  border: 2px solid #c5e82e;
  border-radius: 6px;
  overflow: hidden;
  height: 36px;
}

.qty-btn {
  background: #c5e82e;
  color: #000;
  border: none;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.qty-btn:hover {
  background: #fff;
  transform: scale(1.05);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-input {
  background: transparent;
  border: none;
  color: #c5e82e;
  text-align: center;
  width: 48px;
  height: 36px;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  padding: 0;
}

.qty-input:focus {
  outline: none;
  background: rgba(197, 232, 46, 0.1);
}

/* Total del producto y botón eliminar */
.item-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.total-price {
  color: #c5e82e;
  font-weight: bold;
  font-size: 1.1rem;
  text-align: center;
}

.remove-item {
  background: rgba(255, 68, 68, 0.1);
  color: #ff4444;
  border: 1px solid #ff4444;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-item:hover {
  background: #ff4444;
  color: #fff;
  transform: scale(1.1);
}

/* Sección de cupón */
.coupon-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #2a2f3a;
}

.toggle-coupon {
  background: transparent;
  color: #c5e82e;
  border: 2px solid #c5e82e;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  width: 100%;
  margin-bottom: 1rem;
  font-family: "Days One", sans-serif;
  text-transform: uppercase;
}

.toggle-coupon:hover {
  background: #c5e82e;
  color: #000;
}

.coupon-form {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

.coupon-input {
  flex: 1;
  background: #1b2029;
  border: 2px solid #c5e82e;
  border-radius: 6px;
  padding: 0.8rem;
  color: #c5e82e;
  font-family: inherit;
  font-size: 0.9rem;
}

.coupon-input:focus {
  outline: none;
  border-color: #fff;
}

.apply-coupon {
  background: #c5e82e;
  color: #000;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.apply-coupon:hover {
  background: #fff;
  transform: translateY(-1px);
}

/* Resumen del carrito */
.glassip-cart-summary {
  background: #0f141d;
  border: 2px solid #c5e82e;
  border-radius: 12px;
  padding: 1.2rem;
  height: fit-content;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.glassip-cart-summary h2 {
  font-family: "Days One", sans-serif;
  color: #c5e82e;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  text-align: center;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  color: #d1d1d1;
  font-size: 0.9rem;
}

.summary-line .amount {
  color: #c5e82e;
  font-weight: 600;
  font-size: 0.9rem;
}

.summary-divider {
  height: 2px;
  background: #c5e82e;
  margin: 1.2rem 0;
  border-radius: 1px;
}

.total-line {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.total-line span {
  color: #c5e82e;
}

.total-amount {
  font-size: 1.3rem;
}

/* Botones de checkout */
.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.checkout-btn {
  background: linear-gradient(135deg, #63bbe8 0%, #c5e82e 100%);
  color: #000;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-family: "Days One", sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 600;
}

.checkout-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(197, 232, 46, 0.3);
}

.continue-shopping {
  background: transparent;
  color: #c5e82e;
  border: 2px solid #c5e82e;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.continue-shopping:hover {
  background: #c5e82e;
  color: #000;
  transform: translateY(-1px);
}

/* =========================================================
   TABLA DE RESUMEN DE PEDIDO - SOLUCIÓN DEFINITIVA
   ========================================================= */

/* Wrapper para la tabla */
.order-review-wrapper {
  width: 100% !important;
  overflow: hidden !important;
  margin: 0 auto !important;
}

/* Tabla principal - FIJA Y CONTROLADA */
.woocommerce-checkout-review-order-table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  margin: 0 auto !important;
}

/* Encabezados */
.woocommerce-checkout-review-order-table thead th:first-child {
  width: 65% !important;
  text-align: left !important;
  padding: 0.8rem !important;
}

.woocommerce-checkout-review-order-table thead th:last-child {
  width: 35% !important;
  text-align: right !important;
  padding: 0.8rem !important;
}

/* Columna de productos - CONTROLADA */
.woocommerce-checkout-review-order-table .product-name {
  width: 65% !important;
  max-width: 65% !important;
  padding: 0.8rem !important;
  text-align: left !important;
  vertical-align: top !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}

/* Hover para mostrar texto completo */
.woocommerce-checkout-review-order-table .product-name:hover {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  position: relative !important;
  z-index: 10 !important;
  background: #0f141d !important;
  border: 1px solid #c5e82e !important;
  border-radius: 4px !important;
  padding: 0.5rem !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
}

/* Columna de totales - FIJA */
.woocommerce-checkout-review-order-table .product-total {
  width: 35% !important;
  max-width: 35% !important;
  text-align: right !important;
  padding: 0.8rem !important;
  vertical-align: top !important;
  white-space: nowrap !important;
  font-weight: 600 !important;
}

/* Cuerpo y pie de tabla */
.woocommerce-checkout-review-order-table tbody td,
.woocommerce-checkout-review-order-table tfoot td,
.woocommerce-checkout-review-order-table tfoot th {
  padding: 0.8rem !important;
  vertical-align: middle !important;
  word-wrap: break-word !important;
}

/* Footer de totales */
.woocommerce-checkout-review-order-table tfoot th {
  width: 65% !important;
  text-align: left !important;
}

.woocommerce-checkout-review-order-table tfoot td {
  width: 35% !important;
  text-align: right !important;
  white-space: nowrap !important;
}

/* Total final destacado */
.order-total {
  background: rgba(197, 232, 46, 0.1) !important;
  border: 2px solid #c5e82e !important;
  border-radius: 6px !important;
}

.order-total th,
.order-total td {
  font-size: 1.1rem !important;
  font-weight: bold !important;
  color: #c5e82e !important;
}

/* Cantidad y variaciones compactas */
.woocommerce-checkout-review-order-table .product-quantity {
  font-size: 0.85rem !important;
  color: #c5e82e !important;
  margin-left: 0.5rem !important;
}

.woocommerce-checkout-review-order-table .wc-item-meta {
  font-size: 0.8rem !important;
  margin-top: 0.3rem !important;
}

.woocommerce-checkout-review-order-table .wc-item-meta p {
  margin: 0.1rem 0 !important;
  color: #d1d1d1 !important;
}

/* Productos recomendados */
.recommended-products {
  margin-top: 2rem;
  padding: 0 1rem;
}

.recommended-products h2 {
  font-family: "Days One", sans-serif;
  color: #c5e82e;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  text-align: center;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.products-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.product-card {
  width: 280px;
  max-width: 100%;
  background: #0f141d;
  border: 2px solid #c5e82e;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(197, 232, 46, 0.2);
}

.product-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.product-card h3 {
  color: #c5e82e;
  font-family: "Days One", sans-serif;
  font-size: 1rem;
  margin: 0;
  line-height: 1.2;
}

.product-price {
  color: #c5e82e;
  font-weight: bold;
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.add-to-cart-btn {
  background: linear-gradient(135deg, #63bbe8 0%, #c5e82e 100%);
  color: #000;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.add-to-cart-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

/* Estilos para campos de cantidad */
.quantity-wrapper {
  position: relative;
}

.quantity-limit {
  display: block;
  font-size: 0.7rem;
  color: #888;
  margin-top: 0.2rem;
  font-style: italic;
}

.glassip-quantity:invalid {
  border-color: #ff4444 !important;
  box-shadow: 0 0 5px rgba(255, 68, 68, 0.3);
}

.glassip-quantity:valid {
  border-color: #c5e82e !important;
}

.glassip-quantity::-webkit-outer-spin-button,
.glassip-quantity::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.glassip-quantity[type=number] {
  -moz-appearance: textfield;
}

/* Estados de carga */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #c5e82e;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .glassip-cart-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .item-image {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
  }

  .woocommerce-checkout-review-order-table .product-name {
    font-size: 0.85rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }
}

/* Móviles */
@media (max-width: 480px) {
  .glassip-cart-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .glassip-cart-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem 0.5rem;
  }

  .cart-item {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 0;
  }

  .item-image {
    align-self: center;
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
  }

  .item-details {
    text-align: center;
  }

  .item-actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-width: auto;
  }

  .coupon-form {
    flex-direction: column;
  }

  .products-grid {
    justify-content: center;
  }

  .product-card {
    width: 100%;
    max-width: 300px;
  }

  /* Tabla responsive en móviles */
  .woocommerce-checkout-review-order-table .product-name {
    width: 60% !important;
    max-width: 60% !important;
    font-size: 0.75rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }

  .woocommerce-checkout-review-order-table .product-total {
    width: 40% !important;
    max-width: 40% !important;
  }

  .woocommerce-checkout-review-order-table thead th:first-child {
    width: 60% !important;
  }

  .woocommerce-checkout-review-order-table thead th:last-child {
    width: 40% !important;
  }

  .woocommerce-checkout-review-order-table tfoot th {
    width: 60% !important;
  }

  .woocommerce-checkout-review-order-table tfoot td {
    width: 40% !important;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .glassip-cart-layout {
    grid-template-columns: 1fr 380px;
    gap: 2rem;
  }

  .glassip-cart-summary {
    position: sticky;
    top: 1rem;
  }
}
/* =================  ENVÍO: forzar color a #c5e82e  ================= */
/* Paso 1: en el listado de métodos (carrito y checkout) ------------- */
ul.woocommerce-shipping-methods li label,
ul#shipping_method li label {
    color: white !important;
}

