/* ==========================================================================
   CAPA 1: ESCRITORIO Y BASE (De css_negocios_desktop.css)
   Estilos generales, variables y estructura principal
   ========================================================================== */

/* --- VARIABLES Y ESTRUCTURA BASE --- */
:root {
    --primary-color: #1ad458;
    --bg-body: #050505;
    --text-main: #ffffff;
}

#negocios {
    min-height: 100vh;
    padding-bottom: 100px;
    background-color: var(--bg-body);
}

/* --- TITULOS DE CATEGORÍA (CENTRADOS) --- */
.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 60px 0 35px 0;
    text-align: center;
    color: #ffffff;
    text-transform: uppercase;
    border-bottom: none;
    padding-bottom: 10px;
    position: relative;
    width: 100%;
}

.category-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: #00d26a;
    margin: 10px auto 0 auto;
}

/* --- CONTROLES: BÚSQUEDA Y FILTROS --- */
.business-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px auto 50px auto;
    max-width: 1150px;
    /* Aumentado para que quepa todo */
    padding: 0 20px;
    width: 100%;
    flex-wrap: wrap;
    /* Permitir que se ajusten en pantallas pequeñas */
}

.search-container {
    width: 350px;
    /* Ancho fijo para la búsqueda */
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: #888;
    font-size: 1.2rem;
}

.search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 15, 15, 0.8);
    color: #fff;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(26, 212, 88, 0.3);
    background: rgba(20, 20, 20, 0.95);
}

.menu-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.hamburger-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 50px;
    height: 50px;
    margin-top: 0; /* Cancela el margin-top: 15px global de main.css */
}

.hamburger-btn:hover {
    background: rgba(0, 210, 106, 0.2);
    /* #00d26a with opacity */
    border-color: #00d26a;
    color: #00d26a;
}

.filter-dropdown-menu {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    min-width: 280px;
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.filter-dropdown-menu.open {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.filter-option {
    background: transparent;
    color: #ddd;
    border: none;
    padding: 15px 20px;
    font-size: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.filter-option.active {
    background: #00d26a;
    color: #000;
    font-weight: 700;
}

/* --- GRILLA DE NEGOCIOS --- */
.business-grid {
    display: grid;
    /* 1. Forzamos exactamente 3 columnas del mismo tamaño */
    grid-template-columns: repeat(3, 1fr);

    /* 2. Espacio entre tarjetas */
    gap: 30px;

    /* 3. Limitamos el ancho máximo */
    max-width: 1150px;

    /* 4. Centramos el bloque */
    margin: 0 auto;

    /* 5. Aire lateral */
    padding: 0 20px;
    width: 100%;
    margin-bottom: 50px;
}

.no-results-msg {
    color: #aaa;
    text-align: center;
    width: 100%;
    padding: 60px 20px;
    font-size: 1.1rem;
}

/* --- TARJETAS DE NEGOCIO --- */
.business-card {
    background-color: rgba(15, 15, 15, 0.80);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
    text-align: left;
    height: 100%;
}

.business-card:hover {
    transform: translateY(-7px);
    border-color: var(--primary-color);
    background-color: rgba(20, 20, 20, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.business-card h3 {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.info-row {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    color: #bbbbbb;
    font-size: 0.95rem;
    justify-content: flex-start;
}

.icon-gold {
    color: #d4af37;
}

.btn-ver-mas {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 10px 30px;
    margin-top: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    width: 100%;
    text-align: center;
}

.btn-ver-mas:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
    font-weight: 700;
}

/* --- MODAL PRINCIPAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    width: 100%;
    max-width: 1250px;
    height: 92vh;
    background: #0a0a0a;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    position: relative;
    display: flex;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 100;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

.modal-content-grid {
    display: grid;
    grid-template-columns: 55% 45%;
    width: 100%;
    height: 100%;
}

/* --- SECCIÓN IZQUIERDA: GALERÍA Y VIDEO --- */
.modal-gallery {
    background: #000;
    padding: 0 15px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    overflow: hidden;
    position: relative;
    justify-content: flex-start;
}

.gallery-main {
    flex: 1;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* CORRECCIÓN 1: Centrado perfecto para Occos y demás */
    object-position: center center !important;
    display: block;
}

#video-principal {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: none;
    border-radius: 8px;
}

.video-mode-active #img-principal {
    display: none !important;
}

.video-mode-active #video-principal {
    display: block !important;
}

/* MINIATURAS (CORREGIDO PARA PUERTO CASONA) */
.gallery-thumbnails {
    height: 100px;
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.gallery-thumbnails img {
    /* CORRECCIÓN 2: Tamaño fijo para que no se estiren si son pocas */
    width: calc((100% - 20px) / 3) !important;
    flex-grow: 0;

    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.3s;
    border: 2px solid transparent;
}

.gallery-thumbnails img:first-child {
    display: none !important;
}

.gallery-thumbnails img:hover {
    opacity: 1;
    border-color: var(--primary-color);
}

/* --- SECCIÓN DERECHA: INFO --- */
.modal-info {
    background: #0f0f0f;
    padding: 35px 30px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    text-align: left;
}

.modal-header-content {
    flex-shrink: 0;
}

.modal-category {
    display: none !important;
}

.modal-info h2 {
    color: #fff;
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.separator-line {
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    margin-bottom: 20px;
}

.modal-text-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

.modal-text-body::-webkit-scrollbar {
    width: 6px;
}

.modal-text-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.modal-text-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.modal-description {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 300;
}

/* --- FOOTER --- */
.modal-footer-info {
    flex-shrink: 0;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #0f0f0f;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    transition: 0.3s;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 5px;
}

.contact-row:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.icon-map {
    color: var(--primary-color);
}

.icon-phone {
    color: #d4af37;
}

.icon-fb {
    color: #1877F2;
}

.contact-text {
    display: flex;
    flex-direction: column;
}

.contact-text span {
    font-size: 0.75rem;
    color: #777;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.contact-text small {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 400;
}

.hidden {
    display: none !important;
}

/* --- BOTÓN FLOTANTE WHATSAPP --- */
/* =========================================
   BOTÓN FLOTANTE WHATSAPP (AJUSTADO)
   ========================================= */
.wa-floating-btn {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}
.wa-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    color: #fff;
}


/* ==========================================================================
   CAPA 2: TABLETS
   ========================================================================== */

@media (max-width: 1024px) {

    /* --- GRILLA DE NEGOCIOS --- */
    .business-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
    }
}

@media (max-width: 900px) {

    /* --- MODAL PRINCIPAL --- */
    .modal-container {
        height: 95vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .modal-content-grid {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow-y: auto;
    }

    .modal-gallery {
        width: 100%;
        height: auto;
        min-height: auto;
        padding: 15px;
        background: #000;
        flex-shrink: 0;
    }

    .gallery-main {
        height: 250px;
        width: 100%;
        margin-bottom: 10px;
    }

    .gallery-thumbnails {
        display: flex !important;
        height: 60px;
        width: 100%;
        gap: 8px;
    }

    .modal-info {
        height: auto;
        padding: 25px 20px;
        overflow: visible;
    }

    .modal-text-body {
        overflow: visible;
        padding-right: 0;
    }

    .modal-footer-info {
        padding-bottom: 30px;
    }
}


/* ==========================================================================
   CAPA 3: MÓVILES (De css_negocios.css)
   ========================================================================== */

@media (max-width: 768px) {
    /* Espacio reservado para estilos específicos de 768px */
}

@media (max-width: 650px) {

    /* --- ESTRUCTURA BASE --- */
    #negocios .content-wrapper {
        padding: 0 10px !important;
    }

    /* --- GRILLA DE NEGOCIOS --- */
    .business-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 15px !important;
    }

    /* --- CONTROLES: BÚSQUEDA --- */
    .search-container {
        width: 100%;
        /* El input de búsqueda debe usar todo el ancho en móviles */
    }

    /* --- TARJETAS DE NEGOCIO --- */
    .business-card {
        padding: 18px 12px !important;
        border-radius: 12px !important;
        min-height: 100% !important;
        background: rgba(15, 15, 15, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        justify-content: space-between !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
    }

    .business-card h3 {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        margin-bottom: 12px !important;
        color: #ffffff !important;
        letter-spacing: 0.5px !important;
    }

    .info-row {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
        gap: 6px !important;
        color: #888888 !important;
        align-items: flex-start !important;
    }

    .info-row i {
        font-size: 1rem !important;
        margin-top: 3px !important;
    }

    .btn-ver-mas {
        width: 100% !important;
        padding: 10px 0 !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        letter-spacing: 1px !important;
        border-radius: 12px !important;
        margin-top: 15px !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        background: transparent !important;
    }

    .btn-ver-mas:active {
        background: #1ad458 !important;
        color: #000 !important;
        border-color: #1ad458 !important;
    }
}