/*
Theme Name:   Equipamientos Ojeda Child
Theme URI:    https://equipamientosojeda.com
Description:  Child Theme ligero para Equipamientos Ojeda. Añade funcionalidades de WhatsApp, mejoras de grid y estilos visuales sin modificar el tema padre.
Author:       Equipamientos Ojeda
Author URI:   https://equipamientosojeda.com
Template:     storefront
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  equipamientos-ojeda-child
Tags:         woocommerce, child-theme, whatsapp
*/

/* ============================================================
   1. IMPORTAR ESTILOS DEL TEMA PADRE
   ============================================================ */
@import url("../storefront/style.css");

/* ============================================================
   2. BOTÓN FLOTANTE DE WHATSAPP
   ============================================================ */
.ojeda-whatsapp-float {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background-color: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
}

.ojeda-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(37, 211, 102, 0.6);
}

.ojeda-whatsapp-float svg {
    width: 30px;
    height: 30px;
    fill: #ffffff;
}

/* Tooltip al hacer hover */
.ojeda-whatsapp-float::before {
    content: "¡Escríbenos!";
    position: absolute;
    right: 68px;
    background: #333333;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.ojeda-whatsapp-float:hover::before {
    opacity: 1;
}

/* ============================================================
   3. GRID DE PRODUCTOS — CATEGORÍAS Y BÚSQUEDA
   ============================================================ */

/* Contenedor principal del loop de productos */
ul.products,
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 22px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Tarjeta individual de producto */
ul.products li.product,
.woocommerce ul.products li.product {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px !important;
    margin: 0 !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Efecto hover sutil en tarjeta */
ul.products li.product:hover,
.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
    border-color: #d0d0d0;
}

/* Imagen del producto */
ul.products li.product a img,
.woocommerce ul.products li.product a img {
    border-radius: 7px;
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: opacity 0.2s ease;
    display: block;
}

ul.products li.product:hover a img,
.woocommerce ul.products li.product:hover a img {
    opacity: 0.9;
}

/* Título del producto */
ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
    font-size: 14px !important;
    font-weight: 500;
    margin: 10px 0 6px !important;
    line-height: 1.4;
    color: #222222;
}

/* Precio */
ul.products li.product .price,
.woocommerce ul.products li.product .price {
    font-size: 15px !important;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

/* Botón Añadir al carrito */
ul.products li.product .button,
.woocommerce ul.products li.product .button {
    margin-top: auto;
    border-radius: 6px;
    font-size: 13px;
    padding: 9px 14px;
    text-align: center;
    transition: background-color 0.2s ease;
}

/* ============================================================
   4. PÁGINA DE CATEGORÍAS — ENCABEZADO Y DESCRIPCIÓN
   ============================================================ */
.term-description {
    background: #f9f9f9;
    border-left: 3px solid #25D366;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    color: #555555;
    margin-bottom: 24px;
}

/* ============================================================
   5. RESULTADOS DE BÚSQUEDA — ENCABEZADO
   ============================================================ */
.woocommerce-result-count {
    font-size: 13px;
    color: #777777;
    margin-bottom: 16px;
}

.woocommerce-ordering select {
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    font-size: 13px;
}

/* ============================================================
   6. RESPONSIVE — MÓVILES
   ============================================================ */
@media (max-width: 600px) {
    ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    ul.products li.product a img,
    .woocommerce ul.products li.product a img {
        height: 140px;
    }

    .ojeda-whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 18px;
        right: 18px;
    }

    .ojeda-whatsapp-float svg {
        width: 26px;
        height: 26px;
    }

    .ojeda-whatsapp-float::before {
        display: none;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
