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

:root {
    --coral: #E87461;
    --peach: #F5A962;
    --yellow: #E8D174;
    --teal: #4FA897;
    --dark-blue: #2C4A52;
    --light-gray: #F5F5F5;
    --ads-safe-gap: 16px;
    --ads-top-inset: 0px;
    --ads-bottom-inset: 0px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-blue);
    background-color: var(--light-gray);
}

/* Main Container */
.main-container {
    max-width: 1680px;
    margin: 2rem auto;
    padding: 0 clamp(1rem, 2vw, 2rem);
    display: grid;
    grid-template-columns: clamp(150px, 16vw, 210px) minmax(0, 1fr) clamp(150px, 16vw, 210px);
    gap: clamp(0.5rem, 1vw, 1rem);
    transition: all 0.3s ease;
}

/* Sidebar Ads */
.ad-sidebar {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: calc(var(--ads-top-inset) + var(--ads-safe-gap));
    height: calc(100vh - var(--ads-top-inset) - var(--ads-bottom-inset) - var(--ads-safe-gap) - var(--ads-safe-gap));
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-self: center;
    width: 100%;
}

.ad-sidebar h3 {
    color: var(--dark-blue);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.ad-sidebar .adsbygoogle {
    width: 100%;
}

.ad-space {
    background: linear-gradient(135deg, var(--peach), var(--yellow));
    height: 600px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-align: center;
}

/* Main Content */
.content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 {
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
}

.home-hero h1 {
    background: linear-gradient(135deg, var(--coral), var(--peach));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.content-header p {
    color: var(--teal);
    font-size: 1.1rem;
}

/* Search Container */
.search-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 165px) minmax(110px, 150px);
    gap: 0.75rem;
    margin-bottom: 2rem;
    align-items: center;
}

.search-field {
    position: relative;
    min-width: 0;
}

.search-field .search-input {
    min-width: 0;
    padding: 0.95rem 1.4rem;
    padding-right: 3.1rem;
    border: 2px solid var(--teal);
    border-radius: 25px;
    font-size: 1rem;
    color: var(--dark-blue);
    outline: none;
    transition: all 0.3s;
    width: 100%;
}

.search-field .search-input::placeholder {
    color: var(--dark-blue);
    opacity: 0.65;
}

.search-field .search-input:focus {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(232, 116, 97, 0.1);
}

.search-field .search-btn {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: var(--teal);
    color: white;
    border: none;
    border-radius: 9999px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-dropdown,
.sort-dropdown {
    position: relative;
    width: 100%;
    min-width: 0;
}

.native-select {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.category-trigger,
.sort-trigger {
    padding: 0.85rem 0.95rem;
    border: 2px solid var(--teal);
    border-radius: 9999px;
    background: white;
    color: var(--dark-blue);
    font-size: 0.92rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    min-width: 0;
    width: 100%;
    line-height: 1.2;
    text-align: left;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%232C4A52' d='M7 10l5 5l5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 1.95rem;
}

.category-trigger:hover,
.category-trigger:focus,
.sort-trigger:hover,
.sort-trigger:focus {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(232, 116, 97, 0.1);
}

.category-panel,
.sort-panel {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--teal);
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
    max-height: 14.5rem;
    overflow-y: auto;
    padding: 0.35rem;
    z-index: 2000;
}

.category-dropdown.is-open .category-panel {
    display: block;
}

.sort-dropdown.is-open .sort-panel {
    display: block;
}

.category-option,
.sort-option {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--dark-blue);
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1.2;
}

.category-option:hover,
.category-option:focus,
.sort-option:hover,
.sort-option:focus {
    outline: none;
    background: rgba(79, 168, 151, 0.12);
}

.category-option.is-selected,
.sort-option.is-selected {
    background: rgba(79, 168, 151, 0.18);
    font-weight: 700;
}

.category-select,
.sort-select {
    padding: 0.85rem 0.95rem;
    border: 2px solid var(--teal);
    border-radius: 9999px;
    background: white;
    color: var(--dark-blue);
    font-size: 0.92rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    min-width: 0;
    width: 100%;
    line-height: 1.2;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%232C4A52' d='M7 10l5 5l5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 1.95rem;
}

.category-select:hover,
.sort-select:hover,
.category-select:focus,
.sort-select:focus {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(232, 116, 97, 0.1);
}

.search-field .search-btn:hover {
    background: var(--dark-blue);
}

/* Top Banner Ad */
.ad-banner-top {
    background: linear-gradient(90deg, var(--coral), var(--peach));
    height: 120px;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Filters Section */
.filters-section {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h3 {
    color: var(--dark-blue);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--teal);
    background: white;
    color: var(--teal);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: var(--teal);
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--teal);
    color: white;
}

/* Sort Container */
.sort-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.sort-container label {
    color: var(--dark-blue);
    font-weight: 600;
}

.sort-container .sort-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--teal);
    border-radius: 8px;
    background: white;
    color: var(--dark-blue);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
}

.sort-container .sort-select:hover,
.sort-container .sort-select:focus {
    border-color: var(--coral);
}

/* Results Info */
.results-info {
    margin-bottom: 1.5rem;
    color: var(--dark-blue);
    font-weight: 600;
}

/* Bottom Banner Ad */
.ad-banner-bottom {
    background: linear-gradient(90deg, var(--yellow), var(--teal));
    height: 100px;
    border-radius: 8px;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Responsive Design */
/* Large Screens */
@media (min-width: 1440px) {
    .main-container {
        max-width: 1760px;
        padding: 0 clamp(2rem, 4vw, 4rem);
    }
}

/* Laptops / Tablets Landscape */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: clamp(150px, 22vw, 200px) minmax(0, 1fr);
        padding: 0 1.5rem;
        gap: 1rem;
    }

    .ad-sidebar:last-of-type {
        display: none;
    }
}

/* Tablets Portrait */
@media (max-width: 992px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .ad-sidebar {
        display: none;
    }
    
    .content {
        padding: 1.5rem;
    }

    .search-container {
        margin-bottom: 1.5rem;
    }
}

/* Mobiles */
@media (max-width: 768px) {
    .main-container {
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .content {
        padding: 1.25rem;
    }

    .content-header h1 {
        font-size: 1.75rem;
    }

    .search-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .search-field {
        grid-column: 1 / -1;
        width: 100%;
    }

    .search-field .search-input {
        width: 100%;
        padding: 0.75rem 1.25rem;
        padding-right: 3.1rem;
    }

    .category-select,
    .sort-select {
        width: 100%;
        padding: 0.75rem 1.25rem;
    }

    .search-field .search-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    .filters-section {
        padding: 1rem;
    }

    .filters {
        gap: 0.5rem;
        justify-content: center;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
        flex: 1 1 auto;
        text-align: center;
    }

    .sort-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .sort-select {
        width: 100%;
    }

    .ad-banner-top, .ad-banner-bottom {
        height: 80px;
        font-size: 1rem;
    }
}

/* Smaller Mobiles */
@media (max-width: 480px) {
    .content-header h1 {
        font-size: 1.5rem;
    }

    .filter-btn {
        width: 100%;
    }
}

/* Botón de Jugar */
.play-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--coral), var(--peach));
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(232, 116, 97, 0.3);
}

.play-btn:hover {
    background: linear-gradient(135deg, var(--peach), var(--coral));
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(232, 116, 97, 0.4);
}

.play-btn:active {
    transform: translateY(0);
}
