/**
 * Elementor Posts Carousel Pro - Styles
 * Version: 1.0.0
 */

/* ===========================
   CAROUSEL WRAPPER
   =========================== */
.epcp-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: visible; /* Visible para permitir flechas fuera */
    padding: 20px 0; /* Espacio arriba y abajo para sombras */
    isolation: isolate; /* Crea nuevo contexto de apilamiento para múltiples carruseles */
}

/* Cuando las flechas están fuera, agregar padding horizontal */
.epcp-carousel-wrapper[data-arrows="outside"] {
    padding-left: 60px;
    padding-right: 60px;
}

.epcp-carousel {
    width: 100%;
    overflow: hidden; /* El overflow hidden se mantiene aquí */
    position: relative;
}

.swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.swiper-slide {
    height: auto;
    display: flex;
    padding: 0 10px; /* Espacio a los lados para las sombras */
}

/* ===========================
   POST CARD BASE
   =========================== */
.epcp-post-card {
    background: #fff;
    overflow: hidden;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Sombra por defecto */
}

/* Card Clickable */
.epcp-card-clickable {
    cursor: pointer;
}

/* ===========================
   CARD HOVER ANIMATIONS
   =========================== */
.epcp-hover-lift .epcp-post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.epcp-hover-scale .epcp-post-card:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.epcp-hover-rotate .epcp-post-card:hover {
    transform: rotate(2deg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ===========================
   IMAGE STYLES
   =========================== */
.epcp-post-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-bottom: 66%;
    background: #f5f5f5;
}

.epcp-post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Image Overlay */
.epcp-post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.epcp-post-card:hover .epcp-post-image::before {
    opacity: 1;
}

/* Image Hover Effects */
.epcp-image-hover-zoom .epcp-post-image:hover img {
    transform: scale(1.1);
}

.epcp-image-hover-zoom-out .epcp-post-image img {
    transform: scale(1.1);
}

.epcp-image-hover-zoom-out .epcp-post-image:hover img {
    transform: scale(1);
}

.epcp-image-hover-grayscale .epcp-post-image img {
    filter: grayscale(0%);
}

.epcp-image-hover-grayscale .epcp-post-image:hover img {
    filter: grayscale(100%);
}

.epcp-image-hover-blur .epcp-post-image img {
    filter: blur(0px);
}

.epcp-image-hover-blur .epcp-post-image:hover img {
    filter: blur(3px);
}

/* Image Positions */
.epcp-image-left {
    flex-direction: row;
}

.epcp-image-left .epcp-post-image {
    flex: 0 0 40%;
    padding-bottom: 0;
    min-height: 250px;
}

.epcp-image-left .epcp-post-content {
    flex: 1;
}

.epcp-image-right {
    flex-direction: row-reverse;
}

.epcp-image-right .epcp-post-image {
    flex: 0 0 40%;
    padding-bottom: 0;
    min-height: 250px;
}

.epcp-image-right .epcp-post-content {
    flex: 1;
}

.epcp-image-background {
    position: relative;
}

.epcp-image-background .epcp-post-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-bottom: 0;
    z-index: 0;
}

.epcp-image-background .epcp-post-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}

.epcp-image-background .epcp-post-content {
    position: relative;
    z-index: 2;
    color: #fff;
}

/* ===========================
   CONTENT STYLES
   =========================== */
.epcp-post-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Categories */
.epcp-post-categories {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.epcp-category {
    display: inline-block;
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Title */
.epcp-post-title {
    margin: 0 0 15px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.epcp-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Meta */
.epcp-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    opacity: 0.7;
}

.epcp-post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Excerpt */
.epcp-post-excerpt {
    margin-bottom: 20px;
    line-height: 1.6;
    flex: 1;
}

/* Button */
.epcp-post-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    outline: none;
    font-weight: 500;
    align-self: flex-start;
}

.epcp-button-icon-before,
.epcp-button-icon-after {
    display: inline-flex;
    align-items: center;
}

/* ===========================
   NAVIGATION STYLES - Específico para EPCP
   =========================== */
.epcp-carousel-wrapper .swiper-button-next,
.epcp-carousel-wrapper .swiper-button-prev {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    transition: all 0.3s ease !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.epcp-carousel-wrapper .swiper-button-next:hover,
.epcp-carousel-wrapper .swiper-button-prev:hover {
    transform: translateY(-50%) scale(1.1) !important;
}

.epcp-carousel-wrapper .swiper-button-next:after,
.epcp-carousel-wrapper .swiper-button-prev:after {
    content: none !important;
}

.epcp-carousel-wrapper .swiper-button-prev {
    left: 10px !important;
}

.epcp-carousel-wrapper .swiper-button-next {
    right: 10px !important;
}

/* Forzar que NUNCA se vean deshabilitadas */
.epcp-carousel-wrapper .swiper-button-next.swiper-button-disabled,
.epcp-carousel-wrapper .swiper-button-prev.swiper-button-disabled {
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.epcp-carousel-wrapper .swiper-button-next.swiper-button-disabled:hover,
.epcp-carousel-wrapper .swiper-button-prev.swiper-button-disabled:hover {
    transform: translateY(-50%) scale(1.1) !important;
}

/* ===========================
   PAGINATION STYLES
   =========================== */
.epcp-carousel-wrapper .swiper-pagination {
    position: relative;
    margin-top: 20px;
    text-align: center;
}

.epcp-carousel-wrapper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    opacity: 0.3;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.epcp-carousel-wrapper .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

.epcp-carousel-wrapper .swiper-pagination-fraction {
    font-weight: 500;
}

.epcp-carousel-wrapper .swiper-pagination-progressbar {
    height: 4px;
    background: rgba(0,0,0,0.1);
}

.epcp-carousel-wrapper .swiper-pagination-progressbar-fill {
    height: 100%;
}

/* ===========================
   RESPONSIVE ADJUSTMENTS
   =========================== */
@media (max-width: 768px) {
    .epcp-image-left,
    .epcp-image-right {
        flex-direction: column;
    }
    
    .epcp-image-left .epcp-post-image,
    .epcp-image-right .epcp-post-image {
        flex: 0 0 auto;
        padding-bottom: 66%;
        min-height: 0;
    }
    
    .epcp-carousel-wrapper .swiper-button-next,
    .epcp-carousel-wrapper .swiper-button-prev {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    /* En móvil, ajustar padding cuando las flechas están fuera */
    .epcp-carousel-wrapper[data-arrows="outside"] {
        padding-left: 45px;
        padding-right: 45px;
    }
}

@media (max-width: 480px) {
    /* En pantallas muy pequeñas, reducir espacio */
    .epcp-carousel-wrapper[data-arrows="outside"] {
        padding-left: 40px;
        padding-right: 40px;
    }
    
    .epcp-carousel-wrapper .swiper-button-prev {
        left: 5px;
    }
    
    .epcp-carousel-wrapper .swiper-button-next {
        right: 5px;
    }
    
    .epcp-carousel-wrapper .swiper-button-next,
    .epcp-carousel-wrapper .swiper-button-prev {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ===========================
   EDITOR MODE
   =========================== */
.elementor-editor-active .epcp-carousel-wrapper {
    overflow: visible;
}

/* ===========================
   RTL SUPPORT
   =========================== */
[dir="rtl"] .epcp-carousel-wrapper .swiper-button-prev {
    left: auto;
    right: 10px;
}

[dir="rtl"] .epcp-carousel-wrapper .swiper-button-next {
    right: auto;
    left: 10px;
}
