/* Variables y Reseteo */
:root {
    --primary-blue: #0A365C; /* Azul del logo Vicely */
    --primary-orange: #F38118; /* Naranja del logo Vicely */
    --text-dark: #333333;
    --text-light: #777777;
    --bg-light: #f8f9fa;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.text-center { text-align: center; }
.section-padding { padding: 80px 0; }
.bg-light { background-color: var(--bg-light); }

/* Tipografía Compartida */
.section-title {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-weight: 700;
}
.section-subtitle {
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 50px auto;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-primary {
    background-color: var(--primary-orange);
    color: var(--white);
    border: 2px solid var(--primary-orange);
}
.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-orange);
}
.btn-secondary {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 8px 20px;
    font-size: 0.9rem;
    border-radius: 20px;
}
.btn-secondary:hover {
    background-color: var(--primary-orange);
}

/* 1. Top Bar */
.top-bar {
    background-color: #111;
    color: #ccc;
    font-size: 0.8rem;
    padding: 10px 0;
}
.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.contact-info span {
    margin-right: 20px;
}
.contact-info i {
    color: var(--primary-orange);
    margin-right: 5px;
}
.social-icons a {
    color: #ccc;
    margin-left: 15px;
    transition: color 0.3s;
}
.social-icons a:hover {
    color: var(--primary-orange);
}

/* 2. Header (Navegación) */
.header {
    background-color: var(--primary-blue);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}
.logo img {
    height: 45px;
    width: auto;
    display: block;
}
.main-nav ul {
    list-style: none;
    display: flex;
}
.main-nav ul li {
    margin-left: 30px;
}
.main-nav ul li a {
    text-decoration: none;
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.3s;
}
.main-nav ul li a:hover, .main-nav ul li a.active {
    color: var(--primary-orange);
}

/* 3. Hero Section */
.hero {
    position: relative;
    height: 600px;
    background-image: url('./img/cabecera.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(10, 54, 92, 0.9), rgba(10, 54, 92, 0.4));
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}
.hero-content h2 {
    color: var(--white);
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 20px;
}
.hero-content p {
    color: #e0e0e0;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* 4. Grids y Tarjetas */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border-bottom: 3px solid transparent;
}
.card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--primary-orange);
}

/* Tarjetas con Imagen (Sección Bienvenidos) */
.card-image {
    position: relative;
}
.card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.card-number {
    position: absolute;
    top: 175px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-blue);
    color: var(--white);
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    font-weight: bold;
    border: 3px solid var(--white);
}
.card-image .card-body {
    padding: 40px 20px 30px;
}

/* Tarjetas con Icono (Sección Qué Hacemos) */
.card-icon {
    padding: 40px 20px;
}
.icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px auto;
    border: 2px dashed var(--primary-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.icon-wrapper i {
    font-size: 2rem;
    color: var(--primary-blue);
}
.card-icon:hover .icon-wrapper {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}
.card-icon:hover .icon-wrapper i {
    color: var(--white);
}
.card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-blue);
}
.card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* 5. Banner CTA Inferior */
.cta-banner {
    background-color: var(--primary-blue);
    padding: 60px 0;
    border-top: 5px solid var(--primary-orange);
}
.cta-banner h2 {
    color: var(--white);
    font-size: 1.8rem;
    font-weight: 600;
}

/* Responsividad para móviles */
@media (max-width: 768px) {
    .top-bar-content { flex-direction: column; text-align: center; }
    .contact-info span { display: block; margin-bottom: 5px; }
    
    .nav-content { flex-direction: column; height: auto; padding: 20px 0; }
    .main-nav ul { margin-top: 20px; flex-wrap: wrap; justify-content: center; }
    .main-nav ul li { margin: 10px; }
    
    .hero-content h2 { font-size: 2rem; }
    .hero { height: auto; padding: 100px 0; }
}

/* =========================================
   ESTILOS ESPECÍFICOS PARA PÁGINAS INTERNAS
   ========================================= */

/* Encabezado más corto para páginas internas */
.page-header {
    position: relative;
    height: 300px;
    background-image: url('./img/cabecera.jpg'); /* Puedes usar la misma imagen o una diferente */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
}
.page-header h2 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 10px;
}
.page-header p {
    color: #e0e0e0;
    font-size: 1.1rem;
}
.relative-z {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Grillas específicas para la página Nosotros */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
.about-text p {
    margin-bottom: 15px;
    color: var(--text-light);
}
.about-list {
    list-style: none;
    margin-top: 20px;
}
.about-list li {
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--primary-blue);
}
.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
}

/* Responsividad extra para Nosotros */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    .page-header h2 {
        font-size: 2.2rem;
    }
}

/* =========================================
   ESTILOS PARA LA PÁGINA DE CONTACTO
   ========================================= */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.contact-info-box p {
    color: var(--text-light);
    margin-bottom: 30px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.contact-icon-box {
    font-size: 1.5rem;
    background: var(--bg-light);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.contact-item h4 {
    color: var(--primary-blue);
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.contact-item p {
    color: var(--text-light);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Caja del Formulario */
.contact-form-box {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-top: 4px solid var(--primary-orange);
}

.contact-form-box h3 {
    color: var(--primary-blue);
    font-size: 1.5rem;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-orange);
}

/* Responsividad para móviles en Contacto */
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .contact-form-box {
        padding: 25px;
    }
}

/* =========================================
   WIDGET DE CHAT FLOTANTE LATERAL DE WHATSAPP
   ========================================= */

.wa-widget-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
}

/* Botón flotante */
.wa-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25D366;
    color: #ffffff;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s;
    position: relative;
    animation: wa-pulse 2s infinite;
}

.wa-toggle-btn:hover {
    transform: scale(1.1);
    background-color: #20ba5a;
}

@keyframes wa-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
    }
    70% {
        box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Badge de notificación */
.wa-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ff3b30;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #ffffff;
}

/* Tooltip al pasar el mouse */
.wa-tooltip {
    position: absolute;
    right: 75px;
    background-color: #0A365C;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateX(10px);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.wa-toggle-btn:hover .wa-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Ventana de Chat Lateral */
.wa-chat-window {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 370px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 130px);
    background-color: #efeae2;
    background-image: radial-gradient(#d5ceb9 1px, transparent 1px);
    background-size: 16px 16px;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

.wa-chat-window.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.85) translateY(20px);
    pointer-events: none;
}

.wa-chat-window.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Encabezado del Chat */
.wa-chat-header {
    background-color: var(--primary-blue);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.wa-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-avatar-container {
    position: relative;
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.wa-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background-color: #25D366;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.wa-agent-details h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

.wa-agent-status {
    font-size: 11px;
    color: #d1e7dd;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wa-agent-status i {
    font-size: 7px;
    color: #25D366;
}

.wa-chat-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 4px 8px;
}

.wa-chat-close:hover {
    opacity: 1;
}

/* Cuerpo del Chat */
.wa-chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wa-chat-date {
    align-self: center;
    background-color: rgba(255, 255, 255, 0.85);
    color: #667781;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 12px;
    border-radius: 12px;
    margin-bottom: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.wa-message {
    display: flex;
    flex-direction: column;
    max-width: 86%;
}

.wa-message-incoming {
    align-self: flex-start;
}

.wa-message-outgoing {
    align-self: flex-end;
}

.wa-message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    position: relative;
}

.wa-message-incoming .wa-message-bubble {
    background-color: #ffffff;
    color: #111b21;
    border-top-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.wa-message-outgoing .wa-message-bubble {
    background-color: #d9fdd3;
    color: #111b21;
    border-top-right-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.wa-message-bubble p {
    margin-bottom: 5px;
}

.wa-message-bubble p:last-child {
    margin-bottom: 0;
}

.wa-message-time {
    display: block;
    font-size: 10px;
    color: #667781;
    text-align: right;
    margin-top: 4px;
}

.wa-message-outgoing .wa-message-time i {
    color: #53bdeb;
    margin-left: 2px;
}

/* Opciones rápidas */
.wa-quick-options {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 5px;
}

.wa-quick-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.wa-quick-btn {
    width: 100%;
    text-align: left;
    background-color: #f8f9fa;
    border: 1px solid #25D366;
    color: #0A365C;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.wa-quick-btn:last-child {
    margin-bottom: 0;
}

.wa-quick-btn:hover {
    background-color: #25D366;
    color: #ffffff;
}

/* Pie de Chat / Input */
.wa-chat-footer {
    background-color: #f0f2f5;
    padding: 10px 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wa-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wa-chat-form input {
    flex: 1;
    background: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 20px;
    padding: 9px 15px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.wa-chat-form input:focus {
    border-color: #25D366;
}

.wa-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #25D366;
    color: #ffffff;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.wa-send-btn:hover {
    background-color: #1ea952;
}

.wa-direct-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: #075e54;
    text-decoration: none;
    font-weight: 600;
    padding-top: 2px;
    transition: color 0.2s;
}

.wa-direct-link:hover {
    color: var(--primary-orange);
}

@media (max-width: 480px) {
    .wa-chat-window {
        right: 15px;
        bottom: 85px;
        width: calc(100vw - 30px);
        height: 480px;
    }
    .wa-widget-container {
        right: 15px;
        bottom: 15px;
    }
}