﻿/**
 * Slick Carousel - Custom styles for Blazor components
 * Overrides and customizations for Slick default theme
 */

/* ============================================
   Wrapper and Container
   ============================================ */
.slick-carousel-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.slick-carousel__slide {
    padding: 0 6px; /* Gap between slides */
    display: flex !important; /* AGREGADO: Necesario para altura igual */
    height: auto;
}

/* ============================================
   Arrows - Hide on mobile, show on desktop
   ============================================ */
.slick-prev,
.slick-next {
    width: 40px;
    height: 40px;
    z-index: 10;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.slick-prev:hover,
.slick-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.slick-prev:before,
.slick-next:before {
    font-size: 20px;
    line-height: 1;
}

/* Position adjustments */
.slick-prev {
    left: 10px;
}

.slick-next {
    right: 10px;
}

/* Hide arrows on mobile/tablet */
@media (max-width: 1023px) {
    .slick-prev,
    .slick-next {
        display: none !important;
    }
}

/* ============================================
   Dots Navigation
   ============================================ */
.slick-dots {
    bottom: -30px;
    display: flex !important;
    justify-content: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.slick-dots li {
    margin: 0;
    width: auto;
    height: auto;
}

.slick-dots li button {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.25);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slick-dots li button:before {
    display: none; /* Hide default Slick dot */
}

.slick-dots li.slick-active button {
    width: 24px;
    border-radius: 12px;        
    background-color: var(--active-dot-color, var(--brand-color, #00a859));
}

.slick-dots li button:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

/* ============================================
   Loading State
   ============================================ */
.slick-carousel-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   Product Cards Integration - ALTURA IGUAL
   ============================================ */

/* Asegurar que el track use flexbox y estire los slides */
.slick-carousel-wrapper .slick-track {
    display: flex !important;
    align-items: stretch; /* CRÍTICO: Hace que todos los slides tengan la misma altura */
}

/* Los slides heredan la altura y usan flexbox */
.slick-carousel-wrapper .slick-slide {
    height: inherit !important; /* CRÍTICO: Hereda la altura del track */
    display: flex !important;
}

/* El div interno del slide también usa flexbox */
.slick-carousel-wrapper .slick-slide > div {
    width: 100%;
    display: flex;
    height: 100%; /* AGREGADO: Asegura que ocupe todo el alto */
}

/* IMPORTANTE: Asegurar que product-card-carousel ocupe todo el espacio */
.slick-carousel-wrapper .product-card-carousel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* CRÍTICO: El body debe usar flex: 1 para expandirse */
.slick-carousel-wrapper .product-card-carousel__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Permite que flex funcione correctamente */
}

/* Los actions deben quedar pegados al final */
.slick-carousel-wrapper .product-card-carousel__actions {
    margin-top: auto;
    flex-shrink: 0; /* No se comprime */
}

/* Asegurar que la imagen no crezca más de lo necesario */
.slick-carousel-wrapper .product-card-carousel__image-container {
    flex-shrink: 0;
}

/* Para el modo compacto */
.slick-carousel-wrapper .product-card-carousel--compact {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Image Gallery Specific
   ============================================ */
.product-image-gallery {
    max-width: 100%;
}

.product-image-gallery .slick-slide {
    text-align: center;
}

.product-image-gallery__image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (min-width: 768px) {
    .slick-dots li button {
        width: 12px;
        height: 12px;
    }

    .slick-dots li.slick-active button {
        width: 28px;
    }
}

@media (min-width: 1024px) {
    .slick-prev,
    .slick-next {
        width: 44px;
        height: 44px;
    }

    .slick-prev:before,
    .slick-next:before {
        font-size: 24px;
    }
}

/* ============================================
   Accessibility
   ============================================ */

/* Disable focus outline on slides */
.slick-carousel-wrapper .slick-slide:focus,
.slick-carousel-wrapper .slick-slide:focus-visible,
.slick-carousel-wrapper .slick-slide:active {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
}

.slick-carousel-wrapper button:focus-visible {
    outline: 2px solid var(--active-dot-color, var(--brand-color, #00a859));
    outline-offset: 2px;
}

/* ============================================
   Performance Optimization
   ============================================ */
.slick-carousel-wrapper .slick-track {
    will-change: transform;
}

.slick-carousel-wrapper img {
    will-change: auto; /* Prevent unnecessary repaints */
}
