/* Anuncios del directorio: overlay animado + modal */
.dir-ads {
    padding: 1.25rem 0 1.75rem;
    background:
        linear-gradient(180deg, #f4f7fc 0%, #fff 100%);
    border-bottom: 1px solid rgba(15, 27, 45, 0.06);
}
.dir-ads-shell {
    width: min(90%, 1140px);
    margin: 0 auto;
}
.dir-ads-head {
    margin-bottom: 0.85rem;
}
.dir-ads-kicker {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1e6fd9;
}
.dir-ads-heading {
    margin: 0.15rem 0 0;
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    font-weight: 900;
    color: #0f1b2d;
    letter-spacing: -0.02em;
}

.dir-ad-slide {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    background: #0f1b2d;
    text-align: left;
    box-shadow: 0 10px 28px rgba(15, 27, 45, 0.1);
    isolation: isolate;
}
.dir-ad-img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 0.7s ease;
}
.dir-ad-slide:hover .dir-ad-img,
.dir-ad-slide:focus-visible .dir-ad-img {
    transform: scale(1.08);
}
.dir-ad-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, rgba(12, 28, 55, 0.78) 0%, rgba(12, 28, 55, 0.15) 55%, rgba(30, 111, 217, 0.35) 100%);
    mix-blend-mode: multiply;
    animation: dirAdShine 4.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes dirAdShine {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}
.dir-ad-title-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.1rem 1.15rem 1.2rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.dir-ad-badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(30, 111, 217, 0.92);
    padding: 0.28rem 0.55rem;
    border-radius: 4px;
    animation: dirAdBadge 2.4s ease-in-out infinite;
}
@keyframes dirAdBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}
.dir-ad-title {
    color: #fff;
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    animation: dirAdTitleIn 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    background: linear-gradient(90deg, #fff 0%, #cfe3ff 40%, #fff 80%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
}
@supports (-webkit-background-clip: text) {
    .dir-ad-title {
        color: transparent;
        animation: dirAdTitleIn 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both, dirAdTitleShimmer 3.2s linear infinite;
    }
}
@keyframes dirAdTitleIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes dirAdTitleShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.dir-results-shell {
    width: min(90%, 1140px);
    margin-left: auto;
    margin-right: auto;
    max-width: 1140px;
}

.dir-search-ad {
    border: 1px solid rgba(15, 27, 45, 0.08);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 27, 45, 0.06);
}
.dir-search-ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
}
.dir-search-ad-link img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.dir-search-ad-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #1e6fd9;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.dir-search-ad-body {
    padding: 0.85rem 1rem 1rem;
}
.dir-search-banner {
    border-radius: 12px;
}

/* Modal */
body.dir-ad-modal-open { overflow: hidden; }
.dir-ad-modal[hidden] { display: none !important; }
.dir-ad-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.dir-ad-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 16, 32, 0.62);
    backdrop-filter: blur(3px);
    animation: dirAdFade 0.25s ease;
}
.dir-ad-modal-dialog {
    position: relative;
    width: min(92vw, 640px);
    max-height: min(90vh, 760px);
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    animation: dirAdPop 0.35s cubic-bezier(0.2, 0.85, 0.25, 1);
    z-index: 1;
}
@keyframes dirAdFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes dirAdPop {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.dir-ad-modal-close {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    z-index: 2;
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 27, 45, 0.72);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}
.dir-ad-modal-img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    display: block;
    background: #e8eef8;
}
.dir-ad-modal-body {
    padding: 1.15rem 1.25rem 1.35rem;
}
.dir-ad-modal-label {
    margin: 0 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #1e6fd9;
}
.dir-ad-modal-body h2 {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 900;
    color: #0f1b2d;
}
.dir-ad-modal-body p {
    margin: 0 0 0.65rem;
    color: #3a4658;
    line-height: 1.5;
}
.dir-ad-modal-meta {
    font-size: 0.85rem;
    color: #6b7788 !important;
}
.dir-ad-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.dir-anuncios-carousel .owl-nav {
    margin-top: 0.5rem;
}

@media (max-width: 600px) {
    .dir-ad-img { height: 190px; }
    .dir-ads-shell { width: min(94%, 1140px); }
}
