/**
 * Gramoflor Ibérica — CSS para Navegador de Productos
 * 
 * Añadir en: Elementor > CSS personalizado (del sitio)
 * O en: Apariencia > Personalizar > CSS adicional
 * O en: assets/css/custom.css del child theme
 *
 * @since 1.1.0
 */

/* ==========================================================================
   VARIABLES (heredan del child theme)
   ========================================================================== */
:root {
    --gf-green: #2E7D32;
    --gf-green-light: #4CAF50;
    --gf-green-dark: #1B5E20;
    --gf-green-bg: #E8F5E9;
    --gf-earth: #5D4037;
    --gf-gray: #757575;
    --gf-gray-light: #F5F5F5;
    --gf-dark: #212121;
    --gf-white: #FFFFFF;
    --gf-radius: 8px;
    --gf-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --gf-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --gf-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   TARJETA DE PRODUCTO (Loop Item)
   ========================================================================== */

/* Card hover effect */
.gramoflor-product-card {
    transition: var(--gf-transition);
    cursor: pointer;
    height: 100%;
}

.gramoflor-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--gf-shadow-hover) !important;
    border-color: var(--gf-green) !important;
}

/* Zona de imagen */
.gramoflor-card-image {
    background: var(--gf-gray-light) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    overflow: hidden;
}

.gramoflor-card-image img {
    transition: transform 0.4s ease;
    object-fit: contain !important;
    max-height: 180px;
    width: auto !important;
}

.gramoflor-product-card:hover .gramoflor-card-image img {
    transform: scale(1.05);
}

/* Nº artículo badge */
.gramoflor-card-artno {
    display: inline-block;
    background: var(--gf-gray-light);
    padding: 2px 8px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Título del producto en la card */
.gramoflor-card-title a {
    color: var(--gf-dark) !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.gramoflor-product-card:hover .gramoflor-card-title a {
    color: var(--gf-green) !important;
}

/* Excerpt */
.gramoflor-card-excerpt p {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Barra de progreso en la tarjeta */
.gramoflor-card-bar .gramoflor-progress-bar {
    height: 20px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
}

/* ==========================================================================
   SECCIÓN DE FILTROS
   ========================================================================== */

.gramoflor-nav-filters {
    border: 1px solid #E0E0E0;
}

/* Dropdowns de filtro */
.gramoflor-filter-dropdown select,
.gramoflor-filter-dropdown .elementor-taxonomy-filter__dropdown {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    font-size: 14px;
    color: var(--gf-dark);
    background: var(--gf-white);
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23757575' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.gramoflor-filter-dropdown select:focus,
.gramoflor-filter-dropdown .elementor-taxonomy-filter__dropdown:focus {
    border-color: var(--gf-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.gramoflor-filter-dropdown select:hover,
.gramoflor-filter-dropdown .elementor-taxonomy-filter__dropdown:hover {
    border-color: var(--gf-green-light);
}

/* ==========================================================================
   GRID DE PRODUCTOS
   ========================================================================== */

.gramoflor-product-grid .elementor-loop-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .gramoflor-product-grid .elementor-loop-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .gramoflor-product-grid .elementor-loop-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .gramoflor-nav-filters {
        flex-direction: column !important;
    }
    
    .gramoflor-nav-filters > .elementor-element {
        width: 100% !important;
        min-width: 100% !important;
    }
}

/* Paginación */
.gramoflor-product-grid .elementor-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.gramoflor-product-grid .elementor-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: var(--gf-dark);
    text-decoration: none;
    transition: var(--gf-transition);
    border: 2px solid transparent;
}

.gramoflor-product-grid .elementor-pagination .page-numbers:hover {
    background: var(--gf-green-bg);
    color: var(--gf-green);
}

.gramoflor-product-grid .elementor-pagination .page-numbers.current {
    background: var(--gf-green);
    color: var(--gf-white);
    border-color: var(--gf-green);
}

/* Mensaje "No se encontraron productos" */
.gramoflor-product-grid .e-loop-nothing-found-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--gf-gray);
    font-size: 16px;
    background: var(--gf-gray-light);
    border-radius: var(--gf-radius);
}

/* ==========================================================================
   SECCIÓN CTA (asesoramiento)
   ========================================================================== */

.gramoflor-cta-section {
    margin-top: 40px;
}

.gramoflor-cta-button .elementor-button {
    transition: var(--gf-transition) !important;
}

.gramoflor-cta-button .elementor-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gramoflor-cta-image img {
    border-radius: 0 0 0 0;
    max-height: 300px;
    object-fit: contain;
}

/* ==========================================================================
   BADGES DE TORFFREI Y BIO (opcional, para usar en tarjetas)
   ========================================================================== */

.gramoflor-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gramoflor-badge--torffrei {
    background: #E8F5E9;
    color: #1B5E20;
}

.gramoflor-badge--bio {
    background: #FFF3E0;
    color: #E65100;
}

/* ==========================================================================
   ANIMACIONES DE ENTRADA
   ========================================================================== */

@keyframes gramoflor-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gramoflor-product-card {
    animation: gramoflor-fadeInUp 0.4s ease both;
}

.gramoflor-product-grid .elementor-loop-container > *:nth-child(1) { animation-delay: 0s; }
.gramoflor-product-grid .elementor-loop-container > *:nth-child(2) { animation-delay: 0.05s; }
.gramoflor-product-grid .elementor-loop-container > *:nth-child(3) { animation-delay: 0.1s; }
.gramoflor-product-grid .elementor-loop-container > *:nth-child(4) { animation-delay: 0.15s; }
.gramoflor-product-grid .elementor-loop-container > *:nth-child(5) { animation-delay: 0.2s; }
.gramoflor-product-grid .elementor-loop-container > *:nth-child(6) { animation-delay: 0.25s; }
.gramoflor-product-grid .elementor-loop-container > *:nth-child(7) { animation-delay: 0.3s; }
.gramoflor-product-grid .elementor-loop-container > *:nth-child(8) { animation-delay: 0.35s; }
.gramoflor-product-grid .elementor-loop-container > *:nth-child(9) { animation-delay: 0.4s; }

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    .gramoflor-nav-filters,
    .gramoflor-cta-section,
    .elementor-pagination {
        display: none !important;
    }
    .gramoflor-product-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}