:root {
    --primary-color: #6c63ff;
    --secondary-color: #4d44db;
    --accent-color: #a78bfa;
    --light-color: #ffffff;
    --dark-color: #181449;

    --primary: #5B5FEF;
    --primary-hover: #4A4EE0;

    --accent: #8B7CF6;

    --success: #1F9D63;
    --danger: #e20808;
    --warning: #F4B740;
    --info: #4C82F7;

    --sidebar-bg: #1E1F2F;
    --navbar-bg: #23243A;

    --bg-main: #F4F6FB;
    --card-bg: #FFFFFF;

    --text-dark: #1F2937;
    --text-muted: #6B7280;
}

/* ===========================
   FIXES RESPONSIVE CRÍTICOS
=========================== */

/* Prevenir scroll horizontal global */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    position: relative;
}

/* Fix para containers */
.container-fluid {
    overflow-x: hidden;
}

/* Navbar section */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 24px;
}

.base-view .nav-link {
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.base-view .nav-link:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

.navbar-brand img {
    max-height: 36px;
    width: auto;
}

/* Buttons Section */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

#btn-login {
    border-color: var(--primary-color);
    font-weight: 600;
}

.hero-brand {
    position: relative;
    min-height: 90vh;
    background: url("../images/CanCheetah.png") center center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden; /* FIX: Previene overflow */
}

/* Overlay para contraste */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0),
        rgba(24, 20, 73, 0.9)
    );
}

/* Contenido encima */
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 1rem; /* FIX: Padding en móviles */
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin: 1rem auto 2.5rem;
}

.hero-content .btn-primary {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    color: white;
    font-weight: 600;
}

.hero-content .btn-primary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.footer {
    background: linear-gradient(135deg, var(--dark-color), var(--primary-color));
    color: white;
    padding: 40px 0;
    margin-top: 0;
}

.login-modal .modal-content {
    border-radius: 15px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
}

.available-time {
    background-color: var(--accent-color);
    color: white;
    border-radius: 5px;
    padding: 8px 15px;
    margin: 5px;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s;
}

.available-time:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

/* ===========================
   SEARCH SECTION
=========================== */

#search-section {
    position: relative;
    z-index: 5;
}

/* 🟢 Buscador grande del HOME */
.search-bar-home {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(6px);
    padding: 2rem 2.5rem;
    margin: 3rem auto 4rem auto;
    max-width: 1100px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 8rem;
}

/* 🔵 Buscador compacto de RESULTS */
.search-bar-compact {
    background: #ffffff;
    padding: 1.5rem 2rem;
    margin: 1.5rem auto 3rem auto;
    max-width: 1100px;
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}

.search-intro {
    margin-top: 6rem;
    margin-bottom: 3.5rem;
}

.search-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.search-subtitle {
    font-size: 1.05rem;
    color: #6c757d;
    max-width: 640px;
    margin: 0 auto;
}

.search-bar-home label,
.search-bar-compact label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.search-bar-home .form-control,
.search-bar-home .form-select,
.search-bar-compact .form-control,
.search-bar-compact .form-select {
    border-radius: 12px;
    padding: 12px;
}

.search-bar-home .btn-primary,
.search-bar-compact .btn-primary {
    height: 100%;
    border-radius: 14px;
    font-weight: 400;
}

.form-select,
.form-select option {
    color: #000 !important;
    background-color: #fff !important;
}

.form-select option:hover {
    background-color: #f0f0f0;
}

#search-section::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 6px;
    border-radius: 10px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent),
        transparent
    );
    opacity: 0.6;
}

/* ===============================
   RESULTS SECTION
================================ */

.results-section {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    min-height: calc(100vh - 200px);
    padding: 4rem 0 6rem;
}

.results-header {
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.results-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.results-subtitle {
    font-size: 1rem;
    margin: 0;
}

.results-subtitle strong {
    color: var(--text-dark);
}

.active-filters .btn {
    border-radius: 20px;
    font-size: 0.875rem;
}

.text-truncate-2 {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    max-width: 500px;
    margin: 0 auto;
    padding: 6rem 1rem;
}

.search-bar-compact + .results-section {
    margin-top: 0;
}

/* ===========================
   CUSTOMER / CLIENT SECTION
=========================== */

#CVSection {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden; /* FIX: Previene overflow */
    position: relative;
}

.section-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-card:hover {
    transform: translateY(-5px) scale(1.02) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.dynamic-title {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    transition: all 0.5s ease;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    padding-left: 30px;
}

.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
    font-size: 18px;
}

ul.feature-list li {
    color: #212529 !important;
}

.section-subtitle {
    color: #6c757d;
    font-weight: 300;
}

.landing-section-padding {
    padding-top: 100px;
    padding-bottom: 300px;
}

/* My profile Page */
.profile-separator {
    width: 2px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--accent-color),
        transparent
    );
    height: 100%;
    min-height: 350px;
    border-radius: 2px;
}

/* Contact Link */
.contact-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.contact-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ===========================
   SECCIÓN CÓMO FUNCIONA
=========================== */

.how-it-works {
    position: relative;
    overflow: hidden;
}

.step-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.step-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(108, 99, 255, 0.15);
}

.step-icon {
    position: relative;
    display: inline-block;
}

.icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto;
    box-shadow: 0 8px 20px rgba(108, 99, 255, 0.3);
}

.step-number {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #f4b740;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(244, 183, 64, 0.4);
}

/* ===========================
   SECCIÓN FAQ
=========================== */

.faq-section .accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.faq-section .accordion-button {
    background: white;
    color: #1f2937;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    border: none;
    font-size: 1.05rem;
}

.faq-section .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: none;
}

.faq-section .accordion-button:focus {
    box-shadow: none;
    border: none;
}

.faq-section .accordion-button::after {
    filter: brightness(0) invert(1);
}

.faq-section .accordion-button:not(.collapsed)::after {
    filter: brightness(1) invert(1);
}

.faq-section .accordion-body {
    padding: 1.5rem;
    background: #f8f9fa;
    color: #6b7280;
    line-height: 1.7;
}

/* ===========================
   CTA FINAL
=========================== */

.final-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden; /* FIX: Previene overflow */
}

.final-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.final-cta::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.cta-box {
    position: relative;
    z-index: 2;
}

.cta-box h2,
.cta-box p {
    color: white;
}

.cta-box .btn-primary {
    background: white;
    color: #667eea;
    border: none;
    font-weight: 600;
}

.cta-box .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* ===========================
   CONTACTO MEJORADO
=========================== */

.contact-item {
    padding: 1.5rem;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    height: 100%;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(108, 99, 255, 0.15);
}

.contact-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

/* ===========================
   RESPONSIVE
=========================== */

/* Tablets y dispositivos medianos */
@media (max-width: 991px) {
    .hero-brand {
        min-height: 70vh;
    }
    
    .hero-title {
        font-size: clamp(2rem, 4vw, 3rem);
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    #CVSection {
        min-height: auto;
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .landing-section-padding {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* FIX: Decoraciones más pequeñas */
    .final-cta::before,
    .final-cta::after {
        width: 350px;
        height: 350px;
    }
}

/* Móviles */
@media (max-width: 767px) {
    /* FIX: Containers con padding correcto */
    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Hero */
    .hero-brand {
        min-height: 60vh;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin: 0.5rem auto 1.5rem;
    }
    
    .hero-content .btn-primary {
        padding: 12px 30px !important;
        font-size: 0.95rem;
    }
    
    /* Search Section - FIX CRÍTICO */
    #search-section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .search-bar-home {
        padding: 1.25rem 1rem;
        border-radius: 15px;
        margin: 2rem 1rem 3rem 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .search-bar-home .container {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }
    
    .search-intro {
        margin-top: 3rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .search-subtitle {
        font-size: 0.95rem;
    }
    
    /* Fix inputs para iOS */
    .search-bar-home .form-control,
    .search-bar-home .form-select {
        font-size: 16px; /* Previene zoom en iOS */
        padding: 12px 14px;
    }
    
    input[type="date"],
    input[type="text"],
    select {
        font-size: 16px !important;
    }
    
    /* Results Section */
    .results-section {
        padding: 3rem 0 4rem;
        min-height: calc(100vh - 150px);
    }
    
    .results-title {
        font-size: 1.5rem;
    }
    
    .results-subtitle {
        font-size: 0.9rem;
    }
    
    .results-header {
        margin-bottom: 2rem !important;
    }
    
    .empty-state {
        padding: 4rem 1rem;
    }
    
    /* CVSection */
    #CVSection {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .landing-section-padding {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    #CVSection .display-4 {
        font-size: 1.75rem;
    }
    
    #CVSection .lead {
        font-size: 1rem;
    }
    
    .dynamic-title {
        font-size: 1.5rem !important;
    }
    
    .section-subtitle {
        font-size: 0.95rem !important;
    }
    
    .feature-list li {
        font-size: 0.9rem;
        padding: 8px 0;
        padding-left: 25px;
    }
    
    .feature-list li:before {
        font-size: 16px;
    }
    
    /* Iconos pasos */
    .icon-circle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        top: -8px;
        right: -8px;
    }
    
    /* FAQ */
    .faq-section .section-title {
        font-size: 1.75rem;
    }
    
    .faq-section .accordion-button {
        font-size: 0.95rem;
        padding: 1rem 1.25rem;
    }
    
    .faq-section .accordion-body {
        padding: 1.25rem;
        font-size: 0.9rem;
    }
    
    /* CTA Final */
    .final-cta .display-4 {
        font-size: 1.75rem;
    }
    
    .final-cta .lead {
        font-size: 1rem;
    }
    
    .cta-box {
        padding: 2rem !important;
    }
    
    .cta-box .btn-primary {
        padding: 12px 30px !important;
        font-size: 0.95rem;
    }
    
    /* Contacto */
    #contact .section-title {
        font-size: 1.75rem;
    }
    
    .contact-item {
        padding: 1.25rem;
    }
    
    .contact-icon {
        font-size: 2rem;
    }
    
    #contact h5 {
        font-size: 1rem;
    }
    
    #contact .text-muted {
        font-size: 0.9rem;
    }
    
    /* Botones táctiles */
    .btn {
        min-height: 44px;
    }
    
    .accordion-button {
        min-height: 44px;
    }
}

/* Móviles pequeños */
@media (max-width: 575px) {
    .hero-brand {
        min-height: 50vh;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .search-bar-home {
        margin: 1.5rem 0.75rem 2rem 0.75rem;
        padding: 1rem 0.75rem;
    }
    
    /* Títulos */
    .display-4 {
        font-size: 1.5rem !important;
    }
    
    .display-5 {
        font-size: 1.35rem !important;
    }
    
    h2.section-title {
        font-size: 1.5rem;
    }
    
    /* CTA circles - MÁS PEQUEÑOS */
    .final-cta::before,
    .final-cta::after {
        width: 250px;
        height: 250px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .icon-circle {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .cta-box {
        padding: 1.5rem !important;
    }
    
    .contact-item {
        padding: 1rem;
    }
    
    /* CTA circles - AÚN MÁS PEQUEÑOS */
    .final-cta::before,
    .final-cta::after {
        width: 200px;
        height: 200px;
    }
}

/* Landscape móvil */
@media (max-width: 767px) and (orientation: landscape) {
    .hero-brand {
        min-height: 100vh;
    }
}

/* ===========================
   MEJORAS "CÓMO FUNCIONA"
=========================== */

/* Separador decorativo entre secciones */
.section-separator {
    height: 1px;
    max-width: 600px;
    margin: 4rem auto;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--primary-rgb), 0.3),
        transparent
    );
    position: relative;
}

.section-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.section-separator::after {
    content: '⚡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    z-index: 1;
}

/* Sección mejorada */
.how-it-works-enhanced {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

/* Card container grande */
.how-it-works-card {
    background: white;
    border-radius: var(--card-border-radius);
    padding: 3rem 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    position: relative;
    overflow: hidden;
}

/* Decoración sutil de fondo */
.how-it-works-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(
        circle,
        rgba(var(--primary-rgb), 0.03) 0%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
}

.how-it-works-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 350px;
    height: 350px;
    background: radial-gradient(
        circle,
        rgba(var(--primary-rgb), 0.03) 0%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
}

/* Badge con ícono */
.section-icon-badge {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    animation: float 3s ease-in-out infinite;
}

/* Step cards - mejorar hover */
.step-card {
    position: relative;
    z-index: 1;
}

.step-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
    .section-separator {
        margin: 3rem auto;
    }
    
    .section-separator::before {
        width: 32px;
        height: 32px;
    }
    
    .section-separator::after {
        font-size: 1rem;
    }
    
    .how-it-works-card {
        padding: 2rem 1.25rem;
    }
    
    .section-icon-badge {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }
    
    /* Decoraciones más pequeñas en mobile */
    .how-it-works-card::before,
    .how-it-works-card::after {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 575px) {
    .how-it-works-card::before,
    .how-it-works-card::after {
        width: 200px;
        height: 200px;
    }
}