/* =======================
   VARIABLES Y ESTILOS GLOBALES
   ======================== */
:root {
    --color-primary: #0A2463;
    --color-secondary: #3E92CC;
    --color-dark: #343A40;
    --color-light: #F8F9FA;
    --color-white: #FFFFFF;
    --color-accent: #FFC107;
    /* Amarillo para estrellas de rating */
    --font-family: 'Poppins', sans-serif;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-light);
    color: var(--color-dark);
    line-height: 1.6;
}

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

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 50px;
    font-weight: 600;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: var(--color-secondary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary);
}

ul {
    list-style: none;
}

/* =======================
   HEADER Y NAVEGACIÓN
   ======================== */
.header {
    background-color: var(--color-primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 600;
}

.logo-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--color-light);
    font-weight: 500;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-white);
    border-bottom-color: var(--color-secondary);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.8rem;
    cursor: pointer;
}

/* =======================
   HERO SECTION
   ======================== */
.hero-section {
    background: linear-gradient(rgba(10, 36, 99, 0.8), rgba(10, 36, 99, 0.8)), url('https://images.unsplash.com/photo-1560518883-ce09059eeffa?q=80&w=1973&auto=format&fit=crop') no-repeat center center/cover;
    color: var(--color-white);
    padding: 120px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    font-weight: 300;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.search-bar {
    display: flex;
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.search-bar input {
    flex-grow: 1;
    border: none;
    padding: 15px 20px;
    font-size: 1rem;
    outline: none;
}

.search-bar button {
    background-color: var(--color-secondary);
    color: var(--color-white);
    border: none;
    padding: 0 25px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s ease;
}

.search-bar button:hover {
    background-color: #357DAD;
}


/* =======================
   FEATURED SECTION
   ======================== */
.featured-section {
    padding: 80px 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.business-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.business-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-image {
    position: relative;
    height: 220px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rating {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--color-white);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rating .fa-star {
    color: var(--color-accent);
}

.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.4rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.card-content .address,
.card-content .phone {
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    margin-top: auto;
    /* Pushes tags to the bottom before the button */
}

.services span {
    background-color: var(--color-light);
    color: var(--color-secondary);
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 500;
}

.btn-primary {
    display: block;
    background-color: var(--color-secondary);
    color: var(--color-white);
    text-align: center;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #357DAD;
    color: var(--color-white);
}

/* =======================
   HOW IT WORKS SECTION
   ======================== */
.how-it-works-section {
    padding: 80px 0;
    background-color: var(--color-white);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    text-align: center;
}

.step-icon {
    font-size: 3rem;
    color: var(--color-secondary);
    margin-bottom: 20px;
    display: inline-block;
    width: 80px;
    height: 80px;
    line-height: 80px;
    background-color: #E8F4FD;
    border-radius: 50%;
}

.step h3 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

/* =======================
   NEIGHBORHOODS SECTION
   ======================== */
.neighborhoods-section {
    padding: 80px 0;
}

.neighborhoods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.neighborhood-card {
    position: relative;
    height: 300px;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    color: var(--color-white);
    transition: transform 0.3s ease;
}

.neighborhood-card:hover {
    transform: scale(1.05);
}

.neighborhood-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.neighborhood-card .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 2;
}

.neighborhood-card span {
    position: relative;
    z-index: 3;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}


/* =======================
   FOOTER
   ======================== */
.footer {
    background-color: var(--color-primary);
    color: var(--color-light);
    padding-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}

.footer-about .logo {
    margin-bottom: 15px;
}

.footer-about p {
    font-weight: 300;
}

.footer h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-white);
}

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

.footer-links ul li a {
    color: var(--color-light);
    font-weight: 300;
}

.footer-links ul li a:hover {
    color: var(--color-secondary);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    color: var(--color-white);
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--color-secondary);
}

.footer-bottom {
    border-top: 1px solid #1c3a8e;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 300;
}

/* =======================
   RESPONSIVE DESIGN (MOBILE-FIRST)
   ======================== */

/* Para tablets */
@media (max-width: 992px) {
    .section-title {
        font-size: 2.2rem;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .neighborhoods-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Para móviles grandes */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        /* Se ocultará y se manejará con JS */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--color-primary);
        flex-direction: column;
        padding: 20px 0;
        text-align: center;
    }

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

    .nav-link {
        padding: 10px 0;
        display: block;
    }

    .hamburger {
        display: block;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-bar button span {
        display: inline;
    }

    .search-bar button {
        justify-content: center;
        padding: 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }
}

/* Para móviles pequeños */
@media (max-width: 480px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .neighborhoods-grid {
        grid-template-columns: 1fr;
    }

    .neighborhood-card {
        height: 250px;
    }

    .search-bar button span {
        display: none;
    }

    .search-bar button i {
        font-size: 1.2rem;
    }
}



/* =======================
   ESTILOS PÁGINA DE BÚSQUEDA
   ======================== */
.page-container {
    padding: 60px 0;
}

.search-page-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

.filters-sidebar {
    background: var(--color-white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
}

.filters-sidebar h3 {
    color: var(--color-primary);
    margin-bottom: 25px;
    border-bottom: 2px solid var(--color-light);
    padding-bottom: 15px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
}

.filter-group select,
.filter-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    margin-bottom: 8px;
}

.results-section h2 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 30px;
}

.business-list-item {
    background: var(--color-white);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    display: flex;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.business-list-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.list-item-image {
    flex: 0 0 250px;
}

.list-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.list-item-content {
    padding: 20px;
    flex-grow: 1;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.content-header h3 {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.list-item-action {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    border-left: 1px solid var(--color-light);
}

.btn-secondary {
    display: block;
    background-color: #6c757d;
    color: var(--color-white);
    text-align: center;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: var(--color-white);
}

.no-results {
    background-color: #fff3cd;
    color: #664d03;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

/* Responsive para la página de búsqueda */
@media(max-width: 992px) {
    .search-page-layout {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 768px) {
    .business-list-item {
        flex-direction: column;
    }

    .list-item-image {
        flex-basis: 220px;
    }

    .list-item-image img {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .list-item-action {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid var(--color-light);
    }

    .list-item-action a {
        flex-grow: 1;
    }
}




/* =======================
   ESTILOS PÁGINA DE PERFIL
   ======================== */

.profile-header {
    height: 350px;
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    padding: 20px;
}

.profile-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.profile-header .rating {
    background-color: transparent;
    font-size: 1.5rem;
    margin-top: 10px;
}

.profile-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    margin-top: -60px;
    /* Para que el contenido se solape con el header */
    position: relative;
    z-index: 10;
}

.profile-main {
    background: var(--color-white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.profile-main h2 {
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-light);
}

.profile-main ul {
    list-style: none;
    margin-bottom: 30px;
}

.profile-main ul li {
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-main ul li i {
    color: var(--color-secondary);
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.services.large span {
    font-size: 1rem;
    padding: 8px 15px;
}

.map-placeholder {
    width: 100%;
    height: 450px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-top: 20px;
}

.profile-sidebar {
    background: var(--color-white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
}

.profile-sidebar h3 {
    color: var(--color-primary);
    margin-bottom: 20px;
}

.full-width {
    display: block;
    width: 100%;
    margin-bottom: 15px;
}

/* Responsive para la página de perfil */
@media(max-width: 992px) {
    .profile-body {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        grid-row: 1;
        /* Mover el sidebar arriba en mobile */
    }
}

@media(max-width: 768px) {
    .profile-header h1 {
        font-size: 2.5rem;
    }
}