body {
    background: radial-gradient(
            1200px 800px at 50% 20%,
            rgba(8, 122, 200, 0.1) 0%,
            transparent 65%
        ),
        linear-gradient(
            135deg,
            #001225 0%,
            #022a53 35%,
            #074d85 65%,
            #0a6bb1 85%,
            #022a53 100%
        );
    background-size: 180% 180%, 200% 200%;
    background-attachment: fixed;
    animation: unifiedGradientShift 30s ease-in-out infinite;
    min-height: 100vh;
}

@keyframes unifiedGradientShift {
    0% {
        background-position: center center, 0% 50%;
    }
    50% {
        background-position: center center, 100% 50%;
    }
    100% {
        background-position: center center, 0% 50%;
    }
}

/* Novedades controls - aligned to Estadísticas styling */
.novedades-controls-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* GRID LAYOUT */
.novedades-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* 2 columns on tablet/desktop */
@media (min-width: 768px) {
    .novedades-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* FEATURED CARD — first item visually bigger */
.novedades-card.featured {
    grid-column: 1 / -1; /* spans full width */
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
    padding: 1rem;
    border-radius: 14px;
    overflow: hidden;
}

/* Featured on mobile → single column */
@media (max-width: 767px) {
    .novedades-card.featured {
        grid-template-columns: 1fr;
    }
}

/* Featured image */
.novedades-card.featured .card-img-top {
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Normal cards */
.novedades-card {
    background: #111;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.novedades-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgb(0 0 0 / 40%);
}

/* Image shared */
.card-image-container {
    overflow: hidden;
    border-radius: 12px;
}
.card-img-top {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* Featured body */
.novedades-card.featured .card-body {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Title */
.card-title {
    color: #fff;
}

/* Excerpt */
.card-excerpt {
    color: #bbbbbb;
    font-size: 0.95rem;
}

/* Category badge */
.card-badge {
    backdrop-filter: blur(4px);
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Date */
.card-date {
    color: #ccc;
}

.novedades-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding-bottom: 60%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.novedades-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(
        90deg,
        #3b82f6 0%,
        #1d4ed8 30%,
        #3b82f6 70%,
        #1d4ed8 100%
    );
    border-radius: 20px 20px 0 0;
    opacity: 1;
    transition: all 0.4s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.novedades-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(14, 165, 233, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(255, 255, 255, 0.1),
        inset 2px 0 0 rgba(255, 255, 255, 0.1),
        inset -2px 0 0 rgba(255, 255, 255, 0.05);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-container {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: fit-content;
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    transition: all 0.25s ease;
    color: #e5e7eb;
}

.search-container:focus-within {
    border-color: rgba(96, 213, 248, 0.35);
    box-shadow: 0 0 16px rgba(14, 165, 233, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.search-icon {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin-right: 0.5rem;
}

.novedades-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: #f8fafc;
    outline: none;
    padding: 0.35rem 0;
    font-size: 0.98rem;
}

.novedades-search-input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.icono-borrar {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0 0.25rem;
}

.icono-borrar:hover {
    color: rgba(255, 255, 255, 0.9);
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filters-group {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.filter-btn {
    border: none;
    background: transparent;
    color: #e5e7eb;
    padding: 0.55rem 0.9rem;
    font-size: 0.92rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
    font-weight: 600;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.filter-btn.active {
    background: linear-gradient(
        135deg,
        rgba(14, 165, 233, 1) 0%,
        rgba(59, 130, 246, 0.95) 100%
    );
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
    border: 1px solid rgba(96, 213, 248, 0.4);
}

.sort-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sort-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.04em;
}

.novedades-sort-select {
    padding: 0.65rem 2.4rem 0.65rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    min-width: 170px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='rgba(255,255,255,0.65)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: all 0.25s ease;
}

.novedades-sort-select:focus {
    outline: none;
    border-color: rgba(96, 213, 248, 0.4);
    box-shadow: 0 0 14px rgba(14, 165, 233, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

.novedades-sort-select option {
    background: #022a53;
    color: #ffffff;
}

.novedades-empty {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* RESET featured on mobile to avoid stretching */
@media (max-width: 767px) {
    .novedades-card.featured {
        padding: 16px;
        grid-template-columns: 1fr !important;
        min-height: auto;
    }
}

@media (min-width: 1440px) {
    .novedades-main-section {
        padding: 0 275px;
    }
}
@media (max-width: 768px) {
    .novedades-controls-wrapper {
        flex-direction: column;
        padding: 0.9rem;
    }

    .sort-container {
        justify-content: space-between;
        width: 100%;
    }
    .filters-group {
        width: 100%;
        justify-content: center;
    }
    .sort-select-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    .novedades-sort-select {
        width: 100%;
        min-width: 0;
    }
}
