/*
Theme Name: WildCoffee Theme
Theme URI: https://tudominio.com
Author: Tu Nombre
Description: Tema profesional WildCoffee compatible con WooCommerce y TailwindCSS.
Version: 1.2
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
Text Domain: wildcoffee
*/

/* =========================================
   1. CORRECCIONES ESTRUCTURALES
   ========================================= */

/* Eliminar los puntos de lista y mÃƒÂ¡rgenes por defecto de WooCommerce */
.woocommerce ul.products, 
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (min-width: 640px) { .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .woocommerce ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Forzar que cada producto sea una tarjeta limpia */
.woocommerce ul.products li.product, 
.woocommerce-page ul.products li.product {
    list-style: none !important;
    margin-bottom: 0 !important; /* El grid se encarga del espacio */
    width: 100% !important;
    float: none !important;
    background: #ffffff;
    border-radius: 1.5rem; /* rounded-3xl */
    padding: 1.5rem;
    border: 1px solid #f3f4f6;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Efecto Hover en la tarjeta (Flow) */
.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(45, 90, 63, 0.2); /* primary color con opacidad */
}

/* =========================================
   2. ESTILIZACIÃƒâ€œN DE LA TARJETA (El Flow)
   ========================================= */

/* Imagen del producto */
.woocommerce ul.products li.product a img {
    border-radius: 1rem;
    margin-bottom: 1rem !important;
    width: 100%;
    height: 250px !important;
    object-fit: cover; /* Para que todas las fotos sean iguales */
    transition: transform 0.5s ease;
}

.woocommerce ul.products li.product:hover a img {
    transform: scale(1.05);
}

/* TÃƒÂ­tulo del producto */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.125rem !important;
    color: #111827; /* gray-900 */
    padding-top: 0.5rem;
}

/* Precio */
.woocommerce ul.products li.product .price {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #2d5a3f !important; /* Primary */
    font-weight: 800;
    font-size: 1.1rem !important;
    margin-bottom: 1rem;
    display: block;
}

.woocommerce ul.products li.product .price del {
    color: #9ca3af; /* gray-400 */
    font-weight: 400;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* =========================================
   3. EL BOTÃƒâ€œN "AÃƒâ€˜ADIR AL CARRITO"
   ========================================= */

/* Transformar el texto feo en un botÃƒÂ³n moderno */
.woocommerce ul.products li.product .button {
    background-color: #2d5a3f !important; /* Primary */
    color: white !important;
    border-radius: 0.75rem !important; /* rounded-xl */
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    text-align: center;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto; /* Empuja el botÃƒÂ³n al final de la tarjeta */
    transition: all 0.3s ease;
    text-decoration: none !important;
}

/* Icono falso con CSS (Opcional, para mÃƒÂ¡s estilo) */
.woocommerce ul.products li.product .button::after {
    content: '+';
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 400;
    margin-left: 0.5rem;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #1f3f2c !important; /* Darker primary */
    transform: scale(1.02);
    color: white !important;
}

.woocommerce ul.products li.product .button.loading {
    opacity: 0.7;
    cursor: wait;
}

/* Ocultar el enlace "Ver carrito" en las tarjetas de producto */
.woocommerce ul.products li.product .added_to_cart {
    display: none !important;
}

/* =========================================
   4. PÃGINA DEL CARRITO - AJUSTES
   ========================================= */

/* Ocultar botÃ³n "Actualizar carrito" */
.woocommerce button[name="update_cart"],
.woocommerce input[name="update_cart"],
.woocommerce .actions button[type="submit"] {
    display: none !important;
}

/* Ocultar secciÃ³n de cupones completamente */
.woocommerce .coupon,
.woocommerce-cart .coupon,
.woocommerce td.actions .coupon,
.woocommerce .cart-collaterals .coupon,
.woocommerce form.woocommerce-cart-form .coupon,
div.coupon {
    display: none !important;
}

/* Centrar el botÃ³n de eliminar producto (X roja) */
.woocommerce a.remove,
.woocommerce .product-remove a.remove {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    margin: 0 auto !important;
}

.woocommerce a.remove:hover {
    background-color: #dc2626 !important;
    color: white !important;
}

/* Centrar la celda del botÃ³n eliminar */
.woocommerce table.cart td.product-remove {
    text-align: center !important;
    vertical-align: middle !important;
}

/* =========================================
   5. INDICADOR DEL CARRITO EN HEADER
   ========================================= */

/* CÃ­rculo rojo del carrito en header */
.cart-count {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    width: 8px !important;
    height: 8px !important;
    background-color: #ef4444 !important;
    border-radius: 50% !important;
    border: 2px solid white !important;
}

/* =========================================
   6. LOGO DEL HEADER - CONTROL DE TAMAÃ‘O
   ========================================= */

/* Asegurar que el logo nunca se desborde */
#navbar a img,
nav a img {
    height: 40px !important;
    max-height: 40px !important;
    width: auto !important;
    max-width: 150px !important;
    object-fit: contain !important;
}

/* Footer logo */
footer a img {
    height: 40px !important;
    max-height: 40px !important;
    width: auto !important;
    max-width: 150px !important;
    object-fit: contain !important;
}

/* =========================================
   7. LOADER - SOLO UNO EN PANTALLA
   ========================================= */

/* Estilo del loader de WooCommerce */
.woocommerce .blockUI.blockOverlay {
    background: rgba(255, 255, 255, 0.8) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%232d5a3f" stroke-width="2"><circle cx="12" cy="12" r="10" stroke-opacity="0.2"/><path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/></path></svg>') center center no-repeat !important;
    background-size: 40px 40px !important;
    opacity: 1 !important;
}

/* Ocultar el gif por defecto de WooCommerce */
.woocommerce .loader,
.woocommerce .blockUI.blockOverlay::before {
    display: none !important;
}

/* Evitar mÃºltiples overlays apilados */
.woocommerce .processing .blockUI.blockOverlay ~ .blockUI.blockOverlay,
.blockUI.blockOverlay ~ .blockUI.blockOverlay {
    display: none !important;
}

/* =========================================
   4. CORRECCIONES GENERALES WOOCOMMERCE
   ========================================= */

/* Inputs y Selects */
.woocommerce form .form-row input.input-text, 
.woocommerce form .form-row textarea,
.woocommerce .quantity .qty {
    padding: 0.75rem 1rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    background-color: #ffffff !important;
    min-height: 45px;
}

/* Notificaciones */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
    padding: 1rem 1.5rem !important;
    border-radius: 0.75rem !important;
    margin-bottom: 2rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-top: none !important;
    border-left: none !important;
}

/* Mensaje de Ã©xito (producto eliminado, aÃ±adido, etc.) */
.woocommerce-message { 
    background-color: #f0fdf4 !important; 
    border: 1px solid #bbf7d0 !important;
    color: #166534 !important;
    flex-direction: column;
    gap: 0.5rem;
}

/* Mensaje informativo (carrito vacÃ­o, etc.) */
.woocommerce-info { 
    background-color: #f0f9ff !important; 
    border: 1px solid #bae6fd !important;
    color: #0369a1 !important;
    flex-direction: column;
    gap: 0.5rem;
}

/* Mensaje de error */
.woocommerce-error {
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #991b1b !important;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none !important;
    padding-left: 1.5rem !important;
}

/* Enlace "Deshacer" y otros enlaces en notificaciones */
.woocommerce-message a,
.woocommerce-info a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: #2d5a3f;
    color: white !important;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

.woocommerce-message a:hover,
.woocommerce-info a:hover {
    background-color: #224530;
    transform: translateY(-1px);
}

/* BotÃ³n del mensaje de carrito vacÃ­o */
.woocommerce-info .button,
.cart-empty + .return-to-shop .button {
    background-color: #2d5a3f !important;
    color: white !important;
    margin-top: 0.5rem;
}

/* Icono antes del mensaje (ocultar el default feo) */
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    display: none !important;
}

/* PaginaciÃƒÂ³n */
.woocommerce nav.woocommerce-pagination ul {
    border: none !important;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}
.woocommerce nav.woocommerce-pagination ul li {
    border: none !important;
    overflow: hidden;
}
.woocommerce nav.woocommerce-pagination ul li a, 
.woocommerce nav.woocommerce-pagination ul li span {
    border-radius: 0.5rem;
    padding: 0.5rem 1rem !important;
    background: white;
    font-weight: 600;
    color: #2d5a3f;
    text-decoration: none;
}
.woocommerce nav.woocommerce-pagination ul li span.current {
    background: #2d5a3f !important;
    color: white !important;
}

/* =========================================
   5. EXTRAS DEL CATÃƒÂLOGO (NUEVO)
   ========================================= */

/* Estilizar el select de "Ordenar por" en la tienda */
.woocommerce-ordering {
    margin-bottom: 0 !important;
}

.woocommerce-ordering select {
    padding: 0.5rem 2rem 0.5rem 1rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
    color: #4b5563 !important;
    background-color: white !important;
    cursor: pointer;
    outline: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Ocultar scrollbar en los filtros de etiquetas pero permitir scroll */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =========================================
   6. TOAST NOTIFICATION - AÃ‘ADIR AL CARRITO
   ========================================= */

.wc-toast-container {
    position: fixed;
    top: 100px; /* Debajo del navbar */
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.wc-toast {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 320px;
    max-width: 400px;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-toast-show {
    transform: translateX(0);
    opacity: 1;
}

/* Icono de check */
.wc-toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2d5a3f 0%, #40916c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-toast-icon .material-symbols-outlined {
    color: white;
    font-size: 18px;
}

/* Contenido */
.wc-toast-content {
    flex: 1;
    min-width: 0;
}

.wc-toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #111827;
    margin-bottom: 0.5rem;
}

.wc-toast-product {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.wc-toast-img {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.wc-toast-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wc-toast-name {
    font-size: 0.8rem;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.wc-toast-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2d5a3f;
}

/* Acciones */
.wc-toast-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.wc-toast-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.wc-toast-btn .material-symbols-outlined {
    font-size: 14px;
}

.wc-toast-btn-primary {
    background: #2d5a3f;
    color: white;
}

.wc-toast-btn-primary:hover {
    background: #224530;
    transform: scale(1.02);
}

.wc-toast-close {
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-toast-close:hover {
    color: #4b5563;
    background: #f3f4f6;
}

.wc-toast-close .material-symbols-outlined {
    font-size: 16px;
}

/* AnimaciÃ³n del indicador del carrito */
@keyframes cartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.cart-pulse {
    animation: cartPulse 0.6s ease;
}

/* Responsive */
@media (max-width: 480px) {
    .wc-toast-container {
        left: 10px;
        right: 10px;
        top: 90px;
    }
    
    .wc-toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
    
    .wc-toast-name {
        max-width: 100px;
    }
}

/* =========================================
   8. MI CUENTA - DIRECCIONES
   ========================================= */

/* Reset completo de la estructura de WooCommerce */
.woocommerce-MyAccount-content .u-columns {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

@media (min-width: 768px) {
    .woocommerce-MyAccount-content .u-columns {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Eliminar floats de WooCommerce */
.woocommerce-MyAccount-content .u-columns::before,
.woocommerce-MyAccount-content .u-columns::after {
    display: none !important;
    content: none !important;
}

.woocommerce-MyAccount-content .col-1,
.woocommerce-MyAccount-content .col-2,
.woocommerce-MyAccount-content .u-column1,
.woocommerce-MyAccount-content .u-column2 {
    float: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Cada bloque de direcciÃ³n */
.woocommerce-MyAccount-content .col-1 .woocommerce-Address,
.woocommerce-MyAccount-content .col-2 .woocommerce-Address,
.woocommerce-MyAccount-content .woocommerce-Address {
    background: #f4f7f5 !important;
    border-radius: 1rem !important;
    padding: 1.5rem !important;
    border: 1px solid #e2e8f0 !important;
    height: 100% !important;
}

/* TÃ­tulo de la direcciÃ³n */
.woocommerce-MyAccount-content .woocommerce-Address-title {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.woocommerce-MyAccount-content .woocommerce-Address-title h3 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin: 0 !important;
    order: 1 !important;
}

/* Enlace de aÃ±adir/editar */
.woocommerce-MyAccount-content .woocommerce-Address-title a {
    font-size: 0.8rem !important;
    color: #2d5a3f !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    padding: 0.5rem 0.875rem !important;
    background: white !important;
    border-radius: 0.5rem !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    order: 2 !important;
}

.woocommerce-MyAccount-content .woocommerce-Address-title a:hover {
    background: #2d5a3f !important;
    color: white !important;
    border-color: #2d5a3f !important;
}

/* Contenido de la direcciÃ³n */
.woocommerce-MyAccount-content address {
    font-style: normal !important;
    color: #4b5563 !important;
    line-height: 1.7 !important;
}

/* Texto cuando no hay direcciÃ³n configurada */
.woocommerce-MyAccount-content address .woocommerce-customer-details--email,
.woocommerce-MyAccount-content address .woocommerce-customer-details--phone {
    color: #4b5563 !important;
}

.woocommerce-MyAccount-content .woocommerce-Address address:empty::before,
.woocommerce-MyAccount-content address em {
    color: #9ca3af !important;
    font-style: italic !important;
}

/* TÃ­tulo superior de la secciÃ³n */
.woocommerce-MyAccount-content > p:first-of-type {
    color: #6b7280 !important;
    margin-bottom: 1.5rem !important;
}

/* =========================================
   9. MI CUENTA - FORMULARIOS DE EDICIÃ“N
   ========================================= */

/* Formulario de ediciÃ³n de direcciÃ³n */
.woocommerce-MyAccount-content .woocommerce-address-fields {
    background: white !important;
    border-radius: 1rem !important;
    padding: 1.5rem !important;
    border: 1px solid #e2e8f0 !important;
}

.woocommerce-MyAccount-content .woocommerce-address-fields .form-row {
    margin-bottom: 1rem !important;
}

.woocommerce-MyAccount-content .woocommerce-address-fields label {
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.woocommerce-MyAccount-content .woocommerce-address-fields input,
.woocommerce-MyAccount-content .woocommerce-address-fields select {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    font-size: 0.95rem !important;
}

.woocommerce-MyAccount-content .woocommerce-address-fields input:focus,
.woocommerce-MyAccount-content .woocommerce-address-fields select:focus {
    border-color: #2d5a3f !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(45, 90, 63, 0.1) !important;
}

/* BotÃ³n guardar direcciÃ³n */
.woocommerce-MyAccount-content .woocommerce-address-fields button[type="submit"] {
    background-color: #2d5a3f !important;
    color: white !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: 0.75rem !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-top: 0.5rem !important;
}

.woocommerce-MyAccount-content .woocommerce-address-fields button[type="submit"]:hover {
    background-color: #224530 !important;
}

/* Contenedor Grid */
.cafe-template.cafe-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Escritorio: 3 Columnas */
@media (min-width: 768px) {
   .cafe-template.cafe-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tarjeta */
.cafe-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cafe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.cafe-img img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.cafe-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
}

.cafe-info h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: #3C2415; /* Color CafÃ© Oscuro */
}

.cafe-info h3 a {
    text-decoration: none;
    color: inherit;
}

.cafe-desc {
    background: #fdfbf7; /* Crema suave */
    padding: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    border-radius: 4px;
}

.cafe-price {
    font-weight: bold;
    color: #3C2415;
    margin-bottom: 15px;
    font-size: 1.1rem;
    margin-top: auto; /* Empuja el precio y botÃ³n al fondo */
}

/* BotÃ³n personalizado */
.cafe-btn {
    display: block!important;
    width: 100%;
    background-color: #D2691E!important; /* Acento Canela */
    color: white!important;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.9rem;
}

.cafe-btn:hover {
    background-color: #3C2415!important;
}