/**
 * Estilos Finales y Unificados de WooCommerce para el Tema DataEstratego.
 * Contiene estilos para el título, las tarjetas de categoría y las tarjetas de producto.
 */

/* ===================================================================
   ESTILOS GENERALES DE LA TIENDA
   =================================================================== */
.woocommerce-products-header__title,
.store-categories-section h2 {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem !important;
    font-size: 2rem;
}


/* ===================================================================
   DISEÑO DE TARJETAS DE CATEGORÍA
   (Basado en el código que proporcionaste)
   =================================================================== */
.store-categories-section .card {
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.store-categories-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.15);
}

.store-categories-section .card-img-top {
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.store-categories-section .card:hover .card-img-top {
    transform: scale(1.05);
}

.store-categories-section .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.store-categories-section .card-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.store-categories-section .btn {
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease-in-out;
    border-radius: 0.3rem;
}

.store-categories-section .btn-primary {
    background-color: #0069d9;
    border-color: #0062cc;
}

.store-categories-section .btn-primary:hover {
    background-color: #0053ba;
    border-color: #004ba0;
}


/* ===================================================================
   DISEÑO DE TARJETAS DE PRODUCTO
   (Nuevos estilos para arreglar la apariencia del producto)
   =================================================================== */

.product-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

/* Imagen del producto */
.product-card-image-wrapper {
    display: block;
    overflow: hidden;
    height: auto;
    position: relative;
}

.product-card-image-wrapper img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-image-wrapper img {
    transform: scale(1.08);
}

/* Etiqueta de "Oferta!" */
.product-card .onsale {
    position: absolute;
    min-width: 6.236em !important;
    top: 1rem;
    left: 1rem;
    background-color: #dc3545;
    color: white;
    border-radius: 0px 0px 10px 0px !important;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
    margin: 0;
}

/* Etiqueta de la categoría del producto */
.product-card .product-category-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.product-card .product-category-label a {
    text-decoration: none;
    color: #6c757d;
}
.product-card .product-category-label a:hover {
    color: #0d6efd;
}

/* Título del producto */
.product-card .product-title {
    font-size: 1rem;
    font-weight: 600;
    min-height: 48px;
}
.product-card .product-title a:hover {
    color: #0d6efd !important;
}

/* Precio */
.product-card .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}
.product-card .price ins { /* Precio de oferta */
    text-decoration: none;
    background-color: transparent;
    color: #198754; /* Color verde para la oferta */
}
.product-card .price del { /* Precio antiguo */
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 400;
}

/* Botón "Añadir al carrito" */
.product-card .add_to_cart_button {
    background-color: #0d6efd !important; /* Azul primario */
    color: #fff !important;
    border-radius: 0.25rem;
    padding: 0.6rem 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.product-card .add_to_cart_button:hover {
    background-color: #0b5ed7 !important; /* Azul más oscuro */
}

/* Botón "Ver opciones" o cuando se añade al carrito */
.product-card .added_to_cart,
.product-card .button[data-product_id] {
    display: inline-block;
}
/* Contenedor de botón y mensaje post-add */
.woocommerce .added_to_cart.wc-forward {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #555;
    text-align: center;
    text-decoration: none;
}

.woocommerce .added_to_cart.wc-forward:hover {
    color: #111;
    text-decoration: none;
}

/* Botón "Añadir al carrito" */
.woocommerce ul.products li.product .button {
    display: inline-block;
    width: 100%;
    font-weight: 600;
    padding: 0.6rem 1rem;
    background-color: #0073e6;
    color: white;
    border-radius: 6px;
    text-align: center;
    transition: background-color 0.2s ease;
    margin-top: 1rem;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #005bb5;
}

/* Evitar que se vea en línea feo */
.woocommerce ul.products li.product .button + .added_to_cart {
    display: block;
    margin-top: 0.4rem;
}


/* --- CONTENEDOR PRINCIPAL DEL CARRITO --- */
.woocommerce-cart .cart-collaterals {
    border-left: 1px solid #e5e5e5;
    padding-left: 2rem;
    margin-top: 1rem;
}

/* --- TABLA DEL CARRITO --- */
.woocommerce-cart table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.woocommerce-cart table.shop_table th,
.woocommerce-cart table.shop_table td {
    padding: 1rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e5e5e5;
}

/* --- IMAGEN DEL PRODUCTO --- */
.woocommerce-cart .product-thumbnail img {
    max-width: 80px;
    height: auto;
    border-radius: 0.25rem;
}

/* --- NOMBRE DEL PRODUCTO --- */
.woocommerce-cart .product-name a {
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}

.woocommerce-cart .product-name a:hover {
    color: #0073e6;
}

/* --- PRECIO ANTIGUO --- */
.woocommerce-cart del {
    color: #888;
    margin-right: 0.3rem;
}

/* --- PRECIO NUEVO --- */
.woocommerce-cart ins {
    color: #28a745;
    font-weight: bold;
    text-decoration: none;
}

/* --- MENSAJE DE AHORRO --- */
.woocommerce-cart .woocommerce-cart-form__cart-item .product-name .amount-saved {
    display: inline-block;
    background-color: #ffc107;
    color: #000;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-top: 0.25rem;
}

/* --- ELIMINAR ARTÍCULO --- */
.woocommerce a.remove {
    color: red !important;
    font-weight: bold;
}

/* --- TOTALES --- */
.woocommerce-cart .cart_totals h2 {
    font-size: 1.4rem;
    font-weight: bold;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.woocommerce-cart .cart_totals table th {
    font-weight: 500;
    color: #333;
    padding-right: 1rem;
}

.woocommerce-cart .cart_totals table td {
    font-weight: bold;
    color: #000;
}

/* --- BOTÓN FINALIZAR COMPRA --- */
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    display: inline-block;
    background-color: #0073e6;
    color: white;
    padding: 0.75rem 1.25rem;
    font-weight: bold;
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background-color: #005bb5;
}

/* --- COUPON FIELD --- */
.woocommerce-cart .coupon {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.woocommerce-cart .coupon input {
    flex: 1;
    max-width: 200px;
}

.woocommerce-cart .coupon button {
    background-color: #333;
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
}

.woocommerce-cart .coupon button:hover {
    background-color: #000;
}


/* Fondo general claro */
.woocommerce-account {
  background-color: #f8f9fa;
  padding: 40px 0;
}

/* Estilo para columnas de acceso y registro */
.woocommerce .u-columns .u-column1,
.woocommerce .u-columns .u-column2 {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
  margin-bottom: 30px;
}

/* Títulos */
.woocommerce h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #333;
}

/* Campos de formulario */
.woocommerce form .form-row input.input-text {
  border-radius: 8px;
  border: 1px solid #ced4da;
  padding: 12px;
  font-size: 16px;
  width: 100%;
  transition: border-color 0.3s;
}

.woocommerce form .form-row input.input-text:focus {
  border-color: #198754;
  outline: none;
}

/* Botones */
.woocommerce form .woocommerce-form-login__submit,
.woocommerce form .woocommerce-form-register__submit,
.woocommerce button.button {
  background-color: #198754;
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 8px;
  transition: background-color 0.3s;
}

.woocommerce form .woocommerce-form-login__submit:hover,
.woocommerce form .woocommerce-form-register__submit:hover,
.woocommerce button.button:hover {
  background-color: #157347;
}

/* Checkbox recordar */
.woocommerce form .woocommerce-form__label-for-checkbox {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

/* Enlace de recuperar contraseña */
.woocommerce-LostPassword {
  margin-top: 10px;
}

.woocommerce-LostPassword a {
  color: #198754;
  font-weight: 500;
}

/* Texto del registro */
.woocommerce .woocommerce-form-register p {
  font-size: 14px;
  color: #555;
}

/* Responsive */
@media (max-width: 768px) {
  .woocommerce .u-columns {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}
