﻿/* =========================================================
   Brands Public Pages
   ========================================================= */

.brands-page {
    --brand-primary: #224173;
    --brand-primary-dark: #172f55;
    --brand-primary-soft: rgba(34, 65, 115, 0.08);
    --brand-border: rgba(34, 65, 115, 0.13);
    --brand-text: #172033;
    --brand-muted: #64748b;
    direction: rtl;
    color: var(--brand-text);
    background: #f7f9fc;
}

.brands-container {
    max-width: 1320px;
}

.brands-hero,
.brand-details-hero {
    position: relative;
    padding: 34px 0 50px;
    background: radial-gradient( circle at 10% 0, rgba(34, 65, 115, 0.15), transparent 31% ), radial-gradient( circle at 95% 100%, rgba(34, 65, 115, 0.08), transparent 35% ), linear-gradient( 135deg, #f8fbff, #eef3f9 );
    overflow: hidden;
}

.brands-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    color: #7b8799;
    font-size: 0.76rem;
}

    .brands-breadcrumb a {
        color: var(--brand-primary);
        font-weight: 750;
        text-decoration: none;
    }

    .brands-breadcrumb i {
        font-size: 0.56rem;
    }

.brands-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 35px;
}

.brands-hero-label,
.brand-profile-label,
.brand-products-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
    font-size: 0.75rem;
    font-weight: 900;
}

.brands-hero-content h1,
.brand-profile-content h1 {
    margin: 0;
    color: var(--brand-text);
    font-size: clamp(1.6rem, 3vw, 2.55rem);
    font-weight: 950;
    line-height: 1.65;
}

.brands-hero-content p,
.brand-profile-content p {
    max-width: 760px;
    margin: 14px 0 0;
    color: var(--brand-muted);
    font-size: 0.92rem;
    font-weight: 550;
    line-height: 2;
}

.brands-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(135px, 1fr));
    gap: 12px;
}

.brands-stat-card {
    min-width: 145px;
    padding: 22px;
    border: 1px solid var(--brand-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.07);
    text-align: center;
}

    .brands-stat-card strong {
        display: block;
        color: var(--brand-primary);
        font-size: 1.55rem;
        font-weight: 950;
    }

    .brands-stat-card span {
        display: block;
        margin-top: 5px;
        color: var(--brand-muted);
        font-size: 0.73rem;
        font-weight: 700;
    }

.brands-content,
.brand-products-section {
    padding-top: 32px;
    padding-bottom: 55px;
}

.brands-search-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--brand-border);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
}

.brands-search-field {
    min-height: 48px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid rgba(34, 65, 115, 0.1);
    border-radius: 14px;
    color: var(--brand-primary);
    background: #f8fafc;
}

    .brands-search-field input {
        width: 100%;
        height: 46px;
        border: 0;
        outline: 0;
        color: var(--brand-text);
        background: transparent;
        font-family: inherit;
        font-size: 0.84rem;
    }

.brands-search-box button,
.brands-clear-filter {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border: 0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.brands-search-box button {
    color: #ffffff;
    background: linear-gradient( 135deg, var(--brand-primary), var(--brand-primary-dark) );
}

.brands-clear-filter {
    color: #64748b;
    background: #eef2f7;
}

.brands-alphabet {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 28px;
}

    .brands-alphabet a {
        min-width: 39px;
        min-height: 39px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 11px;
        border: 1px solid var(--brand-border);
        border-radius: 11px;
        color: #536176;
        background: #ffffff;
        font-size: 0.76rem;
        font-weight: 800;
        text-decoration: none;
        transition: 0.18s ease;
    }

        .brands-alphabet a:hover,
        .brands-alphabet a.is-active {
            color: #ffffff;
            border-color: var(--brand-primary);
            background: var(--brand-primary);
            transform: translateY(-2px);
        }

.brands-result-header,
.brand-products-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

    .brands-result-header h2,
    .brand-products-header h2 {
        margin: 0;
        color: var(--brand-text);
        font-size: 1.2rem;
        font-weight: 950;
    }

    .brands-result-header p,
    .brand-products-header p {
        margin: 6px 0 0;
        color: var(--brand-muted);
        font-size: 0.77rem;
    }

    .brands-products-link,
    .brand-products-header > a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: var(--brand-primary);
        font-size: 0.78rem;
        font-weight: 850;
        text-decoration: none;
    }

.brands-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.brand-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid var(--brand-border);
    border-radius: 21px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.055);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

    .brand-card:hover {
        border-color: rgba(34, 65, 115, 0.25);
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
        transform: translateY(-4px);
    }

.brand-card-main {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    color: var(--brand-text);
    text-decoration: none;
}

.brand-card-logo {
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid rgba(34, 65, 115, 0.1);
    border-radius: 17px;
    background: #ffffff;
    overflow: hidden;
}

    .brand-card-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.brand-card-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient( 135deg, var(--brand-primary), #517dbb );
    font-size: 1.2rem;
    font-weight: 950;
}

.brand-card-title {
    min-width: 0;
}

    .brand-card-title strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.92rem;
        font-weight: 950;
    }

    .brand-card-title small {
        display: block;
        margin-top: 5px;
        color: var(--brand-muted);
        font-size: 0.7rem;
    }

.brand-card-main > i {
    color: #a0aabd;
    font-size: 0.65rem;
}

.brand-card-description {
    min-height: 68px;
    display: -webkit-box;
    margin: 15px 0;
    padding-top: 13px;
    border-top: 1px solid rgba(34, 65, 115, 0.08);
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.9;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.brand-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

    .brand-card-actions a {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: var(--brand-primary);
        font-size: 0.72rem;
        font-weight: 850;
        text-decoration: none;
    }

.brands-empty-state {
    min-height: 330px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 35px;
    border: 1px dashed rgba(34, 65, 115, 0.2);
    border-radius: 24px;
    background: #ffffff;
    text-align: center;
}

.brands-empty-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
    font-size: 1.5rem;
}

.brands-empty-state h3 {
    margin: 5px 0 0;
    font-size: 1rem;
    font-weight: 950;
}

.brands-empty-state p {
    margin: 0;
    color: var(--brand-muted);
    font-size: 0.78rem;
}

.brands-empty-state > a {
    margin-top: 7px;
    padding: 9px 15px;
    border-radius: 12px;
    color: #ffffff;
    background: var(--brand-primary);
    font-size: 0.76rem;
    font-weight: 850;
    text-decoration: none;
}

/* Brand details */

.brand-profile {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) 175px;
    align-items: center;
    gap: 30px;
}

.brand-profile-logo {
    width: 170px;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 1px solid var(--brand-border);
    border-radius: 30px;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.09);
}

    .brand-profile-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .brand-profile-logo > span {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 22px;
        color: #ffffff;
        background: linear-gradient( 135deg, var(--brand-primary), #557fba );
        font-size: 3rem;
        font-weight: 950;
    }

.brand-profile-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 21px;
}

    .brand-profile-actions a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 9px 15px;
        border-radius: 13px;
        font-size: 0.78rem;
        font-weight: 850;
        text-decoration: none;
    }

.brand-primary-action {
    color: #ffffff;
    background: linear-gradient( 135deg, var(--brand-primary), var(--brand-primary-dark) );
}

.brand-secondary-action {
    color: var(--brand-primary);
    border: 1px solid var(--brand-border);
    background: rgba(255, 255, 255, 0.75);
}

.brand-profile-stat {
    padding: 25px;
    border: 1px solid var(--brand-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    text-align: center;
}

    .brand-profile-stat strong {
        display: block;
        color: var(--brand-primary);
        font-size: 2rem;
        font-weight: 950;
    }

    .brand-profile-stat span {
        display: block;
        margin-top: 6px;
        color: var(--brand-muted);
        font-size: 0.73rem;
        font-weight: 700;
    }

.brand-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.brand-product-card {
    min-width: 0;
    border: 1px solid var(--brand-border);
    border-radius: 20px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 11px 30px rgba(15, 23, 42, 0.055);
    transition: 0.2s ease;
}

    .brand-product-card:hover {
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
        transform: translateY(-4px);
    }

.brand-product-image {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #ffffff;
}

    .brand-product-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        transition: transform 0.25s ease;
    }

.brand-product-card:hover
.brand-product-image img {
    transform: scale(1.035);
}

.brand-product-content {
    padding: 15px;
    border-top: 1px solid rgba(34, 65, 115, 0.08);
}

.brand-product-category {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--brand-primary);
    font-size: 0.67rem;
    font-weight: 800;
}

.brand-product-content h3 {
    min-height: 51px;
    margin: 0;
}

    .brand-product-content h3 a {
        color: var(--brand-text);
        font-size: 0.82rem;
        font-weight: 850;
        line-height: 1.85;
        text-decoration: none;
    }

.brand-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(34, 65, 115, 0.08);
}

    .brand-product-footer strong {
        color: var(--brand-primary);
        font-size: 0.78rem;
        font-weight: 900;
    }

    .brand-product-footer a {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 11px;
        color: #ffffff;
        background: var(--brand-primary);
        font-size: 0.67rem;
        text-decoration: none;
    }

/* Responsive */

@media (max-width: 1199px) {

    .brands-grid,
    .brand-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .brand-profile {
        grid-template-columns: 145px minmax(0, 1fr);
    }

    .brand-profile-logo {
        width: 145px;
        height: 145px;
    }

    .brand-profile-stat {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991.98px) {

    .brands-hero-layout {
        grid-template-columns: 1fr;
    }

    .brands-hero-stats {
        max-width: 430px;
    }

    .brands-grid,
    .brand-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brand-profile {
        grid-template-columns: 125px minmax(0, 1fr);
        gap: 20px;
    }

    .brand-profile-logo {
        width: 125px;
        height: 125px;
        padding: 14px;
    }
}

@media (max-width: 767.98px) {

    .brands-hero,
    .brand-details-hero {
        padding-top: 24px;
        padding-bottom: 35px;
    }

    .brands-search-box {
        grid-template-columns: 1fr;
    }

        .brands-search-box button,
        .brands-clear-filter {
            width: 100%;
        }

    .brands-result-header,
    .brand-products-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .brands-grid,
    .brand-products-grid {
        grid-template-columns: 1fr;
    }

    .brand-profile {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .brand-profile-logo {
        width: 125px;
        height: 125px;
        margin: 0 auto;
    }

    .brand-profile-actions {
        justify-content: center;
    }

    .brands-hero-stats {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {

    .brands-hero-stats {
        grid-template-columns: 1fr;
    }

    .brands-stat-card {
        min-width: 0;
    }
}

/* Dark mode */

body.dark-mode .brands-page {
    --brand-text: #f1f5f9;
    --brand-muted: #b7c3d4;
    background: #111827;
}

body.dark-mode .brands-hero,
body.dark-mode .brand-details-hero {
    background: radial-gradient( circle at 10% 0, rgba(72, 116, 178, 0.2), transparent 35% ), linear-gradient( 135deg, #172033, #111827 );
}

body.dark-mode .brand-card,
body.dark-mode .brands-search-box,
body.dark-mode .brands-empty-state,
body.dark-mode .brand-product-card,
body.dark-mode .brand-profile-stat {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.08);
    background: #172033;
}

body.dark-mode .brands-search-field {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

    body.dark-mode .brands-search-field input,
    body.dark-mode .brand-product-content h3 a,
    body.dark-mode .brand-card-main {
        color: #f1f5f9;
    }

body.dark-mode .brand-card-logo,
body.dark-mode .brand-profile-logo,
body.dark-mode .brand-product-image {
    background: #ffffff;
}
