:root {
    --primary-color: #0056b3;
    /* Dark Blue */
    --secondary-color: #ffc107;
    /* Yellow/Gold */
    --accent-color: #17a2b8;
    /* Cyan/Teal */
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --text-color: #333;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: #f4f7f6;
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    background-color: #ffffff;
    /* Clean white */
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--dark-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #eee;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #0d2e4e;
}

.navbar-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.navbar-menu a {
    color: #0d2e4e;
    margin-left: 20px;
    font-weight: 500;
}

.navbar-menu a:hover {
    color: var(--primary-color);
}

.btn-publish {
    background-color: var(--secondary-color);
    color: var(--dark-color);
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    margin-left: 20px;
}

.btn-publish:hover {
    background-color: #e0a800;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(13, 46, 78, 0.8), rgba(13, 46, 78, 0.8)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    padding: 4rem 2rem;
    text-align: center;
    color: white;
}

.search-bar {
    max-width: 600px;
    margin: 2rem auto;
    display: flex;
    background: white;
    border-radius: 50px;
    padding: 5px;
}

.search-input {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px 0 0 50px;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    background-color: var(--secondary-color);
    border: none;
    padding: 0 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    color: var(--dark-color);
}

/* Categories */
.categories-section {
    padding: 3rem 2rem;
    text-align: center;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.category-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Colors for categories (example) */
.cat-restaurantes .category-icon {
    color: #ff5733;
}

.cat-hoteles .category-icon {
    color: #33c1ff;
}

.cat-ropa .category-icon {
    color: #d633ff;
}

/* Listings Grid */
.listings-section {
    padding: 3rem 2rem;
    background-color: #f8f9fa;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .listings-grid {
        grid-template-columns: 1fr !important;
        /* Force single column on mobile */
    }
}

.listing-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.listing-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.listing-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.listing-content {
    padding: 1.5rem;
}

.listing-cat-badge {
    text-transform: uppercase;
    font-size: 0.75rem;
    background: #eef1f6;
    color: #666;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.listing-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.listing-price {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Featured Section */
.featured-section {
    padding: 3rem 2rem;
    background: white;
}

.featured-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.featured-main {
    flex: 2;
    min-width: 0;
    /* Changed from 300px to allow shrinking */
}

.featured-sidebar {
    flex: 1;
    min-width: 0;
    /* Changed from 250px to allow shrinking */
}

.ad-banner-vertical {
    background: #FFEB3B;
    /* Yellow banner */
    padding: 2rem;
    text-align: center;
    border-radius: 10px;
    height: 100%;
}

/* Footer */
.footer {
    background: #0d2e4e;
    color: white;
    /* Changed from text-gray-400 to white for readability on dark bg */
    padding: 3rem 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-col h4 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 1rem;
    /* Spacing between links */
}

.footer-col a:hover {
    color: var(--secondary-color);
    /* Hover effect */
}

/* Carousel */
.carousel-container {
    position: relative;
    width: 100%;
    height: 500px;
    /* Increased height as requested */
    overflow: hidden;
    background: #000;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Keeps the banner filling the area */
    object-position: center;
    /* Centers the image content */
}

/* Search Overlay */
.search-overlay {
    position: absolute;
    bottom: 40px;
    /* Slightly higher */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 90%;
    max-width: 800px;
    /* Wider search bar */
}

.search-bar-pill {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    /* Slightly transparent */
    backdrop-filter: blur(10px);
    /* Glass effect */
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    /* Deep shadow */
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.search-input-pill {
    flex: 1;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    outline: none;
    border-radius: 50px 0 0 50px;
    background: transparent;
    color: #333;
}

.search-btn-pill {
    background: linear-gradient(45deg, var(--secondary-color), #ffca28);
    color: var(--dark-color);
    border: none;
    padding: 0 3rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 800;
    /* Bolder text */
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.search-btn-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.6);
    background: linear-gradient(45deg, #e0a800, var(--secondary-color));
}

/* Carousel Navigation */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    z-index: 5;
    transition: background 0.3s ease;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    /* Centering icon */
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(255, 193, 7, 0.8);
    /* Secondary color hover */
    color: #000;
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* Search Container below Carousel */
.main-search-container {
    background: var(--primary-color);
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.main-search-container h1 {
    color: white;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.main-search-container p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
        text-align: center;
    }

    .navbar-brand {
        margin-bottom: 1rem;
        justify-content: center;
    }

    .menu-toggle {
        display: block;
        margin-bottom: 0.5rem;
    }

    .navbar-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background: white;
        position: static;
        /* Remove absolute positioning */
        box-shadow: none;
        padding: 0;
        z-index: 1000;
        border-top: 1px solid #eee;
        padding-top: 1rem;
    }

    .navbar-menu.active {
        display: flex;
    }

    .navbar-menu a {
        margin: 8px 0;
        margin-left: 0 !important;
        width: 100%;
        text-align: center;
    }

    .btn-publish {
        margin-left: 0;
        margin-top: 5px;
        display: inline-block;
        width: auto;
    }
}

/* Layouts */
.sidebar-ad {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s;
}

.sidebar-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-ad img {
    width: 100%;
    max-width: 450px;
    /* Cap size on mobile/tablets */
    display: block;
    margin: 0 auto 1rem auto;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .sidebar-ad img {
        max-width: 100%;
        /* Allow to fill mobile width but up to the container's max */
    }
}


/* Categories */
.categories-section {
    background: #f8f9fa;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.8rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 12px;
    margin-top: 0.8rem;
}

.social-icons a {
    font-size: 1.4rem;
    transition: transform 0.2s;
}

.social-icons a:hover {
    transform: scale(1.2);
}

/* Section Headers */
.section-header {
    margin-top: 0;
    color: #333;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 8px;
    display: inline-block;
    margin-bottom: 1.5rem;
}

/* Category Cards Improvement */
.category-card {
    background: white;
    padding: 1rem 0.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.category-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

/* Promo Section */
.featured-main {
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .carousel-container {
        height: 300px;
    }

    .search-overlay {
        bottom: 20px;
    }

    .search-input-pill {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }

    .search-btn-pill {
        padding: 0 1.5rem;
        font-size: 0.9rem;
    }
}