.modern-brands-page {
    --brands-green: var(--web-primary, #1b9544);
    --brands-green-dark: #137a38;
    --brands-ink: #20262b;
    --brands-muted: #6b7280;
    --brands-line: #e5eee8;
    --brands-soft: #f4faf6;
    padding-block: 24px 46px;
}

.modern-brands-page .container {
    max-width: 1380px;
}

.modern-brands-hero {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    display: flex;
    align-items: center;
    padding: 22px 28px;
    border: 1px solid rgba(27, 149, 68, .11);
    border-radius: 18px;
    background:
        radial-gradient(circle at 9% 125%, rgba(36, 197, 91, .15) 0 88px, transparent 89px),
        linear-gradient(110deg, rgba(235, 251, 240, .98), #fff 57%, rgba(247, 252, 248, .97));
    box-shadow: 0 12px 34px rgba(15, 55, 31, .06);
}

.modern-brands-hero::after {
    content: "";
    position: absolute;
    inset-inline-end: -65px;
    top: -85px;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(27, 149, 68, .10);
    border-radius: 50%;
    box-shadow:
        0 0 0 22px rgba(27, 149, 68, .025),
        0 0 0 45px rgba(27, 149, 68, .018);
    pointer-events: none;
}

.modern-brands-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    width: 100%;
}

.modern-brands-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.modern-brands-title-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(27, 149, 68, .15);
    border-radius: 13px;
    background: rgba(255, 255, 255, .9);
    color: var(--brands-green);
    box-shadow: 0 8px 20px rgba(27, 149, 68, .09);
}

.modern-brands-title-icon svg {
    width: 25px;
    height: 25px;
}

.modern-brands-title {
    margin: 0 0 4px;
    color: var(--brands-ink);
    font-size: 24px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0;
}

.modern-brands-subtitle {
    margin: 0;
    color: var(--brands-muted);
    font-size: 13px;
    line-height: 1.6;
    font-weight: 500;
}

.modern-brands-search {
    width: min(100%, 440px);
    flex: 0 1 440px;
}

.modern-brands-search-box {
    position: relative;
    display: flex;
    align-items: center;
    height: 50px;
    overflow: hidden;
    border: 1px solid var(--brands-line);
    border-radius: 13px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 8px 22px rgba(18, 32, 25, .055);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.modern-brands-search-box:focus-within {
    border-color: rgba(27, 149, 68, .55);
    box-shadow: 0 0 0 4px rgba(27, 149, 68, .08), 0 10px 24px rgba(18, 32, 25, .06);
}

.modern-brands-search-input {
    width: 100%;
    height: 100%;
    padding: 0 18px;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: var(--brands-ink);
    font-size: 14px;
    box-shadow: none !important;
}

.modern-brands-search-input::placeholder {
    color: #9aa39e;
}

.modern-brands-search-button {
    width: 46px;
    height: 42px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    margin-inline-end: 4px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--brands-green);
    color: #fff;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}

.modern-brands-search-button:hover {
    background: var(--brands-green-dark);
    transform: translateY(-1px);
}

.modern-brands-search-button svg {
    width: 21px;
    height: 21px;
}

.modern-brands-content {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid var(--brands-line);
    border-radius: 22px;
    background:
        radial-gradient(circle at 0 100%, rgba(36, 197, 91, .04) 0 150px, transparent 151px),
        #fff;
    box-shadow: 0 12px 38px rgba(15, 55, 31, .05);
}

.modern-brands-content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modern-brands-content-title {
    margin: 0;
    color: var(--brands-ink);
    font-size: 19px;
    line-height: 1.4;
    font-weight: 700;
}

.modern-brands-count {
    min-width: 34px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    padding-inline: 10px;
    border-radius: 999px;
    background: var(--brands-soft);
    color: var(--brands-green-dark);
    font-size: 12px;
    font-weight: 700;
}

.modern-brands-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 12px;
}

.modern-brand-card {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 160px;
    padding: 11px 9px 10px;
    overflow: hidden;
    border: 1px solid var(--brands-line);
    border-radius: 15px;
    background:
        linear-gradient(145deg, rgba(240, 251, 244, .75) 0%, #fff 43%, #fbfdfb 100%);
    color: var(--brands-ink) !important;
    box-shadow: 0 6px 18px rgba(15, 55, 31, .035);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.modern-brand-card::before {
    content: "";
    position: absolute;
    inset-inline-end: -38px;
    top: -44px;
    width: 102px;
    height: 102px;
    border-radius: 50%;
    background: rgba(36, 197, 91, .075);
    transition: transform .25s ease;
}

.modern-brand-card::after {
    content: "";
    position: absolute;
    inset-inline-start: -50px;
    bottom: -68px;
    width: 132px;
    height: 132px;
    border: 1px solid rgba(27, 149, 68, .08);
    border-radius: 50%;
    box-shadow: 0 0 0 15px rgba(27, 149, 68, .022);
    pointer-events: none;
    transition: transform .3s ease;
}

.modern-brand-card:hover {
    transform: translateY(-5px);
    border-color: rgba(27, 149, 68, .38);
    box-shadow: 0 16px 34px rgba(27, 149, 68, .11);
}

.modern-brand-card:hover::before {
    transform: scale(1.12);
}

.modern-brand-card:hover::after {
    transform: scale(1.08);
}

.modern-brand-logo {
    position: relative;
    z-index: 1;
    width: 100px;
    height: 100px;
    flex: 0 0 100px;
    display: grid;
    place-items: center;
    padding: 3px;
    overflow: hidden;
    border: 1px solid rgba(22, 101, 52, .07);
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .75),
        0 7px 18px rgba(16, 65, 35, .045);
}

.modern-brand-logo img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center;
    border-radius: 10px;
    transition: transform .25s ease;
}

.modern-brand-card:hover .modern-brand-logo img {
    transform: none;
}

.modern-brand-name {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 22px;
    overflow: hidden;
    color: var(--brands-ink);
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    line-height: 1.55;
    font-weight: 600;
}

.modern-brand-arrow {
    position: absolute;
    z-index: 3;
    inset-inline-end: 8px;
    bottom: 8px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #edf9f1;
    color: var(--brands-green);
    font-size: 10px;
    opacity: 0;
    transform: translateX(calc(5px * var(--brand-arrow-direction, 1)));
    transition: opacity .2s ease, transform .2s ease, background-color .2s ease, color .2s ease;
}

html[dir="rtl"] .modern-brand-arrow {
    --brand-arrow-direction: -1;
}

.modern-brand-card:hover .modern-brand-arrow {
    opacity: 1;
    transform: translateX(0);
}

.modern-brand-arrow:hover {
    background: var(--brands-green);
    color: #fff;
}

.modern-brands-empty {
    min-height: 290px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 28px;
    border: 1px dashed rgba(27, 149, 68, .22);
    border-radius: 17px;
    background: var(--brands-soft);
    text-align: center;
}

.modern-brands-empty img {
    width: 105px;
    height: 105px;
    object-fit: contain;
}

.modern-brands-empty p {
    margin: 0;
    color: var(--brands-muted);
    font-size: 14px;
    font-weight: 600;
}

.modern-brands-pagination {
    margin-top: 24px;
}

.modern-brands-pagination:empty {
    display: none;
}

@media (max-width: 1199.98px) {
    .modern-brands-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .modern-brands-page {
        padding-top: 18px;
    }

    .modern-brands-hero {
        padding: 22px;
    }

    .modern-brands-hero-content {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    .modern-brands-search {
        width: 100%;
        flex-basis: auto;
    }

    .modern-brands-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .modern-brands-page {
        padding-block: 12px 30px;
    }

    .modern-brands-page .container {
        padding-inline: 10px;
    }

    .modern-brands-hero,
    .modern-brands-content {
        border-radius: 16px;
    }

    .modern-brands-hero {
        padding: 17px 14px;
    }

    .modern-brands-title-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 12px;
    }

    .modern-brands-title-icon svg {
        width: 23px;
        height: 23px;
    }

    .modern-brands-title {
        font-size: 20px;
    }

    .modern-brands-subtitle {
        font-size: 12px;
    }

    .modern-brands-search-box {
        height: 48px;
        border-radius: 13px;
    }

    .modern-brands-search-button {
        height: 40px;
        border-radius: 10px;
    }

    .modern-brands-content {
        margin-top: 14px;
        padding: 15px 12px;
    }

    .modern-brands-content-head {
        margin-bottom: 13px;
    }

    .modern-brands-content-title {
        font-size: 17px;
    }

    .modern-brands-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .modern-brand-card {
        gap: 7px;
        min-height: 0;
        padding: 8px 5px 9px;
        border-radius: 13px;
    }

    .modern-brand-logo {
        width: 80px;
        height: 80px;
        flex-basis: 80px;
        padding: 2px;
        border-radius: 15px;
    }

    .modern-brand-name {
        font-size: 11.5px;
    }

    .modern-brand-arrow {
        display: none;
    }
}

@media (max-width: 359.98px) {
    .modern-brands-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .modern-brand-logo {
        width: 70px;
        height: 70px;
        flex-basis: 70px;
    }
}
