/**
 * Estilos para el bloque Course Hero Component (frontend)
 */

/* Estilos generales del bloque */
.course-hero-component {
    padding: 4rem 0;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: var(--background-color, #f8f9fa);
}

/* Ancho completo cuando tiene alignfull */
.course-hero-component.alignfull {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* Contenedor mejorado para ancho completo */
.course-hero-component.alignfull .container {
    max-width: none;
    padding: 0 2rem;
}

/* Layout mejorado para distribución de contenido */
.course-hero-component .hero-content {
    gap: 2rem;
}

.course-hero-component.alignfull .hero-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Flexibilidad mejorada para elementos */
.course-hero-component .hero-text-content,
.course-hero-component .hero-form {
    flex-basis: auto;
}

/* Responsividad mejorada */
@media (min-width: 1200px) {
    .course-hero-component.alignfull .hero-content {
        gap: 4rem;
    }
}

@media (min-width: 1400px) {
    .course-hero-component.alignfull .hero-content {
        gap: 5rem;
    }
}

/* Contenedor principal del hero */
.course-hero-component .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Estructura del contenido hero */
.course-hero-component .hero-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Contenedor de media del hero (imagen o video) */
.course-hero-component .hero-media-container {
    flex: 0 0 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 500px;
    max-width: 500px;
    min-width: 300px;
    height: auto;
}

.course-hero-component .hero-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: block;
}

.course-hero-component .hero-image:hover {
    transform: translateY(-5px);
}

/* Estilos específicos para video - EXACTAMENTE IGUALES A LA IMAGEN */
.course-hero-component .hero-video-wrapper {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: block;
}

.course-hero-component .hero-video,
.course-hero-component .hero-video-iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px;
    border: none;
    display: block;
}

.course-hero-component .hero-video-wrapper:hover {
    transform: translateY(-5px);
}

/* Zona de texto */
.course-hero-component .hero-text {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

/* Encabezados */
.course-hero-component h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--text-color, #333333);
}

.course-hero-component .hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    color: var(--text-color, #333333);
}

/* Subtitle alignment styles */
.course-hero-component .hero-subtitle.align-left {
    text-align: left;
}

.course-hero-component .hero-subtitle.align-center {
    text-align: center;
}

.course-hero-component .hero-subtitle.align-right {
    text-align: right;
}

.course-hero-component .hero-subtitle.align-custom {
    /* Custom offset will be applied via inline styles */
}

/* Lista de puntos destacados */
.course-hero-component .hero-summary-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.course-hero-component .hero-summary-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    gap: 0.75rem;
}

.course-hero-component .hero-summary-list .summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background-color: var(--button-color, #f6b93b);
    color: var(--button-text-color, #1a235c);
    border-radius: 50%;
    flex-shrink: 0;
}

.course-hero-component .hero-summary-list li div {
    flex: 1;
}

.course-hero-component .hero-summary-list strong {
    font-weight: 600;
}

/* Botón CTA */
.course-hero-component .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: 1.5rem;
}

.course-hero-component .btn-primary {
    background-color: var(--button-color, #f6b93b);
    color: var(--button-text-color, #1a235c);
}

.course-hero-component .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
}

/* Formulario */
.course-hero-component .hero-form {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.course-hero-component .form-container {
    background-color: var(--form-background-color, #ffffff);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.course-hero-component .form-container h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.course-hero-component .form-group {
    margin-bottom: 1rem;
}

.course-hero-component .form-group input,
.course-hero-component .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
    max-width: 100%;
}

.course-hero-component .form-group select {
    appearance: none;
}

.course-hero-component .btn-secondary {
    width: 100%;
    background-color: var(--form-button-color, #1a235c);
    color: var(--form-button-text-color, #ffffff);
    margin-top: 1rem;
    box-sizing: border-box;
}

.course-hero-component .btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.course-hero-component .form-note {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    overflow-wrap: break-word;
}

/* Estilos para la integración con WPForms */
.course-hero-component .wpforms-form input[type=text],
.course-hero-component .wpforms-form input[type=email],
.course-hero-component .wpforms-form select {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 0.9rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.course-hero-component .wpforms-form .wpforms-submit-container {
    text-align: center !important;
}

.course-hero-component .wpforms-form button[type=submit] {
    width: 100% !important;
    background-color: var(--form-button-color, #1a235c) !important;
    color: var(--form-button-text-color, #ffffff) !important;
    margin-top: 1rem !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.course-hero-component .wpforms-form button[type=submit]:hover {
    opacity: 0.9 !important;
    transform: translateY(-2px) !important;
}

/* Mensajes informativos para el editor */
.course-hero-component .wpforms-preview {
    text-align: center;
}

.course-hero-component .wpforms-notice {
    margin-bottom: 1rem;
    font-style: italic;
}

.course-hero-component .example-form {
    opacity: 0.7;
}

.course-hero-component .wpforms-placeholder {
    text-align: center;
    padding: 1.5rem;
    background-color: #f7f7f7;
    border-radius: 4px;
    border: 1px dashed #ccc;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

/* Responsive mejorado */
@media (max-width: 1023px) {
    .course-hero-component {
        padding: 2rem 0; /* Reducir padding vertical */
        overflow-x: hidden; /* Evitar scroll horizontal */
        word-wrap: break-word; /* Romper palabras largas solo en responsive */
    }
    
    .course-hero-component .container {
        padding: 0 1rem; /* Reducir padding lateral */
        box-sizing: border-box;
    }
    
    .course-hero-component .hero-content {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        text-align: center;
        width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .course-hero-component .hero-text,
    .course-hero-component .hero-form {
        max-width: 100%;
        width: 100%;
        margin-bottom: 1rem;
        text-align: center;
        min-width: unset; /* Remover min-width fijo */
        overflow: hidden;
        word-wrap: break-word;
        box-sizing: border-box;
    }

    .course-hero-component .hero-media-container {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        margin: 0 auto 1rem auto;
        order: -1; /* Mostrar media primero */
    }
    
    /* Imagen y video mejorados para tablet */
    .course-hero-component .hero-image,
    .course-hero-component .hero-video-wrapper {
        width: 70%;
        max-width: 70%;
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        display: block;
        margin: 0 auto;
        border-radius: 8px;
    }
    
    .course-hero-component .hero-video,
    .course-hero-component .hero-video-iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        border-radius: 8px;
    }
    
    /* Variaciones de ancho para tablet - IMAGEN Y VIDEO */
    .course-hero-component[data-tablet-image-width="full"] .hero-image,
    .course-hero-component[data-tablet-image-width="full"] .hero-video-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .course-hero-component[data-tablet-image-width="large"] .hero-image,
    .course-hero-component[data-tablet-image-width="large"] .hero-video-wrapper {
        width: 85% !important;
        max-width: 85% !important;
    }
    
    .course-hero-component[data-tablet-image-width="medium"] .hero-image,
    .course-hero-component[data-tablet-image-width="medium"] .hero-video-wrapper {
        width: 70% !important;
        max-width: 70% !important;
    }
    
    .course-hero-component[data-tablet-image-width="small"] .hero-image,
    .course-hero-component[data-tablet-image-width="small"] .hero-video-wrapper {
        width: 50% !important;
        max-width: 50% !important;
    }
    
    /* Variaciones de altura para tablet - IMAGEN Y VIDEO */
    .course-hero-component[data-tablet-image-height="auto"] .hero-image,
    .course-hero-component[data-tablet-image-height="auto"] .hero-video-wrapper,
    .course-hero-component[data-tablet-image-height="auto"] .hero-video,
    .course-hero-component[data-tablet-image-height="auto"] .hero-video-iframe {
        aspect-ratio: auto !important;
        height: auto !important;
    }
    
    .course-hero-component[data-tablet-image-height="small"] .hero-image,
    .course-hero-component[data-tablet-image-height="small"] .hero-video-wrapper,
    .course-hero-component[data-tablet-image-height="small"] .hero-video,
    .course-hero-component[data-tablet-image-height="small"] .hero-video-iframe {
        aspect-ratio: 2/1 !important;
    }
    
    .course-hero-component[data-tablet-image-height="medium"] .hero-image,
    .course-hero-component[data-tablet-image-height="medium"] .hero-video-wrapper,
    .course-hero-component[data-tablet-image-height="medium"] .hero-video,
    .course-hero-component[data-tablet-image-height="medium"] .hero-video-iframe {
        aspect-ratio: 16/9 !important;
    }
    
    .course-hero-component[data-tablet-image-height="large"] .hero-image,
    .course-hero-component[data-tablet-image-height="large"] .hero-video-wrapper,
    .course-hero-component[data-tablet-image-height="large"] .hero-video,
    .course-hero-component[data-tablet-image-height="large"] .hero-video-iframe {
        aspect-ratio: 4/3 !important;
    }
    
    /* Aplicar text-wrapping solo en responsive */
    .course-hero-component h1 {
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .course-hero-component .hero-subtitle {
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .course-hero-component .hero-summary-list {
        width: 100%;
        box-sizing: border-box;
    }
    
    .course-hero-component .hero-summary-list li {
        width: 100%;
        overflow: hidden;
        word-wrap: break-word;
    }
    
    .course-hero-component .hero-summary-list .summary-icon {
        min-width: 30px; /* Evitar que se reduzca en responsive */
    }
    
    .course-hero-component .hero-summary-list li div {
        overflow: hidden;
        word-wrap: break-word;
    }
    
    .course-hero-component .hero-summary-list strong {
        overflow-wrap: break-word;
    }
    
    .course-hero-component .btn {
        min-width: 180px;
        box-sizing: border-box;
        overflow-wrap: break-word;
    }
    
    .course-hero-component .form-container {
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .course-hero-component .form-container h3 {
        overflow-wrap: break-word;
    }
    
    .course-hero-component h1 {
        font-size: 2rem; /* Reducir tamaño pero mantener legible */
        margin-bottom: 0.8rem;
        text-align: center;
        line-height: 1.3;
    }
    
    .course-hero-component .hero-subtitle {
        font-size: 1.15rem;
        margin-bottom: 1.2rem;
        text-align: center;
        line-height: 1.4;
    }
    
    .course-hero-component .hero-summary-list {
        text-align: left;
        max-width: 100%;
        margin: 1.5rem auto;
    }
    
    .course-hero-component .hero-summary-list li {
        justify-content: flex-start;
        margin-bottom: 1rem;
    }
    
    .course-hero-component .btn {
        width: auto;
        max-width: 100%;
        margin: 1rem auto;
        display: block;
        padding: 1rem 2rem;
    }
    
    .course-hero-component .form-container {
        padding: 1.5rem;
    }
}

@media (max-width: 767px) {
    .course-hero-component {
        padding: 1.5rem 0;
        overflow-x: hidden;
        word-wrap: break-word;
    }
    
    .course-hero-component .container {
        padding: 0 0.75rem;
        box-sizing: border-box;
    }
    
    .course-hero-component .hero-content {
        gap: 1rem;
        overflow: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    
    .course-hero-component .hero-text,
    .course-hero-component .hero-form {
        overflow: hidden;
        word-wrap: break-word;
        box-sizing: border-box;
    }
    
    .course-hero-component h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }
    
    .course-hero-component .hero-subtitle {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    .course-hero-component .hero-media-container {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Imagen y video responsive mejorados para móvil */
    .course-hero-component .hero-image,
    .course-hero-component .hero-video-wrapper {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        display: block;
        margin: 0 auto;
        border-radius: 8px;
    }
    
    .course-hero-component .hero-video,
    .course-hero-component .hero-video-iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        border-radius: 8px;
    }
    
    /* Variaciones de ancho para móvil - IMAGEN Y VIDEO */
    .course-hero-component[data-mobile-image-width="full"] .hero-image,
    .course-hero-component[data-mobile-image-width="full"] .hero-video-wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    .course-hero-component[data-mobile-image-width="large"] .hero-image,
    .course-hero-component[data-mobile-image-width="large"] .hero-video-wrapper {
        width: 90%;
        max-width: 90%;
    }
    
    .course-hero-component[data-mobile-image-width="medium"] .hero-image,
    .course-hero-component[data-mobile-image-width="medium"] .hero-video-wrapper {
        width: 80%;
        max-width: 80%;
    }
    
    .course-hero-component[data-mobile-image-width="small"] .hero-image,
    .course-hero-component[data-mobile-image-width="small"] .hero-video-wrapper {
        width: 60%;
        max-width: 60%;
    }
    
    /* Variaciones de altura para móvil - IMAGEN Y VIDEO */
    .course-hero-component[data-mobile-image-height="auto"] .hero-image,
    .course-hero-component[data-mobile-image-height="auto"] .hero-video-wrapper,
    .course-hero-component[data-mobile-image-height="auto"] .hero-video,
    .course-hero-component[data-mobile-image-height="auto"] .hero-video-iframe {
        aspect-ratio: auto !important;
        height: auto !important;
    }
    
    .course-hero-component[data-mobile-image-height="small"] .hero-image,
    .course-hero-component[data-mobile-image-height="small"] .hero-video-wrapper,
    .course-hero-component[data-mobile-image-height="small"] .hero-video,
    .course-hero-component[data-mobile-image-height="small"] .hero-video-iframe {
        aspect-ratio: 2/1 !important;
    }
    
    .course-hero-component[data-mobile-image-height="medium"] .hero-image,
    .course-hero-component[data-mobile-image-height="medium"] .hero-video-wrapper,
    .course-hero-component[data-mobile-image-height="medium"] .hero-video,
    .course-hero-component[data-mobile-image-height="medium"] .hero-video-iframe {
        aspect-ratio: 16/9 !important;
    }
    
    .course-hero-component[data-mobile-image-height="large"] .hero-image,
    .course-hero-component[data-mobile-image-height="large"] .hero-video-wrapper,
    .course-hero-component[data-mobile-image-height="large"] .hero-video,
    .course-hero-component[data-mobile-image-height="large"] .hero-video-iframe {
        aspect-ratio: 4/3 !important;
    }
    
    /* Posicionamiento de imagen en móvil */
    .course-hero-component[data-mobile-image-behavior="above"] .hero-content {
        flex-direction: column !important;
    }
    
    .course-hero-component[data-mobile-image-behavior="above"] .hero-media-container {
        order: -1 !important;
        margin-bottom: 1.5rem !important;
        margin-top: 0 !important;
    }
    
    .course-hero-component[data-mobile-image-behavior="below"] .hero-content {
        flex-direction: column !important;
    }
    
    .course-hero-component[data-mobile-image-behavior="below"] .hero-media-container {
        order: 999 !important;
        margin-top: 1.5rem !important;
        margin-bottom: 0 !important;
    }
    
    .course-hero-component[data-mobile-image-behavior="hidden"] .hero-media-container {
        display: none !important;
    }
    
    .course-hero-component .form-container {
        padding: 1.2rem;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .course-hero-component .hero-summary-list .summary-icon {
        width: 25px;
        height: 25px;
        min-width: 25px;
        font-size: 0.8rem;
    }
    
    .course-hero-component .hero-summary-list {
        margin: 1rem 0;
    }
    
    .course-hero-component .hero-summary-list li {
        margin-bottom: 0.8rem;
        gap: 0.5rem;
    }
    
    .course-hero-component .btn {
        font-size: 0.95rem;
        padding: 0.8rem 1.5rem;
        min-width: unset;
        width: auto;
        max-width: 100%;
    }
}

/* Ajustes específicos para pantallas muy pequeñas */
@media (max-width: 480px) {
    .course-hero-component {
        padding: 1rem 0;
        overflow-x: hidden;
        word-wrap: break-word;
    }
    
    .course-hero-component .container {
        padding: 0 0.5rem;
        box-sizing: border-box;
    }
    
    .course-hero-component .hero-content {
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .course-hero-component .hero-text,
    .course-hero-component .hero-form {
        overflow: hidden;
        word-wrap: break-word;
        box-sizing: border-box;
    }
    
    .course-hero-component h1 {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .course-hero-component .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .course-hero-component .hero-image,
    .course-hero-component .hero-video-wrapper {
        width: 60%;
        max-width: 60%;
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        display: block;
        margin: 0 auto;
        border-radius: 8px;
    }
    
    .course-hero-component .hero-video,
    .course-hero-component .hero-video-iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .course-hero-component .form-container {
        padding: 1rem;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .course-hero-component .btn {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }
    
    .course-hero-component .hero-summary-list .summary-icon {
        width: 22px;
        height: 22px;
        min-width: 22px;
        font-size: 0.7rem;
    }
}

/* Mantener estilos de escritorio intactos para pantallas grandes */
@media (min-width: 1024px) {
    .course-hero-component .hero-content {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
        text-align: left;
    }
    
    .course-hero-component .hero-text {
        text-align: left;
    }
    
    .course-hero-component h1,
    .course-hero-component .hero-subtitle {
        text-align: left;
    }
    
    .course-hero-component .hero-media-container {
        order: initial; /* Restablecer orden en desktop */
    }
}
