/* RESET GENERAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
}

/* HEADER CON VERDE */
.header-fijo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    background: #008000;
    border-bottom: 1px solid #ccc;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-placeholder img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

.marca-azul {
    color: #ffffff;
    font-size: 24px;
}

.marca-ando {
    color: #ffffff;
}

.lema-rojo {
    color: #ffcccc;
    font-size: 12px;
    margin-top: -5px;
}

.menu-y-cuenta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.menu-principal ul {
    display: flex;
    list-style: none;
    gap: 20px;
    flex-wrap: nowrap;
}

.menu-principal a {
    text-decoration: none;
    color: #ffffff;
    font-size: 18px;
    transition: color 0.3s ease;
}

.menu-principal a:hover {
    color: #FFFF00;
}

.menu-principal a i {
    color: #FFFF00;
    margin-right: 5px;
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.8);
}

.titulo-rojo-brillante {
    color: #FF3333 !important;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.contenedor-principal {
    display: flex;
    padding: 20px;
    gap: 15px;
    min-height: 80vh;
}

.panel {
    flex: 1;
    background: #fff;
    border: 1px solid #999;
    border-radius: 8px;
    padding: 15px;
}

.panel h3 {
    font-size: 14px;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.hero-search {
    background: linear-gradient(135deg, #2c73d2 0%, #33a163 100%);
    border-radius: 10px;
    padding: 40px 20px;
    color: white;
    text-align: center;
}

.hero-search h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.search-bar {
    background: white;
    border-radius: 25px;
    display: flex;
    padding: 5px 15px;
    align-items: center;
}

.search-bar input {
    border: none;
    flex: 1;
    padding: 10px;
    outline: none;
}

.btn-buscar {
    background: #4a76c5;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-buscar:hover {
    background: #2c5aa0;
}

@media (min-width: 768px) {
    .btn-buscar {
        font-size: 18px;
        padding: 12px 30px;
    }
}

/* ============================================
   CONTADOR DE EMPRESAS
   ============================================ */
.contador-empresas {
    background: #e8f0fe;
    border-left: 4px solid #4a76c5;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e2b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contador-empresas::before {
    content: "📊";
    font-size: 16px;
}

/* En móviles, el contador se adapta */
@media (max-width: 767px) {
    .contador-empresas {
        font-size: 13px;
        padding: 8px 12px;
    }
}

.resultados-container {
    position: relative;
}

.lista-resultados {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 5px;
}

.lista-resultados::-webkit-scrollbar {
    width: 8px;
}

.lista-resultados::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.lista-resultados::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.lista-resultados::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media (max-width: 767px) {
    .lista-resultados {
        max-height: 350px;
    }
}

/* ============================================
   RESULTADO ITEM - ESCRITORIO (horizontal)
   ============================================ */
.resultado-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    margin-top: 5px;
    border-radius: 5px;
}

.resultado-item.activo {
    border: 2px solid #4a76c5;
    background: #f0f4ff;
}

/* ============================================
   BOTÓN "HAZ CLIC PARA DETALLES" - ESCRITORIO
   ============================================ */
.flecha-indicadora {
    background: #4a76c5;
    color: white;
    font-size: 14px;
    padding: 8px 12px;
    margin-left: auto;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.flecha-indicadora:hover {
    background: #2c5aa0;
}

/* ============================================
   MÓVILES (≤ 767px): El botón va debajo del nombre
   ============================================ */
@media (max-width: 767px) {
    .resultado-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .flecha-indicadora {
        width: 100%;
        text-align: center;
        margin-top: 8px;
        margin-left: 0;
        white-space: normal;
        font-size: 15px;
        padding: 10px;
    }
    
    .res-info {
        width: 100%;
    }
    
    .nombre-empresa {
        font-size: 16px;
        font-weight: 500;
        display: block;
        width: 100%;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
}

.modal-contenedor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2001;
    padding: 20px;
}

.modal-global {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
}

.modal-header-global {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-header-global h4 {
    font-size: 16px;
    color: #333;
}

.cerrar-modal-global {
    font-size: 20px;
    color: #999;
    transition: color 0.3s ease;
}

.cerrar-modal-global:hover {
    color: #333;
}

.img-local-global {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #f0f0f0;
}

.modal-global h5 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.modal-global p {
    font-size: 14px;
    margin: 8px 0;
    display: flex;
    align-items: center;
}

.telefonos-empresa-global {
    margin: 10px 0;
}

.telefonos-empresa-global p {
    margin: 5px 0;
}

.formulario-registro h4 {
    margin-bottom: 15px;
    color: #333;
}

.formulario-registro form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.formulario-registro input,
.formulario-registro select,
.formulario-registro textarea {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.upload-box {
    border: 2px dashed #ccc;
    padding: 15px;
    text-align: center;
    color: #888;
    background: #f9f9f9;
}

.btn-enviar {
    background: #4a76c5;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-enviar:hover {
    background: #2c5aa0;
}

@media (min-width: 768px) {
    .btn-enviar {
        font-size: 18px;
        padding: 14px;
    }
}

/* ============================================
   MENÚ DE USUARIO (ícono derecho del header)
   ============================================ */
.usuario-menu {
    position: relative;
    cursor: pointer;
}

.usuario-icono {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 16px;
    padding: 6px 10px;
    border-radius: 20px;
    transition: background 0.3s ease;
}

.usuario-icono:hover {
    background: rgba(255, 255, 255, 0.15);
}

.usuario-icono i {
    font-size: 26px;
    color: #FFFF00;
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.8);
}

.usuario-nombre {
    font-size: 14px;
    white-space: nowrap;
}

.usuario-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1001;
    overflow: hidden;
}

.usuario-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.2s ease;
}

.usuario-dropdown a:hover {
    background: #f0f4ff;
    color: #4a76c5;
}

.usuario-dropdown a i {
    color: #4a76c5;
    width: 16px;
    text-align: center;
}

.usuario-dropdown.visible {
    display: block;
}

@media (max-width: 1024px) {
    .usuario-menu {
        margin-top: 10px;
    }
    .usuario-dropdown {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .usuario-icono i {
        font-size: 28px;
    }
}

.footer-principal {
    background: #c8e6c9;
    border-top: 1px solid #ccc;
    padding: 20px;
    text-align: center;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    margin: 0 10px;
    font-size: 12px;
    text-decoration: none;
    color: #2c3e2b;
    font-weight: bold;
    transition: color 0.3s ease;
}

@media (max-width: 767px) {
    .footer-links a {
        font-size: 14px;
        display: inline-block;
        margin: 5px 8px;
    }
}

@media (min-width: 768px) {
    .footer-links a {
        font-size: 15px;
    }
}

.footer-links a:hover {
    color: #FFFF00;
    text-shadow: 0 0 2px rgba(0,0,0,0.3);
}

.redes-sociales i {
    margin: 0 10px;
    font-size: 20px;
    color: #2c3e2b;
}

.footer-contacto {
    font-size: 11px;
    color: #2c3e2b;
    margin-top: 10px;
}

.abierto {
    color: green;
    font-size: 14px;
}

.cerrado {
    color: red;
    font-size: 14px;
}

@media (max-width: 1024px) {
    .contenedor-principal {
        flex-direction: column;
    }

    .header-fijo {
        flex-direction: column;
        text-align: center;
    }

    .menu-y-cuenta {
        flex-direction: column;
        gap: 5px;
    }

    .menu-principal ul {
        margin-top: 10px;
        gap: 10px;
    }

    .menu-principal a {
        font-size: 15px;
    }
}

/* Landscape en móvil: logo arriba, menú y Mi cuenta en una sola fila debajo */
@media (orientation: landscape) and (max-height: 500px) {
    .header-fijo {
        flex-direction: column;
        align-items: center;
        padding: 6px 3%;
        gap: 4px;
    }

    .menu-principal {
        display: flex;
        align-items: center;
    }

    .menu-principal ul {
        gap: 8px;
        flex-wrap: nowrap;
        margin-top: 0;
    }

    .menu-principal a {
        font-size: 12px;
    }

    /* Poner menú y Mi cuenta en la misma fila */
    .menu-y-cuenta {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        justify-content: center;
    }

    .usuario-menu {
        margin-top: 0;
    }

    .usuario-nombre {
        font-size: 12px;
    }

    .usuario-icono i {
        font-size: 20px;
    }
}


@media (max-width: 480px) and (orientation: portrait) {
    .menu-principal ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
}

@media (max-width: 480px) {

    .hero-search {
        padding: 20px 10px;
    }

    .hero-search h2 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .search-bar {
        flex-direction: column;
        background: transparent;
        gap: 10px;
        padding: 0;
    }

    .search-bar input {
        width: 100%;
        border-radius: 20px;
        border: 1px solid #ccc;
        background: white;
    }

    .btn-buscar {
        width: 100%;
    }

    .panel {
        padding: 10px;
    }

    /* MODIFICACIÓN: Logo y texto en horizontal (fila) en móvil vertical */
    .logo-placeholder {
        flex-direction: row;
        text-align: left;
        justify-content: center;
    }

    .marca-azul {
        font-size: 18px;
    }

    .lema-rojo {
        font-size: 9px;
        margin-top: -2px;
    }

    .modal-global {
        width: 95%;
        padding: 15px;
    }

    .img-local-global {
        height: 200px;
    }
}