﻿/* ==========================================================================
   CATÁLOGO - AGROACEITUNERA
   ========================================================================== */
.fondo-trama-blanca,
.fondo-grano-blanco {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
}

.fondo-trama-blanca {
    background-image: url('/images/trama-aceitunas.png');
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    filter: grayscale(1) invert(1);
    mix-blend-mode: screen;
    opacity: 0.35;
}

.fondo-grano-blanco {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 -12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' fill='black'/%3E%3C/svg%3E");
    filter: invert(1);
    mix-blend-mode: screen;
    opacity: 0.30;
}

/* Contenedor principal */
.catalogo-wrapper {
    position: relative;
    z-index: 10;
    min-height: calc(100vh - 12vh); /* Cambiado a unidad de viewport */
    padding-bottom: 40px;
}

/* Encabezado */
.catalogo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

    .catalogo-header h2 {
        font-size: 1.6rem;
        font-weight: 700;
        color: #fff;
        text-transform: uppercase;
    }

/* Botón de filtros (solo móvil) */
.btn-toggle-filters {
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
    background: transparent;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
}

    .btn-toggle-filters:hover {
        background: rgba(255,255,255,0.1);
    }

/* Sidebar de filtros (escritorio) */
.sidebar-filters {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

    .sidebar-filters h6 {
        color: #000000 !important;
        font-weight: 800;
        margin-bottom: 15px;
        text-transform: uppercase;
        font-size: 0.85rem;
        letter-spacing: 0.5px;
    }

/* Botones de filtro */
.btn-filter-item {
    color: #333333 !important;
    font-weight: 600;
    text-align: left;
    border: none;
    background: transparent;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    width: 100%;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

    .btn-filter-item.active,
    .btn-filter-item:hover {
        background-color: #062b20 !important;
        color: #ffffff !important;
    }

/* Offcanvas para filtros en móvil */
.offcanvas-filters {
    background-color: #f8f9fa;
}

    .offcanvas-filters .offcanvas-header {
        background: #062b20;
        color: white;
    }

    .offcanvas-filters .offcanvas-title {
        font-weight: 700;
        text-transform: uppercase;
    }

    .offcanvas-filters .btn-close {
        filter: invert(1);
    }

/* ==========================================================================
   TARJETAS 3D
   ========================================================================== */
.item-producto {
    perspective: 1000px;
    margin-bottom: 20px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 380px;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    cursor: pointer;
}

    .card-inner.is-flipped {
        transform: rotateY(180deg);
    }

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.img-inner-box {
    height: 200px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

    .img-inner-box img {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px;
    text-align: center;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1A1817;
    margin-bottom: 5px;
}

.product-description-front {
    font-size: 0.75rem;
    color: #666666;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Badges de marca */
.badge-tradicao {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    color: #ffffff;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.badge-nucete {
    background-color: #E30613;
}

.badge-rainha {
    background-color: #B5985A;
}

.badge-olivium {
    background-color: #1A1817;
}

.badge-default {
    background-color: #062b20;
}

/* Cara trasera */
.card-back {
    transform: rotateY(180deg);
    background-color: #f9f7f2;
    padding: 25px;
    justify-content: center;
    border: 2px solid #062b20;
}

.info-tecnica {
    font-size: 0.85rem;
    color: #1A1817;
}

    .info-tecnica div {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px dashed #cccccc;
    }

        .info-tecnica div:last-child {
            border-bottom: none;
        }

.ver-detalles {
    font-size: 0.6rem;
    color: #aaa;
    text-align: center;
    padding-bottom: 10px;
    text-transform: uppercase;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 991px) {
    .catalogo-header h2 {
        font-size: 1.3rem;
    }

    .card-inner {
        height: 340px;
    }

    .img-inner-box {
        height: 180px;
        padding: 15px;
    }

    .product-title {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .card-inner {
        height: 300px;
    }

    .img-inner-box {
        height: 150px;
        padding: 10px;
    }

    .product-title {
        font-size: 0.8rem;
    }

    .product-description-front {
        font-size: 0.7rem;
    }

    .catalogo-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

        .catalogo-header h2 {
            font-size: 1.2rem;
        }

    .btn-toggle-filters {
        align-self: flex-end;
    }
}
