.ad-unit {
    position: relative;
    display: block;
    border-radius: var(--radius-sm, 12px);
    overflow: hidden;
    background: var(--surface, #fff);
    box-shadow: var(--shadow-soft, 0 8px 24px rgba(0, 0, 0, .08));
}

.ad-unit .ad-link {
    display: block;
    aspect-ratio: var(--ad-ratio, auto);
    background: var(--surface-2, #f3efe8);
}

.ad-unit img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.22, 1, .36, 1);
}

.ad-unit:hover img {
    transform: scale(1.02);
}

.ad-label {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.7;
    letter-spacing: .08em;
    color: #fff;
    background: rgba(20, 20, 22, .78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}

.ad-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: #fff;
    background: rgba(20, 20, 22, .6);
    cursor: pointer;
}

.ad-close:hover {
    background: rgba(20, 20, 22, .85);
}

.ad-banner {
    width: 100%;
    max-width: var(--container, 1240px);
    margin-left: auto;
    margin-right: auto;
}

.ad-rail {
    position: fixed;
    top: max(150px, calc(50vh - 260px));
    z-index: 30;
    width: 160px;
    display: none;
}

.ad-rail.ad-side-left {
    left: max(8px, calc(50% - 620px - 172px));
}

.ad-rail.ad-side-right {
    right: max(8px, calc(50% - 620px - 172px));
}

@media (min-width: 1560px) {
    .ad-rail {
        display: block;
    }
}

.ad-sticky {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 46;
    display: none;
    animation: adSlideUp .45s cubic-bezier(.22, 1, .36, 1);
}

@media (max-width: 900px) {
    .ad-sticky {
        display: block;
    }
}

.ad-device-desktop.ad-banner {
    display: block;
}

@media (max-width: 900px) {
    .ad-device-desktop.ad-banner {
        display: none;
    }
}

@media (min-width: 901px) {
    .ad-device-mobile.ad-banner {
        display: none;
    }
}

.ad-popup {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 15, 17, .55);
    opacity: 0;
    transition: opacity .3s;
}

.ad-popup.is-open {
    opacity: 1;
}

.ad-popup-box {
    position: relative;
    width: min(440px, 100%);
    transform: translateY(16px) scale(.96);
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
}

.ad-popup.is-open .ad-popup-box {
    transform: none;
}

.ad-popup .ad-close {
    top: -14px;
    right: -14px;
    background: var(--ink, #1d1d1f);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}

.ad-popup-unit {
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}

.ad-native .ad-badge {
    color: var(--ink, #1d1d1f);
    background: var(--surface, #fff);
    border: 1px solid var(--line, #e3ddd2);
    letter-spacing: .1em;
}

.ad-native .pcard-cat {
    color: var(--brand-ink, #b4421a);
}

.ad-cta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--brand-ink, #b4421a);
    border: 1px solid currentColor;
}

.ad-cta:hover {
    color: #fff;
    background: var(--brand, #e8501a);
    border-color: var(--brand, #e8501a);
}

.ad-list-top,
.ad-member-banner {
    margin-top: 0;
    margin-bottom: 24px;
}

.ad-cart-banner {
    margin-top: 24px;
}

.ad-footer-banner {
    width: calc(100% - 32px);
    margin-top: 40px;
}

@media (max-width: 900px) {
    .has-ad-sticky .site-footer {
        padding-bottom: calc(80px + var(--ad-sticky-h, 64px));
    }

    .has-ad-sticky .theme-fab {
        bottom: calc(92px + var(--ad-sticky-h, 64px));
    }

    .has-ad-sticky .theme-panel {
        bottom: calc(144px + var(--ad-sticky-h, 64px));
    }
}

@keyframes adSlideUp {
    from {
        transform: translateY(120%);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ad-sticky,
    .ad-popup,
    .ad-popup-box,
    .ad-unit img {
        animation: none;
        transition: none;
    }
}

.ad-sticky .ad-label {
    left: 6px;
    right: auto;
    bottom: 6px;
}

@media (max-width: 640px) {
    .ad-label {
        right: 6px;
        bottom: 6px;
        padding: 0 6px;
        font-size: 10px;
    }

    .ad-sticky .ad-close {
        top: 50%;
        transform: translateY(-50%);
        width: 26px;
        height: 26px;
        font-size: 15px;
    }
}
