/**
 * Estilos Principales - Banners Interactivos (MU)
 * Compartido entre Frontend, Editor Gutenberg, Efectos Visuales, Modal Popup y Panel de Tutorial
 */

html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   1. ESTILOS FRONTEND DE BANNERS Y ÁREAS INTERACTIVAS
   ========================================================================== */

.mih-banner {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    line-height: 0;
}

.mih-banner__picture {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.mih-banner__image {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    margin: 0;
    padding: 0;
    object-fit: cover;
}

.mih-banner__areas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mih-area {
    position: absolute;
    display: block;
    pointer-events: auto;
    background-color: transparent;
    text-decoration: none;
    border: none;
    outline: none;
    z-index: 2;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 200ms ease, box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}

a.mih-area--cf7,
button.mih-area--cf7 {
    padding: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.mih-area:focus-visible {
    outline: 2px solid #2271b1 !important;
    outline-offset: -2px;
    background-color: rgba(34, 113, 177, 0.2);
    box-shadow: 0 0 8px rgba(34, 113, 177, 0.6);
}

/* ==========================================================================
   2. EFECTOS VISUALES CONFIGURABLES (HOVER / TOUCH)
   ========================================================================== */

.mih-effect-darken {
    position: absolute;
    overflow: hidden;
}
.mih-effect-darken::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 200ms ease;
    pointer-events: none;
    border-radius: inherit;
}
.mih-effect-darken:hover::after,
.mih-effect-darken:active::after,
.mih-effect-darken:focus-visible::after {
    background-color: rgba(0, 0, 0, 0.15);
}

.mih-effect-zoom {
    transition: transform 200ms ease, box-shadow 200ms ease;
    transform-origin: center center;
}
.mih-effect-zoom:hover,
.mih-effect-zoom:active,
.mih-effect-zoom:focus-visible {
    transform: scale(1.03);
    z-index: 5;
}

.mih-effect-border {
    box-sizing: border-box;
}
.mih-effect-border::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    transition: border-color 200ms ease, background-color 200ms ease;
    pointer-events: none;
    box-sizing: border-box;
    border-radius: inherit;
}
.mih-effect-border:hover::after,
.mih-effect-border:active::after,
.mih-effect-border:focus-visible::after {
    border-color: rgba(34, 113, 177, 0.6);
    background-color: rgba(34, 113, 177, 0.08);
}

.mih-effect-shadow {
    transition: box-shadow 200ms ease;
}
.mih-effect-shadow:hover,
.mih-effect-shadow:active,
.mih-effect-shadow:focus-visible {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    z-index: 5;
}

.mih-area--device-desktop { display: block; }
.mih-area--device-tablet { display: none; }
.mih-area--device-mobile { display: none; }

@media (max-width: 1024px) {
    .mih-area--device-desktop { display: none; }
    .mih-area--device-tablet { display: block; }
    .mih-area--device-mobile { display: none; }
}

@media (max-width: 767px) {
    .mih-area--device-desktop { display: none; }
    .mih-area--device-tablet { display: none; }
    .mih-area--device-mobile { display: block; }
}

@media (min-width: 1025px) {
    .mih-area.mih-hide-desktop { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .mih-area.mih-hide-tablet { display: none !important; }
}
@media (max-width: 767px) {
    .mih-area.mih-hide-mobile { display: none !important; }
}

.mih-banner--debug .mih-area {
    border: 2px dashed rgba(226, 0, 26, 0.85) !important;
    background-color: rgba(226, 0, 26, 0.15) !important;
}

/* ==========================================================================
   3. SISTEMA POPUP MODAL MOBILE FIRST (BOTTOM SHEET)
   ========================================================================== */

body.mih-modal-active {
    overflow: hidden !important;
    touch-action: none;
}

.mih-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 200ms ease, visibility 200ms ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.mih-modal--open {
    visibility: visible;
    opacity: 1;
}

.mih-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.mih-modal__container {
    position: relative;
    z-index: 2;
    width: calc(100% - 16px);
    max-width: 100%;
    height: 93vh;
    max-height: 93vh;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: env(safe-area-inset-bottom, 16px);
    box-sizing: border-box;
    overflow: hidden;
}

.mih-modal--open .mih-modal__container {
    transform: translateY(0);
}

.mih-modal__handle {
    width: 36px;
    height: 4px;
    background: #dcdcde;
    border-radius: 2px;
    margin: 8px auto 4px auto;
    flex-shrink: 0;
}

.mih-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 12px 16px;
    border-bottom: 1px solid #f0f0f1;
    flex-shrink: 0;
}

.mih-modal__title {
    margin: 0;
    font-size: 1.15em;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
}

.mih-modal__close {
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #646970;
    cursor: pointer;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -8px -8px -8px 0;
    padding: 0;
    border-radius: 50%;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mih-modal__close:hover,
.mih-modal__close:focus {
    background-color: #f0f0f1;
    color: #1d2327;
    outline: none;
}

.mih-modal__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 24px 20px;
}

.mih-modal__body .wpcf7 {
    margin: 0;
    padding: 0;
}

.mih-modal__body .wpcf7 form p {
    margin-bottom: 14px;
}

.mih-modal__body .wpcf7 label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #2c3338;
}

.mih-modal__body .wpcf7 input[type="text"],
.mih-modal__body .wpcf7 input[type="email"],
.mih-modal__body .wpcf7 input[type="tel"],
.mih-modal__body .wpcf7 input[type="url"],
.mih-modal__body .wpcf7 input[type="number"],
.mih-modal__body .wpcf7 select,
.mih-modal__body .wpcf7 textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #8c8c8c;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.mih-modal__body .wpcf7 input[type="submit"] {
    background-color: #2271b1;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.15s ease;
}

.mih-modal__body .wpcf7 input[type="submit"]:hover {
    background-color: #135e96;
}

.mih-modal__body .wpcf7-response-output {
    margin: 16px 0 0 0 !important;
    padding: 12px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

.mih-modal__body .wpcf7-spinner ~ .wpcf7-spinner,
.mih-modal__body .ajax-loader ~ .ajax-loader {
    display: none !important;
}

@media (min-width: 768px) {
    .mih-modal {
        align-items: center;
    }

    .mih-modal__container {
        width: 650px;
        max-width: 90vw;
        height: auto;
        max-height: 85vh;
        border-radius: 12px;
        margin: auto;
        transform: scale(0.95);
        transition: transform 200ms ease;
        padding-bottom: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .mih-modal--open .mih-modal__container {
        transform: scale(1);
    }

    .mih-modal__handle {
        display: none;
    }

    .mih-modal__header {
        padding: 16px 20px;
    }

    .mih-modal__body {
        padding: 20px 24px 28px 24px;
    }
}

/* ==========================================================================
   4. ESTILOS DEL EDITOR GUTENBERG (BARRA DE HERRAMIENTAS EN FONDO NEGRO)
   ========================================================================== */

.mih-block-editor-wrapper {
    width: 100%;
}

.mih-editor-placeholder {
    padding: 40px 20px;
    background: #f0f0f1;
    border: 2px dashed #c3c4c7;
    border-radius: 4px;
    text-align: center;
}

.mih-editor-placeholder__content svg {
    fill: #1e1e1e;
    margin-bottom: 12px;
}

.mih-editor-workspace {
    background: #ffffff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 12px;
}

.mih-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f6f7f7;
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.mih-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mih-toolbar-label {
    font-weight: 600;
    font-size: 13px;
    color: #111111;
}

/* BOTONES CON FONDO NEGRO Y TEXTO BLANCO EN ALTO CONTRASTE */
.mih-editor-toolbar .components-button {
    color: #ffffff !important;
    background-color: #23211f !important;
    border: 1px solid #23211f !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    height: 34px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

.mih-editor-toolbar .components-button * {
    color: #ffffff !important;
}

.mih-editor-toolbar .components-button:hover {
    background-color: #383533 !important;
    color: #ffffff !important;
    border-color: #383533 !important;
}

/* BOTÓN ACTIVO (AZUL DESTACADO) */
.mih-editor-toolbar .components-button.is-primary {
    color: #ffffff !important;
    background-color: #2271b1 !important;
    border-color: #2271b1 !important;
}

.mih-editor-toolbar .components-button.is-primary:hover {
    background-color: #135e96 !important;
    color: #ffffff !important;
}

/* BOTÓN INACTIVO (NEGRO ELEGANTE) */
.mih-editor-toolbar .components-button.is-secondary {
    color: #ffffff !important;
    background-color: #23211f !important;
    border-color: #23211f !important;
}

.mih-editor-toolbar .components-button.is-secondary:hover {
    background-color: #383533 !important;
    color: #ffffff !important;
}

/* BOTÓN ELIMINAR (ROJO) */
.mih-editor-toolbar .components-button.is-destructive {
    color: #ffffff !important;
    background-color: #d94f4f !important;
    border-color: #d94f4f !important;
}

.mih-editor-toolbar .components-button.is-destructive:hover {
    background-color: #b32d2d !important;
    color: #ffffff !important;
}

.mih-editor-canvas,
.mih-editor-image,
.mih-editor-area,
.mih-editor-handle {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.mih-editor-canvas {
    position: relative;
    width: 100%;
    line-height: 0;
    overflow: hidden;
    background: #e0e0e0;
    border: 1px solid #c3c4c7;
    cursor: crosshair;
}

.mih-editor-canvas--drawing {
    cursor: crosshair !important;
}

.mih-editor-image {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

.mih-editor-area {
    position: absolute;
    border: 2px solid #2271b1;
    background-color: rgba(34, 113, 177, 0.25);
    box-sizing: border-box;
    cursor: move;
    z-index: 5;
}

.mih-editor-area--selected {
    border: 2px solid #d63ba3 !important;
    background-color: rgba(214, 59, 163, 0.3) !important;
    z-index: 10;
}

.mih-editor-area--drawing {
    border: 2px dashed #00a8e2;
    background-color: rgba(0, 168, 226, 0.3);
    pointer-events: none;
}

.mih-editor-area-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: #1e1e1e;
    color: #ffffff;
    font-size: 10px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 2px;
    pointer-events: none;
    white-space: nowrap;
}

.mih-editor-area-toolbar {
    position: absolute;
    top: -30px;
    right: 0;
    display: flex;
    gap: 4px;
    background: #111111;
    padding: 2px 4px;
    border-radius: 3px;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.mih-area-tool-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.15s ease;
}

.mih-area-tool-btn:hover {
    background: #2271b1;
}

.mih-area-tool-btn--danger:hover {
    background: #d94f4f;
}

.mih-area-tool-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.mih-editor-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border: 1px solid #1e1e1e;
    border-radius: 50%;
    z-index: 12;
}

.mih-handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.mih-handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.mih-handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.mih-handle-se { bottom: -5px; right: -5px; cursor: nwse-resize; }

.mih-inspector-media {
    width: 100%;
    margin-bottom: 10px;
}

.mih-button-full {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.mih-inspector-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #dcdcde;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==========================================================================
   5. ESTILOS DE LA PÁGINA DE TUTORIAL Y ESTADÍSTICAS (ADMINISTRACIÓN)
   ========================================================================== */

.mih-tutorial-wrap {
    max-width: 1100px;
    margin: 20px auto 40px auto;
}

.mih-tutorial-header {
    margin-bottom: 15px;
}

.mih-tutorial-card {
    background: #ffffff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.mih-tutorial-card h2 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 1.3em;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mih-tutorial-card h2 .dashicons {
    color: #2271b1;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.mih-tutorial-toc {
    background: #f6f7f7;
    border-left: 4px solid #2271b1;
}

.mih-toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin-top: 15px;
    padding-left: 0;
    list-style: none;
}

.mih-toc-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    text-decoration: none;
    color: #2271b1;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.mih-toc-list a:hover {
    background: #2271b1;
    color: #ffffff;
    border-color: #2271b1;
}

.mih-toc-list a:hover .dashicons {
    color: #ffffff;
}

.mih-ui-badge {
    display: inline-block;
    background: #e0e0e0;
    color: #1d2327;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #c3c4c7;
}

.mih-box-info, .mih-box-warning, .mih-box-success, .mih-step-box {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.5;
}

.mih-box-info {
    background: #f0f6fc;
    border-left: 4px solid #72aee6;
    color: #0c4a6e;
}

.mih-box-warning {
    background: #fcf0f0;
    border-left: 4px solid #d94f4f;
    color: #610404;
}

.mih-box-success {
    background: #f0fdf4;
    border-left: 4px solid #00a8e2;
    color: #0f5132;
}

.mih-step-box {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
}

.mih-faq-item {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #dcdcde;
}

.mih-faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mih-faq-item h4 {
    margin: 0 0 6px 0;
    font-size: 1.05em;
    color: #1d2327;
}

.mih-tutorial-section-anchor {
    scroll-margin-top: 40px;
}