/* ========================================
   PURLINE PRODUCT CARD STYLES
   Diseño de fichas de productos reutilizable
   ======================================== */

/* Contenedor wrapper para scroll-snap vertical en móvil */
#purline-families-container {
    position: relative;
}

.purline-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 40px 30px;
    max-width: 100%;
    margin: 0 auto;
}

/* Limitar altura de las tarjetas en desktop */
@media (min-width: 769px) {
    .purline-product-card,
    .purline-category-card {
        max-height: 80vh;
    }
}

.purline-product-card {
    background: #fff !important;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 2px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #333 !important;
}

.purline-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    text-decoration: none;
}

.purline-product-image {
    position: relative;
    width: 100%;
    padding-top: 15%; /* Aspect ratio mínimo para máximo contenido */
    background: #fff !important;
    overflow: hidden;
}

.purline-product-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.4s ease;
}

/* Imagen de ambiente (segunda imagen) oculta por defecto */
.purline-product-image img.ambient-image {
    opacity: 0;
    object-fit: cover; /* Cover para imágenes de ambiente */
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
}

/* Solo en desktop: mostrar imagen de ambiente en hover */
@media (min-width: 769px) {
    .purline-product-card:hover .purline-product-image img.product-image {
        opacity: 0;
    }

    .purline-product-card:hover .purline-product-image img.ambient-image {
        opacity: 1;
    }
}

.purline-product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.purline-product-card:hover .purline-product-badge {
    opacity: 1;
}

.purline-product-info {
    padding: 12px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.purline-product-reference {
    font-size: 11px;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.purline-product-title {
    font-family: 'Dosis', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #000 !important;
    line-height: 1.4;
    margin-bottom: 8px;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: #f8f8f8;
    padding: 8px 10px;
    border-radius: 4px;
    margin: -5px -5px 8px -5px;
}

.purline-product-specs {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: auto;
}

.purline-product-spec {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.3;
}

.purline-product-spec:last-child {
    margin-bottom: 0;
}

.purline-product-spec-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
    color: #999;
}

.purline-category-card {
    background: #e8e8e8;
    border-radius: 8px;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 3px solid #d0d0d0;
    min-height: 300px;
    transition: all 0.3s ease;
}

.purline-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    text-decoration: none;
    border-color: #b8b8b8;
    background: #e0e0e0;
}

.purline-category-card h2 {
    font-family: 'Dosis', Arial, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #222;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.purline-category-card .category-count {
    font-family: 'Dosis', Arial, sans-serif;
    font-size: 16px;
    color: #888;
    margin-bottom: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
}

.purline-category-card .category-description {
    font-size: 28px;
    color: #333;
    line-height: 1.2;
    margin-bottom: 30px;
    flex: 1;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: center;
    padding: 20px 25px;
}

.purline-category-card .category-description p {
    margin: 0;
    width: 100%;
    font-family: 'Dosis', Arial, sans-serif;
    font-weight: 500;
    font-size: 32px;
    line-height: 1.2;
}

.purline-category-card .category-btn {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 20px 48px;
    border-radius: 6px;
    font-family: 'Dosis', Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.purline-category-card .category-btn:hover {
    background: #000;
    transform: scale(1.05);
    text-decoration: none;
    color: #fff;
}

.purline-view-all-card {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: #fff;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 300px;
}

.purline-view-all-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #333 0%, #222 100%);
    color: #fff;
    text-decoration: none;
}

.purline-view-all-content h3 {
    font-family: 'Dosis', Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.purline-view-all-content p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .purline-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

/* Tablet (2 columnas con scroll horizontal) */
@media (max-width: 768px) and (min-width: 481px) {
    .purline-products-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 20px;
        padding: 30px 15px;
        scrollbar-width: thin;
        scrollbar-color: #ccc #f0f0f0;
    }

    .purline-products-grid::-webkit-scrollbar {
        height: 8px;
    }

    .purline-products-grid::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 4px;
    }

    .purline-products-grid::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
    }

    .purline-product-card,
    .purline-category-card {
        flex: 0 0 calc(50vw - 30px);
        max-width: calc(50vw - 30px);
        scroll-snap-align: start;
        max-height: none;
    }
}

/* Móvil (1 columna con scroll horizontal ficha a ficha) */
@media (max-width: 480px) {
    /* Ocultar la imagen de cabecera en móvil */
    .sca_page_title {
        display: none !important;
    }

    /* Ajustar la sección principal para ocupar toda la pantalla */
    .sca_section {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Contenedor principal con scroll vertical snap */
    #purline-families-container {
        height: 100vh;
        overflow-y: scroll;
        overflow-x: hidden;
        scroll-snap-type: y mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-top: 70px; /* Compensar altura del menú fijo */
    }

    #purline-families-container::-webkit-scrollbar {
        display: none;
    }

    .purline-products-grid {
        display: flex;
        overflow-x: scroll;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-snap-stop: always;
        -webkit-overflow-scrolling: touch;
        gap: 20px;
        padding: 20px 20px 60px 20px;
        margin-bottom: 0;
        scrollbar-width: none;
        min-height: calc(100vh - 70px);
        max-height: calc(100vh - 70px);
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .purline-products-grid::-webkit-scrollbar {
        display: none;
    }

    .purline-product-card,
    .purline-category-card {
        flex: 0 0 85vw;
        min-width: 85vw;
        max-width: 85vw;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Reducir tamaños en la tarjeta de categoría para móvil */
    .purline-category-card h2 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .purline-category-card .category-count {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .purline-category-card .category-description {
        font-size: 20px;
        padding: 15px;
        margin-bottom: 20px;
    }

    .purline-category-card .category-description p {
        font-size: 18px;
    }

    .purline-category-card .category-btn {
        font-size: 16px;
        padding: 14px 28px;
    }

    .purline-category-card {
        padding: 25px 20px;
        min-height: auto;
    }
}
