/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Body general */
body {
  background-color: #f5f5f7;
  color: #1d1d1f;
}

/* --- Estilos para el Header (tomados de directorio.css para consistencia) --- */
.directorio-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e5ea; /* Borde más limpio y profesional */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.directorio-header .header-content {
    max-width: 1280px; /* Coincide con el .container para alineación perfecta */
    margin: 0 auto;
    padding: 10px 15px; /* Padding mínimo solo para evitar que toquen los bordes */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* En pantallas grandes, reducir padding para acercar elementos a los extremos */
@media (min-width: 1280px) {
    .directorio-header .header-content {
        padding: 10px 10px; /* Padding aún más reducido en pantallas grandes */
    }
    
    .directorio-header .header-left {
        margin-left: -5px; /* Acercar más al borde izquierdo */
    }
    
    .directorio-header .header-right {
        margin-right: -5px; /* Acercar más al borde derecho */
    }
}

.directorio-header .logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
}

.directorio-header .logo {
    height: 35px;
    width: auto;
    vertical-align: middle;
    display: block;
}

.directorio-header .logo-text {
    color: #007aff;
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
}

.directorio-header .main-nav {
    display: flex;
    gap: 25px;
}

/* Estos estilos se sobrescriben en emprendedores.css para páginas que no sean index */
.directorio-header .main-nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s ease;
}

.directorio-header .main-nav a:hover {
    color: #007aff;
}

/* Prevenir que los estilos de dashboard.css interfieran con el header nuevo */
body:not(.page-index) #main-header .main-nav a {
    color: #333 !important;
}

body:not(.page-index) #main-header .main-nav a:hover {
    color: #007aff !important;
}

body:not(.page-index) #main-header .main-nav a:visited {
    color: #333 !important;
}

.directorio-header .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative; /* Clave para posicionar el menú desplegable */
    flex-shrink: 0;
    margin-right: 0; /* Asegurar que esté pegado al borde derecho */
}

.directorio-header .boton-plan {
    background-color: #007aff;
    color: white;
    padding: 9px 18px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    margin-right: -8px; /* Compensar padding para acercar al borde */
    white-space: nowrap; /* Evitar que el texto se parta */
}

.directorio-header .boton-plan:hover {
    background-color: #005bb5;
}

.directorio-header .perfil-usuario {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9e9eb;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    margin-right: -8px; /* Compensar padding para acercar al borde */
    flex-shrink: 0;
}

/* Estilo para la imagen del logo dentro del perfil de usuario */
.directorio-header .perfil-usuario img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra el círculo sin deformarse */
    border-radius: 50%; /* Mantiene la forma circular */
}
.menu-perfil-desplegable {
    display: none;
    position: absolute;
    top: 55px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 8px;
    width: 220px;
    z-index: 1001;
}

.menu-perfil-desplegable.active {
    display: block;
}

.menu-perfil-desplegable a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.menu-perfil-desplegable a:hover {
    background-color: #f5f5f7;
}

.info-perfil {
    padding: 10px 15px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
    color: #555;
}

/* --- Estilos para el Header del Dashboard (Hamburguesa y Menú Lateral) --- */
.directorio-header .header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    margin-left: 0; /* Asegurar que esté pegado al borde izquierdo */
}

.menu-hamburguesa {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    padding: 5px 8px;
    margin-left: -8px; /* Compensar padding para acercar al borde */
    line-height: 1;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.menu-hamburguesa:hover {
    color: #007aff;
    background-color: #f5f5f7;
}

.menu-lateral {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100%;
    background-color: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-in-out;
    transform: translateX(-100%); /* Inicia fuera de la pantalla */
    z-index: 1002; /* Por encima del overlay */
    display: flex;
    flex-direction: column;
}

.menu-lateral.active {
    transform: translateX(0); /* Se desliza a la vista */
}

.menu-lateral-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e5ea;
}

.menu-lateral-header h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.menu-cerrar {
    background: none;
    border: none;
    font-size: 32px;
    font-weight: 300;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-lateral a {
    display: block;
    padding: 15px 25px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.menu-lateral a:hover {
    background-color: #f5f5f7;
    color: #007aff;
}
/* --- Estilos para la estructura principal --- */

.container {
    max-width: 1280px;
    margin: 40px auto;
    padding: 0 15px; /* Reducido para alinear con el header */
}

.dashboard-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center; /* Centra el contenido del wizard */
}

.panel-lateral {
    flex: 0 0 300px;
    position: sticky;
    top: 100px; /* Ajustar según altura del header */
}

.panel-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.panel-card h4 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 15px;
}

.panel-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}


.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: #E5E5EA;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007AFF 0%, #0051D5 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 122, 255, 0.3);
}

.progress-text {
    font-size: 13px;
    font-weight: 500;
    color: #8E8E93;
    margin-bottom: 20px;
    letter-spacing: -0.1px;
}

/* --- Estilos para el Asistente (Wizard) --- */

.ficha-content {
    flex-grow: 1;
    max-width: 900px; /* Aumenta el ancho máximo */
}

/* Override para tablet - debe estar después de la definición base */
@media (min-width: 769px) and (max-width: 1024px) {
    body.page-dashboard .ficha-content,
    body.page-dashboard div.ficha-content,
    body.page-dashboard #ficha-form-content {
        max-width: none !important;
    }
}

.seccion-titulo {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    color: #1d1d1f;
}

.step-indicator-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto 48px auto;
    position: relative;
    width: 85%;
    max-width: 420px;
    padding: 0 20px;
}
.step-indicator-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #E5E5EA 0%, #E5E5EA 100%);
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 2px;
}
.step-indicator-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #007AFF 0%, #34C759 100%);
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}
.step-indicator-container[data-progress="33"]::after { width: 50%; }
.step-indicator-container[data-progress="66"]::after { width: 100%; }
.step-indicator {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #FFFFFF;
    border: 3px solid #E5E5EA;
    color: #8E8E93;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    position: relative;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.step-indicator.active {
    background-color: #007AFF;
    border-color: #007AFF;
    color: #FFFFFF;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}
.step-indicator.completed {
    background-color: #34C759;
    border-color: #34C759;
    color: transparent;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}
.step-indicator.completed::before {
    content: '✓';
    color: #FFFFFF;
    font-size: 22px;
    font-weight: bold;
    position: absolute;
    line-height: 1;
}

.ficha-form {
    padding: 48px;
    background: #FFFFFF;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
}

.form-step {
    display: none;
    animation: fadeIn 0.5s;
}
.form-step.active-step {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #E5E5EA;
    text-align: center;
    color: #1C1C1E;
    letter-spacing: -0.3px;
}

/* --- Estilos de Formulario --- */

.ficha-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14.5px;
    color: #333;
}

.ficha-form input:not([type="file"]),
.ficha-form select,
.ficha-form textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #d1d1d6;
    margin-bottom: 20px;
    font-size: 15px;
    background-color: #f9f9f9;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ficha-form input:not([type="file"]):focus,
.ficha-form select:focus,
.ficha-form textarea:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
    background-color: #fff;
}

.row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.campo-doble {
    flex: 1;
    min-width: 250px;
}
.row input {
    margin-bottom: 0;
}

/* Logo Editor */
.logo-editor {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}
.logo-preview-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    overflow: hidden;
    border: 4px solid #fff;
}
#logo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.logo-edit-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    background-color: rgba(29, 29, 31, 0.75);
    backdrop-filter: blur(5px);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
}
.logo-preview-container:hover .logo-edit-icon {
    opacity: 1;
}
#logo-input {
    display: none;
}

/* Categorías y Servicios */
.categorias-seleccionadas-container {
    margin-top: 10px;
    margin-bottom: 20px;
    min-height: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.categoria-burbuja {
    display: flex;
    align-items: center;
    background-color: #e0f0ff;
    color: #005bb5;
    border-radius: 50px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
}
.remove-burbuja {
    margin-left: 8px;
    font-weight: bold;
    cursor: pointer;
    color: #005bb5;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-burbuja:hover {
    opacity: 1;
}

.dynamic-item-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.dynamic-item-container input {
    flex-grow: 1;
    margin-bottom: 0;
}
.delete-item-btn {
    background: #f5f5f7;
    border: 1px solid #e5e5ea;
    color: #555;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
}
.delete-item-btn:hover {
    background-color: #ff3b30;
    color: white;
    border-color: #ff3b30;
}

.boton-agregar-servicio, .boton-agregar-contacto {
    display: block;
    margin: 10px auto;
    background-color: #e9e9eb;
    color: #333;
    font-size: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.boton-agregar-servicio:hover, .boton-agregar-contacto:hover {
    background-color: #d1d1d6;
    transform: scale(1.05);
}

/* Contacto Administrativo */
.contacto-group {
    background-color: #fdfdfd;
    border: 1px solid #e9e9eb;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}
.contacto-group .delete-item-btn {
    position: absolute;
    top: 15px;
    right: 15px;
}
.contacto-group label {
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

/* Botones de Navegación */
.botones-navegacion {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
    border-top: 1px solid #e5e5e5;
    padding-top: 30px;
}
.volver-btn, .guardar-btn {
    border-radius: 50px !important;
    flex-grow: 1;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.volver-btn {
    background-color: #e5e5ea;
    color: #1d1d1f;
}
.volver-btn:hover {
    background-color: #d1d1d6;
}
.guardar-btn {
    background-color: #007aff;
    color: #fff;
}
.guardar-btn:hover {
    background-color: #005bb5;
}

.error {
    border-color: red !important;
    
}

/* Alertas */
.mensaje-alerta {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
    background-color: #E6F7E9;
    color: #2E7D32;
    border: 1px solid rgba(46, 125, 50, 0.3);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
    animation: slideInDown 0.3s ease-out;
}
.mensaje-alerta.error {
    background-color: #FFEBEE;
    color: #C62828;
    border-color: rgba(198, 40, 40, 0.3);
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.1);
}
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive - Solo móvil */
@media (max-width: 768px) {
    .dashboard-content {
        flex-direction: column;
    }
    .panel-lateral {
        position: static;
        width: 100%;
    }
    .ficha-form {
        padding: 25px;
    }
    .row {
        gap: 0;
    }
    .campo-doble {
        min-width: 100%;
        margin-bottom: 20px;
    }
    .botones-navegacion {
        flex-direction: column-reverse;
    }
}

/* Tablet - Mejor distribución del layout - MÁXIMA ESPECIFICIDAD */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Forzar container a usar todo el ancho */
    body.page-dashboard .container,
    body.page-dashboard div.container {
        max-width: 100% !important;
        padding: 20px 20px !important;
        margin: 20px auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Forzar dashboard-content a expandirse */
    body.page-dashboard .dashboard-content,
    body.page-dashboard div.dashboard-content {
        flex-direction: row !important;
        gap: 20px !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
    }
    
    /* Panel lateral más estrecho */
    body.page-dashboard .panel-lateral,
    body.page-dashboard aside.panel-lateral {
        flex: 0 0 200px !important;
        position: sticky !important;
        top: 80px !important;
        width: 200px !important;
        max-width: 200px !important;
        min-width: 200px !important;
        flex-shrink: 0 !important;
    }
    
    /* Ficha-content debe expandirse completamente - usar calc para asegurar que use todo el espacio */
    body.page-dashboard .ficha-content,
    body.page-dashboard div.ficha-content,
    body.page-dashboard #ficha-form-content {
        flex: 1 1 calc(100% - 220px) !important;
        min-width: calc(100% - 220px) !important;
        max-width: calc(100% - 220px) !important;
        width: calc(100% - 220px) !important;
        flex-grow: 1 !important;
        flex-shrink: 1 !important;
        flex-basis: calc(100% - 220px) !important;
    }
    
    /* Ficha-form debe usar todo el espacio */
    body.page-dashboard .ficha-form,
    body.page-dashboard form.ficha-form,
    body.page-dashboard #fichaForm {
        padding: 35px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        display: block !important;
    }
    
    body.page-dashboard .row {
        display: flex !important;
        gap: 20px !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        margin-bottom: 0 !important;
    }
    
    body.page-dashboard .campo-doble {
        flex: 1 1 calc(50% - 10px) !important;
        min-width: calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
        margin-bottom: 20px !important;
        box-sizing: border-box !important;
    }
    
    body.page-dashboard .ficha-form input:not([type="file"]),
    body.page-dashboard .ficha-form select,
    body.page-dashboard .ficha-form textarea {
        width: 100% !important;
        padding: 12px 16px !important;
        font-size: 15px !important;
        margin-bottom: 0 !important;
        box-sizing: border-box !important;
    }
    
    body.page-dashboard .ficha-form label {
        margin-bottom: 8px !important;
        font-size: 14.5px !important;
        display: block !important;
    }
    
    body.page-dashboard .logo-editor {
        margin-bottom: 30px !important;
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    body.page-dashboard .panel-card {
        margin-bottom: 15px !important;
        padding: 18px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    body.page-dashboard .step-indicator-container {
        display: flex !important;
        justify-content: center !important;
        margin: 0 auto 30px auto !important;
        width: 100% !important;
        max-width: 500px !important;
    }
    
    body.page-dashboard .step-title {
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 30px !important;
        font-size: 19px !important;
    }
    
    body.page-dashboard .ficha-form .form-step {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    body.page-dashboard .botones-navegacion {
        margin-top: 28px !important;
        display: flex !important;
        gap: 12px !important;
        justify-content: center !important;
        flex-direction: row !important;
    }
    
    body.page-dashboard .botones-navegacion .volver-btn,
    body.page-dashboard .botones-navegacion .guardar-btn {
        flex: 0 1 auto !important;
        min-width: 140px !important;
        padding: 12px 20px !important;
        font-size: 15px !important;
    }
}
.panel-card-perfil.premium {
    /* Estructura de .panel-card */
    padding: 25px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px; /* Para consistencia con otros cards */

    /* Colores de .premium */
    background: linear-gradient(135deg, #007aff, #005bb5);
    color: white;
}
.panel-card-perfil.premium h4 {
    /* Estructura de .panel-card h4 */
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 15px;
    
    /* Color de .premium h4 */
    color: white;
}
.panel-card-perfil.premium p {
    /* Estructura de .panel-card p */
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px; /* Espacio antes del botón */

    /* Color de .premium p */
    color: rgba(255, 255, 255, 0.9);
}
.boton-premium {
    display: block;
    width: 100%; /* Ocupa todo el ancho */
    text-align: center;
    background-color: #fff;
    color: #007aff;
    padding: 12px 20px; /* Padding más consistente */
    border-radius: 12px; /* Bordes redondeados como otros botones */
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-sizing: border-box;
}
.boton-premium:hover {
    background-color: #f0f0f0;
}

/* Estilo para opción de cobertura nacional en el select */
#ciudadSelect option[value="COBERTURA_NACIONAL"] {
    font-weight: 500;
    color: #007AFF;
}
