/* ============================================
   BRANDS PAGE - HERO SECTION
   ============================================ */

/* Remove all possible margins/paddings */
body:has(.brands-hero) {
    /* Removed padding-top: 0 to keep navbar compensation */
    margin-top: 0 !important;
}

body:has(.brands-hero) .container {
    padding: 0 !important;
    margin: 0 auto !important;
}

[data-controller="products"] {
    margin: 0;
    padding: 0;
}

.brands-hero {
    background: linear-gradient(rgba(4, 0, 53, 0.5), rgba(4, 0, 53, 0.5)),
                url('/images/background-img/background-image.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: -80px !important; /* Compensate for body padding-top */
    padding-top: calc(4rem + 80px) !important; /* Add navbar height to padding */
    padding-bottom: 6rem !important;
}

.brands-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.brands-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.brands-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.2;
}

.brands-hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    font-weight: 400;
    line-height: 1.6;
}

.brands-hero-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    font-weight: 400;
    line-height: 1.6;
}

/* Search Bar in Hero */
.brands-search-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

.brands-search-form {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brands-search-form:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.brands-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1.2rem 2rem;
    font-size: 1rem;
    color: #0a1128;
    background: transparent;
}

.brands-search-input::placeholder {
    color: rgba(10, 17, 40, 0.5);
    font-weight: 400;
}

.brands-search-icon-btn {
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.brands-search-icon-btn:hover {
    opacity: 0.7;
}

.brands-search-icon-btn svg {
    width: 24px;
    height: 24px;
    color: #0a1128;
}

.brands-search-submit {
    background: transparent;
    border: none;
    padding: 1.2rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.brands-search-submit:hover {
    background: rgba(10, 17, 40, 0.05);
}

.brands-search-submit svg {
    width: 24px;
    height: 24px;
    color: #0a1128;
}

/* Suggestions for Brands Search */
#brandsSearchSuggestions {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
}

#brandsSearchSuggestions .suggestion-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

#brandsSearchSuggestions .suggestion-item:last-child {
    border-bottom: none;
}

#brandsSearchSuggestions .suggestion-item:hover {
    background: #f8f9fa;
}

#brandsSearchSuggestions .suggestion-item.no-result {
    justify-content: center;
    color: #999;
}

#brandsSearchSuggestions .suggestion-item.no-result:hover {
    background: transparent;
}

#brandsSearchSuggestions .suggestion-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 1rem;
}

#brandsSearchSuggestions .suggestion-no-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-right: 1rem;
}

#brandsSearchSuggestions .suggestion-content {
    flex: 1;
}

#brandsSearchSuggestions .suggestion-code {
    font-size: 0.85rem;
    color: rgba(5, 0, 82, 1);
    font-weight: 600;
}

#brandsSearchSuggestions .suggestion-name {
    font-size: 0.95rem;
    color: #333;
    margin-top: 0.25rem;
}

/* ============================================
   BRANDS GRID SECTION
   ============================================ */

.brands-section {
    padding: 4rem 2rem;
    width: 85vw;
    margin-left: calc(-42.5vw + 50%);
}

/* Alphabet Filter */
.alphabet-filter {
    max-width: 1400px;
    margin: 0 auto 3rem auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 1.5rem;
}

.letter-btn {
    min-width: 40px;
    height: 40px;
    border: 2px solid rgba(5, 0, 82, 0.2);
    background: white;
    color: rgba(5, 0, 82, 1);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.8rem;
}

.letter-btn:hover:not(.disabled) {
    background: rgba(5, 0, 82, 0.05);
    border-color: rgba(5, 0, 82, 0.5);
    transform: translateY(-2px);
}

.letter-btn.active {
    background: rgba(5, 0, 82, 1);
    color: white;
    border-color: rgba(5, 0, 82, 1);
    box-shadow: 0 4px 12px rgba(5, 0, 82, 0.3);
}

.letter-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
    border-color: #e0e0e0;
}

.brands-section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #0a1128;
    margin-bottom: 3rem;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.brand-card {
    background: white;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.brand-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(5, 0, 82, 0.15);
    border-color: rgba(5, 0, 82, 0.2);
}

.brand-logo {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 1rem;
}

.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(0%);
    transition: filter 0.3s ease, transform 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.brand-card:hover .brand-logo img {
    transform: scale(1.05);
}

.brand-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border-radius: 8px;
}

.brand-placeholder span {
    font-size: 3rem;
}

.brand-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(5, 0, 82, 1);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    line-height: 1.4;
}

.brand-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1200px) {
    .brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .brands-hero {
        padding: 3rem 1.5rem;
    }

    .brands-hero h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .brands-hero-subtitle,
    .brands-hero-description {
        font-size: 1rem;
    }

    .brands-search-input {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }

    .brands-search-icon-btn,
    .brands-search-submit {
        padding: 0.8rem 1rem;
    }

    .brands-search-icon-btn svg,
    .brands-search-submit svg {
        width: 20px;
        height: 20px;
    }

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

    .brand-card {
        padding: 1.5rem;
    }

    .brands-section {
        padding: 3rem 1rem;
    }
}

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

    .brands-grid {
        grid-template-columns: 1fr;
    }
}
