.woocommerce-Price-amount.amount {
  width: 1%;
  background-color: #ffffff;
}

.price {
  width: 100%;
  z-index: 0;
  margin-top: 10px;
  height: 50%;
}

tr {
  margin-top: 30px;
}

label {
  margin-top: 39px;
  font-size: 20px;
}

bdi {
  color: #050505;
}

.value {
  font-size: 18px;
}

/* Estilo Moderno para WooCommerce Checkout */

/* General Checkout Page Styles */
.woocommerce-checkout {
    font-family: 'Arial', sans-serif;
    background-color: #f7f7f7;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* Checkout Form */
.woocommerce-checkout form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Billing and Shipping Fields */
.woocommerce-billing-fields, .woocommerce-shipping-fields {
    flex: 1 1 45%;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

/* Order Review */
.woocommerce-checkout-review-order {
    flex: 1 1 100%;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

/* Buttons */
.woocommerce-checkout .button {
    background-color: #0073e6;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.woocommerce-checkout .button:hover {
    background-color: #005bb5;
}

/* Form Fields */
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout select,
.woocommerce-checkout textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Labels */
.woocommerce-checkout label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

/* Error Messages */
.woocommerce-error {
    background-color: #ffeded;
    border: 1px solid #e05353;
    color: #e05353;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Cambiar el color de las letras grises a negras en la página de checkout */

/* Etiquetas de formulario */
.woocommerce-checkout label,
.woocommerce-checkout .form-row label {
    color: #000000; /* Negro */
}

/* Texto de campos opcionales */
.woocommerce-checkout input[placeholder], 
.woocommerce-checkout textarea[placeholder] {
    color: #000000; /* Negro */
}

/* Títulos de secciones */
.woocommerce-checkout h3 {
    color: #000000; /* Negro */
}

/* Notas del pedido */
.woocommerce-checkout .woocommerce-additional-fields h3,
.woocommerce-checkout .woocommerce-additional-fields label {
    color: #000000; /* Negro */
}

/* Dirección de envío diferente */
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields label {
    color: #000000; /* Negro */
}

/* Texto de listas desplegables */
.woocommerce-checkout select,
.woocommerce-checkout select option {
    color: #000000; /* Negro */
		}

/* Estilo Moderno para la Página de Resultado de Compra de WooCommerce */

/* Contenedor principal */
.woocommerce-order {
    font-family: 'Arial', sans-serif;
    background-color: #f7f7f7;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* Títulos */
.woocommerce-order h2,
.woocommerce-order h3,
.woocommerce-order .woocommerce-thankyou-order-received {
    color: #000000; /* Negro */
    font-weight: bold;
    margin-bottom: 15px;
}

/* Detalles del pedido */
.woocommerce-order .woocommerce-order-details {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    color: #000000; /* Negro */
}

/* Lista de productos */
.woocommerce-order .woocommerce-order-details table.shop_table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-order .woocommerce-order-details table.shop_table th,
.woocommerce-order .woocommerce-order-details table.shop_table td {
    padding: 10px;
    border: 1px solid #eaeaea;
    color: #000000; /* Negro */
}

.woocommerce-order .woocommerce-order-details table.shop_table th {
    background-color: #f0f0f0;
    color: #000000; /* Negro */
}

.woocommerce-order .woocommerce-order-details table.shop_table td {
    background-color: #ffffff;
    color: #000000; /* Negro */
}

/* Información adicional */
.woocommerce-order .woocommerce-customer-details {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    color: #000000; /* Negro */
}

/* Enlaces */
.woocommerce-order a {
    color: #0073e6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.woocommerce-order a:hover {
    color: #005bb5;
}

/* Botones */
.woocommerce-order .button {
    background-color: #0073e6;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.woocommerce-order .button:hover {
    background-color: #005bb5;
}

/* Texto de agradecimiento y detalles del pedido */
.woocommerce-order .woocommerce-order-overview__order,
.woocommerce-order .woocommerce-order-overview__date,
.woocommerce-order .woocommerce-order-overview__email,
.woocommerce-order .woocommerce-order-overview__total,
.woocommerce-order .woocommerce-order-overview__payment-method,
.woocommerce-order .woocommerce-notice,
.woocommerce-order .woocommerce-notice--success,
.woocommerce-order .woocommerce-notice--info,
.woocommerce-order .woocommerce-notice--error {
    color: #000000; /* Negro */
}

/* Títulos y valores en la tabla de resumen del pedido */
.woocommerce-order-overview li {
    color: #000000; /* Negro */
}

/* Texto de resumen del pedido */
.woocommerce-order-received {
    color: #000000; /* Negro */
}

/* ============================
   Cupón en Carrito + Checkout
   ============================ */

/* Inputs del cupón (carrito y checkout) */
.woocommerce-cart table.cart td.actions .coupon .input-text,
.woocommerce .woocommerce-form-coupon .input-text,        /* mini-form "¿Tienes un cupón?" */
.woocommerce-checkout .checkout_coupon .input-text {       /* formulario de cupón en finalizar compra */
  color: #000 !important;
  border-color: #000 !important;
}

/* Placeholders de esos inputs */
.woocommerce-cart table.cart td.actions .coupon .input-text::placeholder,
.woocommerce .woocommerce-form-coupon .input-text::placeholder,
.woocommerce-checkout .checkout_coupon .input-text::placeholder {
  color: #000 !important;
  opacity: .6;
}

/* Botón "Aplicar cupón" (carrito y checkout) */
.woocommerce-cart .coupon .button,
.woocommerce .woocommerce-form-coupon .button,
.woocommerce-checkout .checkout_coupon .button {
  color: #000 !important;
  border-color: #000 !important;
  background: #fff !important;
}
.woocommerce-cart .coupon .button:hover,
.woocommerce .woocommerce-form-coupon .button:hover,
.woocommerce-checkout .checkout_coupon .button:hover {
  background: #000 !important;
  color: #fff !important;
}

/* Fila de descuento aplicada (carrito: Totales) */
.woocommerce-cart .cart_totals .cart-discount th,
.woocommerce-cart .cart_totals .cart-discount td,
.woocommerce-cart .cart_totals .cart-discount td .amount {
  color: #000 !important;
  opacity: 1 !important;
}

/* Fila de descuento aplicada (checkout: Resumen del pedido) */
.woocommerce-checkout .woocommerce-checkout-review-order-table .cart-discount th,
.woocommerce-checkout .woocommerce-checkout-review-order-table .cart-discount td,
.woocommerce-checkout .woocommerce-checkout-review-order-table .cart-discount td .amount {
  color: #000 !important;
  opacity: 1 !important;
}



(function($){
  // guarda lo que el usuario elija
  $(document.body).on('change', 'input[name="payment_method"]', function(){
    sessionStorage.setItem('chosen_gateway', this.value);
  });

  function reapplyChosen(){
    var id = sessionStorage.getItem('chosen_gateway');
    if(!id) return;
    var $input = $('input[name="payment_method"][value="'+id+'"]');
    if($input.length){
      $input.prop('checked', true);
      $input.trigger('change'); // avisa a Woo
    }
  }

  // al cargar y cada vez que Woo refresca el checkout
  $(function(){ reapplyChosen(); });
  $(document.body).on('updated_checkout payment_method_selected', reapplyChosen);
})(jQuery);