/* ==========================================================
   BRANDS PAGE - COMPLETE STYLES WITH MOBILE IMPROVEMENTS
   ========================================================== */

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ===== PAGE HERO ===== */
.page-hero {
    background: linear-gradient(135deg, #1C3F60 0%, #0f2a40 100%);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(251, 195, 51, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 0;
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    font-size: 48px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.page-hero p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SECTION HEADERS ===== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1C3F60;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #FBC333;
    margin: 15px auto 0;
    border-radius: 2px;
}

.section-header p {
    font-size: 16px;
    color: #000000;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== AUTHORIZED BRANDS SECTION ===== */
.authorized-brands {
    padding: 60px 0;
    background: #fbc32c;
    position: relative;
}

.authorized-brands__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
    justify-items: center;   /* centers items horizontally */
    align-items: center;     /* centers vertically */
}

.authorized-brand-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    position: relative;
    border: 1px solid #eaeef2;
}

.authorized-brand-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(251, 195, 51, 0.15);
    border-color: #FBC333;
}

.authorized-brand-card::before {
    content: '✓ Authorized';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FBC333;
    color: #1C3F60;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.authorized-brand-card__inner {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 325px;
}

.authorized-brand-card img {
    max-width: 120px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.authorized-brand-card:hover img {
    transform: scale(1.1);
}

.authorized-brand-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1C3F60;
    margin: 0;
    transition: color 0.3s ease;
}

.authorized-brand-card:hover h3 {
    color: #FBC333;
}

/* ===== A-Z BRANDS SECTION ===== */
.atoz-brands {
    padding: 80px 0;
    background: #ffffff;
}

/* Alphabet Filter */
.atoz-brands__filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 50px;
    padding: 20px;
    background: #f8fafd;
    border-radius: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.atoz-brands__filter-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: #ffffff;
    color: #1C3F60;
    font-weight: 600;
    font-size: 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.atoz-brands__filter-btn:hover {
    background: #FBC333;
    color: #1C3F60;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(251, 195, 51, 0.3);
}

.atoz-brands__filter-btn.active {
    background: #FBC333;
    color: #1C3F60;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(251, 195, 51, 0.4);
}

/* Brands Groups */
.atoz-brands__group {
    margin-bottom: 60px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.atoz-brands__letter {
    font-size: 36px;
    font-weight: 800;
    color: #FBC333;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 3px solid #FBC333;
    display: inline-block;
    text-shadow: 0 2px 5px rgba(251, 195, 51, 0.2);
}

/* Brands Grid */
.atoz-brands__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
}

.brand-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    border: 1px solid #edf2f7;
    height: 100%;
}

.brand-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(251, 195, 51, 0.12);
    border-color: #FBC333;
}

.brand-card__inner {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.brand-card img {
    max-width: 100px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.brand-card:hover img {
    transform: scale(1.1);
}

.brand-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1C3F60;
    margin: 0;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.brand-card:hover h4 {
    color: #FBC333;
}

/* ===== IMPROVED MOBILE VERSION - CENTERED LARGER LOGOS ===== */

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
    
    .page-hero {
        padding: 50px 0;
    }
    
    .page-hero h1 {
        font-size: 32px !important;
    }
    
    .page-hero p {
        font-size: 15px !important;
        padding: 0 15px;
    }
    
    .section-header h2 {
        font-size: 26px !important;
    }
    
    .section-header p {
        font-size: 14px !important;
        padding: 0 15px;
    }
    
    /* Authorized Brands Section - Mobile */
    .authorized-brands__grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        max-width: 100% !important;
        padding: 0 15px;
    }
    
    .authorized-brand-card {
        width: 100%;
        max-width: 380px;
        margin: 0 auto;
    }
    
    .authorized-brand-card__inner {
        padding: 25px 20px !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 20px !important;
    }
    
    .authorized-brand-card img {
        max-width: 90px !important;
        max-height: 55px !important;
        margin-bottom: 0 !important;
    }
    
    .authorized-brand-card h3 {
        font-size: 17px !important;
        text-align: left !important;
    }
    
    /* A-Z Brands Section - Mobile */
    .atoz-brands {
        padding: 50px 0;
    }
    
    .atoz-brands__group {
        margin-bottom: 35px !important;
    }
    
    .atoz-brands__letter {
        font-size: 30px !important;
        margin-bottom: 20px !important;
        display: block !important;
        text-align: center !important;
    }
    
    .atoz-brands__grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        max-width: 100% !important;
    }
    
    .brand-card {
        width: 100%;
        max-width: 380px;
        margin: 0 auto;
    }
    
    .brand-card__inner {
        padding: 22px 20px !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 20px !important;
        align-items: center !important;
    }
    
    .brand-card img {
        max-width: 90px !important;
        max-height: 55px !important;
        margin-bottom: 0 !important;
    }
    
    .brand-card h4 {
        font-size: 16px !important;
        text-align: left !important;
        margin: 0 !important;
        flex: 1;
    }
    
    /* Alphabet Filter - Mobile */
    .atoz-brands__filter {
        gap: 6px !important;
        padding: 12px 10px !important;
        border-radius: 40px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        margin-bottom: 30px;
    }
    
    .atoz-brands__filter-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
    }
}

/* Small devices (portrait tablets and large phones, 601px to 768px) */
@media only screen and (min-width: 601px) and (max-width: 768px) {
    
    .page-hero h1 {
        font-size: 36px;
    }
    
    .authorized-brands__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        padding: 0 20px;
    }
    
    .authorized-brand-card__inner {
        padding: 25px 15px !important;
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .authorized-brand-card img {
        max-width: 90px !important;
        max-height: 50px !important;
        margin-bottom: 12px !important;
    }
    
    .authorized-brand-card h3 {
        font-size: 15px !important;
    }
    
    .atoz-brands__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        padding: 0 20px;
    }
    
    .brand-card__inner {
        padding: 20px 15px !important;
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .brand-card img {
        max-width: 80px !important;
        max-height: 45px !important;
        margin-bottom: 10px !important;
    }
    
    .brand-card h4 {
        font-size: 14px !important;
        text-align: center !important;
    }
    
    .atoz-brands__filter {
        gap: 5px !important;
        padding: 15px !important;
    }
    
    .atoz-brands__filter-btn {
        width: 38px !important;
        height: 38px !important;
        font-size: 14px !important;
    }
}

/* Medium devices (tablets, 769px to 1024px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    
    .authorized-brands__grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 25px;
    }
    
    .atoz-brands__grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px;
    }
    
    .atoz-brands__filter-btn {
        width: 42px;
        height: 42px;
    }
}

/* Large devices (desktops, 1025px to 1200px) */
@media only screen and (min-width: 1025px) and (max-width: 1200px) {
    
    .atoz-brands__grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Very small devices (phones, 400px and down) */
@media only screen and (max-width: 400px) {
    
    .authorized-brand-card__inner {
        padding: 18px 15px !important;
        gap: 12px !important;
    }
    
    .authorized-brand-card img {
        max-width: 70px !important;
        max-height: 45px !important;
    }
    
    .authorized-brand-card h3 {
        font-size: 15px !important;
    }
    
    .brand-card__inner {
        padding: 18px 15px !important;
        gap: 12px !important;
    }
    
    .brand-card img {
        max-width: 70px !important;
        max-height: 45px !important;
    }
    
    .brand-card h4 {
        font-size: 14px !important;
    }
    
    .atoz-brands__filter-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 13px !important;
    }
}

/* ===== SEQUENTIAL ANIMATIONS ===== */
.atoz-brands__group {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sequential animation delays */
.atoz-brands__group:nth-child(1) { animation-delay: 0.1s; }
.atoz-brands__group:nth-child(2) { animation-delay: 0.15s; }
.atoz-brands__group:nth-child(3) { animation-delay: 0.2s; }
.atoz-brands__group:nth-child(4) { animation-delay: 0.25s; }
.atoz-brands__group:nth-child(5) { animation-delay: 0.3s; }
.atoz-brands__group:nth-child(6) { animation-delay: 0.35s; }
.atoz-brands__group:nth-child(7) { animation-delay: 0.4s; }
.atoz-brands__group:nth-child(8) { animation-delay: 0.45s; }
.atoz-brands__group:nth-child(9) { animation-delay: 0.5s; }
.atoz-brands__group:nth-child(10) { animation-delay: 0.55s; }
.atoz-brands__group:nth-child(11) { animation-delay: 0.6s; }
.atoz-brands__group:nth-child(12) { animation-delay: 0.65s; }
.atoz-brands__group:nth-child(13) { animation-delay: 0.7s; }
.atoz-brands__group:nth-child(14) { animation-delay: 0.75s; }
.atoz-brands__group:nth-child(15) { animation-delay: 0.8s; }
.atoz-brands__group:nth-child(16) { animation-delay: 0.85s; }
.atoz-brands__group:nth-child(17) { animation-delay: 0.9s; }
.atoz-brands__group:nth-child(18) { animation-delay: 0.95s; }
.atoz-brands__group:nth-child(19) { animation-delay: 1s; }
.atoz-brands__group:nth-child(20) { animation-delay: 1.05s; }
.atoz-brands__group:nth-child(21) { animation-delay: 1.1s; }
.atoz-brands__group:nth-child(22) { animation-delay: 1.15s; }
.atoz-brands__group:nth-child(23) { animation-delay: 1.2s; }
.atoz-brands__group:nth-child(24) { animation-delay: 1.25s; }
.atoz-brands__group:nth-child(25) { animation-delay: 1.3s; }
.atoz-brands__group:nth-child(26) { animation-delay: 1.35s; }

/* ===== LOADING STATES ===== */
.brands-loading {
    text-align: center;
    padding: 60px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FBC333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== EMPTY STATES ===== */
.no-brands {
    text-align: center;
    padding: 60px;
    background: #f8fafd;
    border-radius: 16px;
    color: #666;
    font-size: 16px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .page-hero {
        background: none;
        color: #000;
    }
    
    .authorized-brand-card,
    .brand-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}