/**
 * Chrome común para todas las páginas del sitio principal de OpenRest:
 * navbar fija, sticky CTA mobile, footer, botón flotante de WhatsApp.
 *
 * Cada página puede sobrescribir colores definiendo sus propias variables
 * en su <style> inline (--primary-color, --dark-color, etc.).
 * Si la página NO las define, se usan los fallbacks de :root.
 */

:root {
    --or-primary: #FF6B35;
    --or-secondary: #004E89;
    --or-dark: #2C3E50;
    --or-icon: #FF6B35;
    --or-open: #2C3E50;
    --or-rest: #FF6B35;
}

/* ============ NAVBAR FIJA ============ */
.navbar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 10px 0;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-icon {
    color: var(--openrest-icon, var(--or-icon));
    font-size: 1.8rem;
    font-weight: 900;
    margin-right: 0.3rem;
    display: inline-flex;
    align-items: center;
    height: 1.8rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-weight: 900;
    font-size: 1.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.logo-open { color: var(--openrest-open, var(--or-open)); }
.logo-rest { color: var(--openrest-rest, var(--or-rest)); }

.logo-tagline {
    color: #6B7280;
    font-style: italic;
    letter-spacing: 0.145em;
    font-size: 0.93rem;
    margin: 0;
    display: block;
    width: 100%;
    text-align: center;
    padding-left: 0.145em;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: var(--dark-color, var(--or-dark));
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--primary-color, var(--or-primary));
}

.nav-cta {
    background: var(--primary-color, var(--or-primary));
    color: white;
    padding: 6px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-cta:hover {
    background: var(--secondary-color, var(--or-secondary));
    color: white;
    transform: translateY(-2px);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color, var(--or-dark));
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        gap: 16px;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .logo-main {
        font-size: 1.5rem;
    }

    .logo-tagline {
        font-size: 0.83rem;
        letter-spacing: 0.125em;
        padding-left: 0.125em;
    }
}

/* ============ FOOTER ============ */
.footer {
    background: var(--dark-color, var(--or-dark));
    color: white;
    padding: 40px 20px 20px;
    text-align: center;
}

.footer a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    text-decoration: underline;
}

.footer .container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ STICKY CTA MOBILE ============ */
@media (max-width: 767px) {
    .sticky-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 15px;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
        z-index: 1000;
        display: flex;
        justify-content: center;
    }

    .sticky-cta .hero-cta {
        width: 100%;
        max-width: 300px;
    }

    /* Espacio extra al final del body para que el sticky no tape contenido */
    body {
        padding-bottom: 80px;
    }
}

/* ============ BOTÓN FLOTANTE DE CONTACTO ============ */
/* Único botón "chat" a la derecha, abre el panel desplegable
   con opciones (chat con agente, WhatsApp, email, llamar, registro). */

.float-btn {
    position: fixed;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
    z-index: 998;
    text-decoration: none;
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.float-btn:hover, .float-btn:focus {
    transform: scale(1.08);
    color: white;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}

.chat-float {
    right: 24px;
    background: var(--primary-color, var(--or-primary));
}

.chat-float .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: #28a745;
    border: 2px solid white;
    border-radius: 50%;
}

/* ============ PANEL CHAT (popup de contacto) ============ */
.chat-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 320px;
    max-width: calc(100vw - 48px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    z-index: 999;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.85) translateY(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.chat-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.chat-panel-header {
    background: linear-gradient(135deg, var(--primary-color, var(--or-primary)) 0%, #F7931E 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-panel-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.chat-panel-header p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    opacity: 0.92;
}
.chat-panel-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 12px;
}
.chat-panel-close:hover { background: rgba(255,255,255,0.3); }

.chat-panel-options {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--dark-color, var(--or-dark));
    transition: background 0.15s ease;
    font-size: 0.92rem;
}
.chat-option:hover {
    background: #f5f6f8;
    color: var(--dark-color, var(--or-dark));
}
.chat-option-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: white;
    flex-shrink: 0;
}
.chat-option-icon.agent { background: linear-gradient(135deg, #2196F3, #1976D2); }
.chat-option-icon.wa { background: #25D366; }
.chat-option-icon.mail { background: #4F86F7; }
.chat-option-icon.phone { background: #6B7280; }
.chat-option-icon.demo { background: var(--primary-color, var(--or-primary)); }

/* Botones tipo button dentro de chat-option (la opción "Chat con un agente") */
button.chat-option {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
}
.chat-option-text strong {
    display: block;
    font-weight: 600;
    margin-bottom: 1px;
}
.chat-option-text small {
    color: #888;
    font-size: 0.78rem;
}
.chat-panel-footer {
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    font-size: 0.75rem;
    color: #888;
}

@media (max-width: 767px) {
    /* Sticky CTA mobile no debe chocar con los botones flotantes */
    .float-btn { bottom: 92px; }
    .chat-panel {
        bottom: 160px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}

/* ============ OCULTAR EL BOTÓN NATIVO DEL WIDGET DE AGENTES ============ */
/* El widget OpenTPVChat se invoca desde nuestro botón único de "Chat" (panel),
   por lo que su botón propio no debe aparecer. La ventana del chat sí. */
#opentpv-webchat-button {
    display: none !important;
}
