/**
 * ESP Brands Page Styles
 * Updated: 2025-12-22 - Align container widths with PaulB (1280px max)
 */

/* ============================================
   Container Constraints (PaulB Alignment)
   PaulB uses: max-width: 1280px, padding: 24px, margin: auto
   ============================================ */
.esp-brands-page .esp-container {
    max-width: 1280px !important;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Featured brands section - constrain to PaulB width */
.esp-brands-featured {
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}

/* All brands section - constrain to PaulB width */
.esp-brands-all {
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}

/* Inner containers don't need extra padding since parent has it */
.esp-brands-featured .esp-container,
.esp-brands-all .esp-container {
    padding-left: 0;
    padding-right: 0;
}

/* Page Header */
.esp-brands-header {
    padding: 3rem 0 2rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.esp-brands-header__title {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.esp-brands-header__description {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0 auto;
    max-width: 700px;
    text-align: center;
}

/* Section Titles */
.esp-brands-section__title {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1.5rem;
    letter-spacing: -0.01em;
}

/* Featured Brands Section - padding handled by top section */
.esp-brands-featured {
    padding-top: 3rem;
    padding-bottom: 3rem;
    background: #fff;
}

.esp-brands-featured__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

/* Brand Card (Featured) */
.esp-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.esp-brand-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.esp-brand-card--featured {
    min-height: 160px;
}

.esp-brand-card__logo {
    width: 100%;
    max-width: 140px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.esp-brand-card__logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.esp-brand-card__name {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.esp-brand-card:hover .esp-brand-card__name {
    color: #f59e0b;
}

/* All Brands Section - padding handled by top section */
.esp-brands-all {
    padding-top: 3rem;
    padding-bottom: 4rem;
    background: #f9fafb;
}

/* Alphabet Filter */
.esp-brands-alphabet {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.esp-brands-alphabet__btn {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 0.375rem 0.5rem;
    min-width: 28px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.esp-brands-alphabet__btn:hover {
    color: #111827;
    background: #f3f4f6;
}

.esp-brands-alphabet__btn.active {
    color: #fff;
    background: #f59e0b;
}

/* Brands Grid (All) */
.esp-brands-all__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    min-height: 400px;
    align-content: start;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.esp-brands-all__grid.is-transitioning {
    opacity: 0.3;
    transform: translateY(4px);
}

/* Brand Item (List) */
.esp-brand-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.esp-brand-item:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}

.esp-brand-item__name {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #111827;
}

.esp-brand-item:hover .esp-brand-item__name {
    color: #d97706;
}

.esp-brand-item__count {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8125rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* CTA Section */
.esp-brands-cta {
    padding: 4rem 0;
    background: #1f2937;
}

.esp-brands-cta__inner {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.esp-brands-cta__title {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1rem;
}

.esp-brands-cta__text {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.0625rem;
    color: #d1d5db;
    margin: 0 0 2rem;
    line-height: 1.6;
}

.esp-brands-cta__buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.esp-brands-cta .esp-btn--outline {
    color: #fff;
    border-color: #fff;
}

.esp-brands-cta .esp-btn--outline:hover {
    background: #fff;
    color: #1f2937;
}

/* Responsive */
@media (max-width: 768px) {
    /* Container fixes for mobile/tablet - override inline styles */
    .esp-brands-page .esp-container {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .esp-brands-header {
        padding: 2rem 0 1.5rem;
    }

    .esp-brands-header__title {
        font-size: 1.75rem;
    }

    .esp-brands-header__description {
        font-size: 1rem;
    }

    .esp-brands-featured {
        max-width: 100% !important;
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .esp-brands-featured__grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .esp-brand-card--featured {
        min-height: 140px;
        padding: 1rem;
    }

    .esp-brand-card__logo {
        height: 60px;
        max-width: 100px;
    }

    .esp-brand-card__name {
        font-size: 0.8125rem;
    }

    .esp-brands-all {
        max-width: 100% !important;
        padding-top: 2rem !important;
        padding-bottom: 3rem !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .esp-brands-alphabet {
        gap: 0.125rem;
        overflow-x: auto;
        justify-content: flex-start;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .esp-brands-alphabet__btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.375rem;
        min-width: 24px;
        flex-shrink: 0;
    }

    .esp-brands-all__grid {
        grid-template-columns: 1fr;
        min-height: 300px;
    }

    .esp-brands-cta {
        padding: 3rem 0;
    }

    .esp-brands-cta__title {
        font-size: 1.5rem;
    }

    .esp-brands-cta__text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .esp-brands-header__title {
        font-size: 1.5rem;
    }

    .esp-brands-featured__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .esp-brands-cta__buttons {
        flex-direction: column;
    }

    .esp-brands-cta__buttons .esp-btn {
        width: 100%;
    }
}
