/* Shared Top ads section (store + brand detail overview) */

.std-top-ads-section {
    margin-top: 0;
}

.std-top-ads-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 12;
}

.std-top-ads-heading-wrap {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 12;
}

.std-top-ads-heading-wrap [id$="-heading"] {
    margin: 0 !important;
}

.std-top-ads-active-platform-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-left: 0.35em;
    font-weight: inherit;
    color: inherit;
}

.std-top-ads-active-platform__sep {
    margin-right: 0.35em;
}

.std-top-ads-active-platform__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.std-top-ads-active-platform__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    object-fit: contain;
}

.std-top-ads-active-platform__icon--svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.std-top-ads-active-platform__icon--svg svg {
    width: 22px;
    height: 22px;
    display: block;
}

.std-top-ads-title-row .std-similar-shops-see-all {
    align-self: flex-start;
    flex-shrink: 0;
}

.std-top-ads-platform-switcher {
    display: inline-flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
}

.std-top-ads-platform-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    color: #52525c;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.std-top-ads-platform-btn:hover {
    background: #fff;
    color: #18181b;
}

.std-top-ads-platform-btn.is-active {
    background: #fff;
    color: #18181b;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.std-top-ads-platform-btn:focus-visible {
    outline: 2px solid #225aea;
    outline-offset: 1px;
}

.std-top-ads-platform-btn__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    object-fit: contain;
}

.std-top-ads-platform-btn__icon--svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.std-top-ads-platform-btn__icon--svg svg {
    width: 16px;
    height: 16px;
    display: block;
}

.std-top-ads-platform-btn__count,
.std-top-ads-active-platform__count {
    color: #71717a;
    font-weight: 500;
}

.std-top-ads-controls-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1 1 100%;
    min-width: 0;
}

.std-top-ads-sort-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
}

.std-top-ads-sort-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #000000;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    padding: 8px 10px;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.std-top-ads-sort-btn:hover {
    color: #0f172a;
}

.std-top-ads-sort-btn.is-active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.std-top-ads-sort-btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.std-top-ads-heading-wrap .std-active-ads-pages,
.std-top-ads-pages-selector {
    margin-top: 0;
}

.std-top-ads-pages-selector.std-active-ads-pages {
    position: relative;
}

.std-top-ads-pages-selector .std-active-ads-pages-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: min(100%, 220px);
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
}

.std-top-ads-pages-selector .std-active-ads-pages-trigger__label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    min-width: 0;
}

.std-top-ads-pages-selector .std-active-ads-pages-trigger__label-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.std-top-ads-pages-selector .std-active-ads-pages-trigger__avatar {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.std-top-ads-pages-selector .std-active-ads-pages-trigger__chevron {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    color: #64748b;
}

.std-top-ads-pages-selector .std-active-ads-pages-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    min-width: 240px;
    max-width: min(92vw, 320px);
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.std-top-ads-pages-selector .std-active-ads-pages-menu[hidden] {
    display: none !important;
}

.std-top-ads-pages-selector button.std-active-ads-pages-option {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.std-top-ads-pages-selector button.std-active-ads-pages-option:hover {
    background: #f8fafc;
}

.std-top-ads-pages-selector button.std-active-ads-pages-option.is-selected {
    background: #eff6ff;
}

.std-top-ads-pages-selector .std-active-ads-pages-option__avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.std-top-ads-pages-selector .std-active-ads-pages-option__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
    flex: 1 1 auto;
}

.std-top-ads-pages-selector .std-active-ads-pages-option__name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 0;
}

.std-top-ads-pages-selector .std-active-ads-pages-option__name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.std-top-ads-pages-selector .std-active-ads-pages-option__meta {
    font-size: 0.625rem;
    font-weight: 600;
    color: #5b6b82;
}

.std-top-ads-loader,
.std-top-ads-empty {
    text-align: center;
    padding: 36px 18px;
    color: #000000;
    font-size: 0.875rem;
    font-weight: 500;
}

[id$="-card"].std-top-ads-section {
    position: relative;
    z-index: 5;
    min-width: 0;
    overflow: visible;
}

[id$="-list"].std-top-ads-list.add_list {
    margin-top: 15px;
    display: flex !important;
    flex-wrap: nowrap;
    gap: 12px;
    grid-template-columns: unset !important;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    direction: ltr;
    position: relative;
    z-index: 1;
}

[id$="-list"].std-top-ads-list.add_list > * {
    flex: 0 0 clamp(255px, 18vw, 310px);
    min-width: 0;
    max-width: clamp(255px, 18vw, 310px);
    scroll-snap-align: start;
}

[id$="-card"].std-top-ads-section.is-popup-open {
    z-index: 50;
}

[id$="-list"].std-top-ads-list.add_list > .one_add_wrapper:has(.has-popup:hover) {
    z-index: 20;
}

[id$="-list"].std-top-ads-list.add_list .one_add_wrapper .has-popup:hover {
    z-index: 21;
}

[id$="-list"].std-top-ads-list.add_list .one_add_wrapper .custom-popup {
    z-index: 10050 !important;
}

[id$="-list"].std-top-ads-list.add_list > .one_add_wrapper .add_item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

[id$="-list"].std-top-ads-list.add_list .video-2 > .flex.justify-center,
[id$="-list"].std-top-ads-list.add_list .video-2 .glide,
[id$="-list"].std-top-ads-list.add_list .video-2 .glide__track {
    width: 100% !important;
    max-width: 100% !important;
}

[id$="-list"].std-top-ads-list.add_list .video-2 .glide__slide > img {
    max-width: 100%;
    object-fit: contain;
}

[id$="-list"].std-top-ads-list.add_list > .one_add_wrapper .add_info.fw-ad-card-info-tiles.fw-ad-card-info-tiles--under-eu {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

[id$="-list"].std-top-ads-list::-webkit-scrollbar {
    height: 8px;
}

[id$="-list"].std-top-ads-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

[id$="-list"].std-top-ads-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

@media screen and (max-width: 767px) {
    .std-top-ads-title-row {
        flex-direction: column;
        align-items: stretch;
    }

    .std-top-ads-title-row .std-similar-shops-see-all {
        align-self: flex-end;
    }

    .std-top-ads-sort-controls {
        margin-top: 12px;
        max-width: 100%;
        overflow-x: auto;
    }

    .std-top-ads-controls-row {
        margin-top: 12px;
        max-width: 100%;
    }

    .std-top-ads-controls-row .std-top-ads-sort-controls {
        margin-top: 0;
    }

    [id$="-list"].std-top-ads-list.add_list > .one_add_wrapper {
        flex-basis: min(82vw, 310px);
        max-width: min(82vw, 310px);
    }
}

.brand-top-ads-wrap {
    margin-bottom: 16px;
}

.brand-top-ads-wrap .std-top-ads-section {
    border-radius: 12px;
    padding: 16px;
}
