/* Estilos básicos de Swiper */
.swiper {
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    transition-property: transform;
    box-sizing: content-box;
}

.swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
}

/* Contenedor para el carrusel y botones */
.hero-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Estilos específicos del Hero */
.wp-block-gutenberg-test-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: 80px; /* Margen inferior para espaciar el siguiente contenido */
}

.wp-block-gutenberg-test-hero .hero-section {
    position: relative;
    height: 70vh; /* Altura fija en proporción a la ventana */
    min-height: 500px;
    background: var(--color-black);
    overflow: hidden;
    padding-bottom: 0;
    margin-bottom: 0; /* Quitamos el margen de esta sección */
}

/* Swiper styles */
.wp-block-gutenberg-test-hero .swiper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Aseguramos que ocupa todo el alto */
    overflow: hidden;
}

.wp-block-gutenberg-test-hero .swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.wp-block-gutenberg-test-hero .swiper-slide {
    position: relative;
    width: 100%;
    height: 100%;
    opacity: 1;
}

.wp-block-gutenberg-test-hero .swiper-slide .hero-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    cursor: pointer;
}

.wp-block-gutenberg-test-hero .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.wp-block-gutenberg-test-hero .slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    text-decoration: none;
}

/* Asegura que la imagen se muestre correctamente en todos los dispositivos */
.wp-block-gutenberg-test-hero .swiper-slide-active {
    z-index: 2;
    opacity: 1;
    visibility: visible;
}

/* IMPORTANTE: Eliminar cualquier background fijo del slide-content */
.wp-block-gutenberg-test-hero .slide-content {
    position: relative;
    z-index: 3; /* Mayor que el z-index del enlace overlay */
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Permite que los clics pasen a través del contenido al enlace */
}

.wp-block-gutenberg-test-hero .slide-content h1,
.wp-block-gutenberg-test-hero .slide-content p,
.wp-block-gutenberg-test-hero .slide-content .slide-button {
    pointer-events: auto; /* Restaura la interactividad para estos elementos */
}

.wp-block-gutenberg-test-hero .slide-button {
    position: relative;
    z-index: 4; /* Mayor que el z-index del contenido */
}

.wp-block-gutenberg-test-hero .slide-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.wp-block-gutenberg-test-hero .hero-slide-overlay-link {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: auto;
    width: 100%;
}

.hero-slide {
    position: relative;
    height: 80vh;
    min-height: 500px;
    max-height: 800px;
    width: 100%;
    overflow: hidden;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: all 0.3s ease;
}

.hero-slide .placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    color: #888;
    font-size: 1.5rem;
}

.slide-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 2rem;
    z-index: 2;
}

/* IMPORTANTE: Eliminar también este after que crea un overlay fijo */
.slide-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Eliminamos el background-color fijo */
    z-index: -1;
}

.slide-text {
    max-width: 800px;
    width: 100%;
    color: #fff;
    padding-left: 2rem;
}

.slide-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.slide-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.slide-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slide-button:hover {
    opacity: 0.9;
    transform: translateX(5px);
}

/* Quick Links */
.quick-links-wrapper {
    width: 100%;
    position: relative;
    z-index: 10;
    margin-top: -50px;
}

.quick-links-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.link-card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.link-card span {
    font-weight: 600;
    font-size: 1.125rem;
    color: #333;
}

/* Estilos para el modal avanzado de ajuste de imagen */
.image-adjust-modal-advanced .components-modal__content {
    padding: 20px;
    overflow: auto;
}

.image-adjustment-tabs {
    margin-bottom: 20px;
}

.image-adjustment-tabs .components-tab-panel__tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.image-adjustment-tabs .components-tab-panel__tabs-item {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    font-weight: 500;
}

.image-adjustment-tabs .active-tab {
    box-shadow: inset 0 -3px 0 0 var(--wp-admin-theme-color);
}

/* Estilos para el modo responsivo */
.responsive-view-controls {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}

.crop-controls, .text-position-preview {
    position: relative;
}

/* Estilos para el área de recorte */
.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: white;
    border: 2px solid red;
    border-radius: 50%;
}

.crop-handle-tl {
    top: -5px;
    left: -5px;
    cursor: nwse-resize;
}

.crop-handle-tr {
    top: -5px;
    right: -5px;
    cursor: nesw-resize;
}

.crop-handle-bl {
    bottom: -5px;
    left: -5px;
    cursor: nesw-resize;
}

.crop-handle-br {
    bottom: -5px;
    right: -5px;
    cursor: nwse-resize;
}

/* Modal de ajuste de imagen */
.image-adjust-modal .components-modal__content {
    padding: 20px;
}

.image-adjust-modal .image-adjust-preview {
    max-width: 100%;
}

/* Añadir escala de grises a la imagen durante la edición para mejor visibilidad */
.block-editor-block-list__block .hero-slide img {
    filter: brightness(0.8);
}

/* Responsive */
@media (max-width: 1024px) {
    .slide-title {
        font-size: 2.5rem;
    }
    
    .slide-description {
        font-size: 1.125rem;
    }
    
    .hero-slide {
        height: 70vh;
    }
}

@media (max-width: 768px) {
    .hero-slide {
        height: 60vh;
        min-height: 400px;
    }

    .slide-text {
        max-width: 100%;
        padding-left: 0;
    }

    .slide-title {
        font-size: 2rem;
    }

    .slide-description {
        font-size: 1rem;
    }

    .links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-links-wrapper {
        margin-top: -70px;
    }
}

@media (max-width: 480px) {
    .hero-slide {
        height: 50vh;
        min-height: 350px;
    }

    .slide-title {
        font-size: 1.75rem;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-links-wrapper {
        margin-top: -50px;
    }
}

/* BCNLip Language Theme Styles */
.theme-bcnlip-language .wp-block-gutenberg-test-hero .slide-content {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
}

.theme-bcnlip-language .wp-block-gutenberg-test-hero .slide-text {
    display: none;
}

/* Default Theme Styles */
.wp-block-gutenberg-test-hero .slide-text {
    max-width: var(--container-max-width);
    width: 100%;
    color: var(--color-white);
    padding-bottom: 100px;
    text-align: left;
    margin: 0 auto;
    padding-left: calc(var(--container-padding) + 25%); /* Reducido de 35% para mejor adaptación */
    padding-right: var(--container-padding);
}

.wp-block-gutenberg-test-hero .slide-text h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
    max-width: 700px;
    text-align: left;
}

.wp-block-gutenberg-test-hero .slide-text p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
    line-height: 1.6;
    max-width: 600px;
    text-align: left;
}

.wp-block-gutenberg-test-hero .slide-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(0);
    backdrop-filter: blur(4px);
    cursor: pointer;
    will-change: transform, opacity;
}

.wp-block-gutenberg-test-hero .slide-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Navigation */
.wp-block-gutenberg-test-hero .swiper-button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--color-white);
    transition: all 0.2s ease;
    margin-top: -20px;
    position: absolute;
    top: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border: none;
    box-shadow: none;
}

.wp-block-gutenberg-test-hero .swiper-button-disabled {
    opacity: 0.2;
    cursor: auto;
    pointer-events: none;
}

.wp-block-gutenberg-test-hero .swiper-button-prev {
    left: 20px;
}

.wp-block-gutenberg-test-hero .swiper-button-next {
    right: 20px;
}

.wp-block-gutenberg-test-hero .swiper-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Remove default Swiper arrow styles */
.wp-block-gutenberg-test-hero .swiper-button-prev::after,
.wp-block-gutenberg-test-hero .swiper-button-next::after {
    content: none;
}

/* Pagination */
.wp-block-gutenberg-test-hero .swiper-pagination {
    bottom: var(--spacing-lg) !important;
    z-index: 11;
    position: absolute;
}

.wp-block-gutenberg-test-hero .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0.7;
    transition: all 0.2s ease;
    margin: 0 4px;
}

.wp-block-gutenberg-test-hero .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.9);
}

/* Quick Links - Nuevo posicionamiento */
.wp-block-gutenberg-test-hero .quick-links-wrapper {
    position: relative; /* Cambiado de absolute a relative */
    margin-top: -65px; /* Movemos hacia arriba para superponerse */
    width: 100%;
    z-index: 20;
}

.wp-block-gutenberg-test-hero .quick-links-container {
    position: relative;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.wp-block-gutenberg-test-hero .links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
    margin: 0 auto;
    max-width: 1000px;
    position: relative;
    z-index: 21;
}

.wp-block-gutenberg-test-hero .link-card {
    background: var(--color-white);
    padding: var(--spacing-md);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    transform: translateY(0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    height: 130px;
    position: relative;
    z-index: 22;
    text-decoration: none;
    overflow: hidden;
    will-change: transform;
}

.wp-block-gutenberg-test-hero .link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Eliminamos reglas que alteran colores en hover */
.wp-block-gutenberg-test-hero .link-card[style*="background-color"]:hover {
    background-color: inherit;
}

.wp-block-gutenberg-test-hero .link-card i,
.wp-block-gutenberg-test-hero .link-card span {
    transition: none;
}

/* Eliminamos cambio de color en hover */
.wp-block-gutenberg-test-hero .link-card:hover i,
.wp-block-gutenberg-test-hero .link-card:hover span {
    color: inherit;
}

.wp-block-gutenberg-test-hero .link-card i {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.wp-block-gutenberg-test-hero .link-card span {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    line-height: 1.2;
    text-align: center;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2; /* Para compatibilidad con otros navegadores */
}

/* Responsive */
@media (max-width: 1200px) {
    .wp-block-gutenberg-test-hero .slide-text {
        padding-left: calc(var(--container-padding) + 15%);
    }
    
    .wp-block-gutenberg-test-hero .links-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
}

@media (max-width: 992px) {
    .wp-block-gutenberg-test-hero .hero-section {
        height: 60vh;
        min-height: 500px;
        padding-bottom: 100px;
    }
    
    .wp-block-gutenberg-test-hero .slide-text {
        padding-left: var(--container-padding);
        padding-bottom: 60px;
    }
    
    .wp-block-gutenberg-test-hero .slide-text h1 {
        max-width: 90%;
    }
    
    .wp-block-gutenberg-test-hero .slide-text p {
        max-width: 90%;
    }
    
    .wp-block-gutenberg-test-hero .links-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-sm);
    }

    .wp-block-gutenberg-test-hero .link-card {
        padding: var(--spacing-sm);
        height: 110px;
    }
    
    .wp-block-gutenberg-test-hero .swiper-button {
        width: 35px;
        height: 35px;
        margin-top: -17.5px;
        font-size: 1.1rem;
    }
    
    .wp-block-gutenberg-test-hero .swiper-button-prev {
        left: 15px;
    }
    
    .wp-block-gutenberg-test-hero .swiper-button-next {
        right: 15px;
    }
}

@media (max-width: 768px) {
    .wp-block-gutenberg-test-hero .hero-section {
        height: 50vh; /* Altura reducida en móvil */
        min-height: 400px; /* Altura mínima reducida */
        padding-bottom: 50px; /* Reducir padding inferior */
    }
    
    .wp-block-gutenberg-test-hero .swiper-slide img {
        /* Asegurar que la imagen cubra toda el área del slide */
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .wp-block-gutenberg-test-hero .slide-text h1 {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
    
    .wp-block-gutenberg-test-hero .slide-text p {
        font-size: clamp(0.9rem, 2vw, 1rem);
    }
    
    /* Ajustar posición de las tarjetas para que estén justo debajo del hero */
    .wp-block-gutenberg-test-hero .quick-links-wrapper {
        position: relative;
        margin-top: -40px; /* Ajustar para que se superponga un poco al hero */
        z-index: 30; /* Asegurar que esté por encima del hero */
    }
    
    .wp-block-gutenberg-test-hero .links-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .wp-block-gutenberg-test-hero .link-card {
        height: 100px;
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .wp-block-gutenberg-test-hero .hero-section {
        height: 40vh; /* Altura para móviles pequeños */
        min-height: 350px;
        padding-bottom: 20px;
        margin-bottom: 80px; /* Ajustar margen inferior */
    }
    
    .wp-block-gutenberg-test-hero .slide-text {
        text-align: center;
        padding: 0 var(--container-padding);
        width: 100%;
        align-items: center;
    }
    
    .wp-block-gutenberg-test-hero .slide-text h1, 
    .wp-block-gutenberg-test-hero .slide-text p {
        max-width: 100%;
        text-align: center;
    }

    .wp-block-gutenberg-test-hero .quick-links-wrapper {
        margin-top: -30px;
    }
    
    .wp-block-gutenberg-test-hero .links-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en móviles pequeños */
        max-width: 280px;
        margin: 0 auto;
    }

    .wp-block-gutenberg-test-hero .link-card {
        height: 90px;
        min-width: auto;
        padding: 8px;
    }
}

@media (max-width: 400px) {
    .wp-block-gutenberg-test-hero .hero-section {
        min-height: 300px;
        padding-bottom: 0;
        margin-bottom: 80px; /* Reducido para que las tarjetas estén más cerca */
    }
    
    .wp-block-gutenberg-test-hero .slide-text h1 {
        font-size: 1.5rem;
    }
    
    .wp-block-gutenberg-test-hero .slide-content {
        padding-bottom: var(--spacing-md);
    }
    
    /* En pantallas muy pequeñas, los enlaces van completamente debajo */
    .wp-block-gutenberg-test-hero .quick-links-wrapper {
        position: relative;
        margin-top: -20px; /* Reducir este valor para subir las tarjetas */
        margin-bottom: 30px;
    }
    
    .wp-block-gutenberg-test-hero .links-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Mantener 2 columnas */
        gap: 8px;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .wp-block-gutenberg-test-hero .link-card {
        width: 100%; /* Ancho completo de la columna */
        height: 80px;
        min-width: auto;
        padding: 6px;
    }
    
    .wp-block-gutenberg-test-hero .link-card i {
        font-size: 1.1rem;
    }
    
    .wp-block-gutenberg-test-hero .link-card span {
        font-size: 0.65rem;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .wp-block-gutenberg-test-hero .link-card:hover {
        transform: translateY(-2px);
    }
}