/**
 * Brands Browse Page Styles
 * @version 4.0.0
 *
 * Update 4.0.0: Performance and visual optimization
 *   - Removed gray logo container (cleaner look)
 *   - Removed shimmer animation (no longer needed)
 *   - Increased logo size from 120px to 160px
 *   - Removed product count styles
 */

/* Page Container */
.brands-page-container {
    min-height: calc(100vh - 200px);
    background: #f9fafb;
    padding: 40px 20px;
}

.brands-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.brands-header {
    text-align: center;
    margin-bottom: 40px;
}

.brands-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px 0;
}

.brands-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Brand Search */
.brand-search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 50px auto;
}

.brand-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
}

.brand-search-input:focus {
    outline: none;
    border-color: #2d5f3f;
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #e5e7eb;
    border-top-color: #2d5f3f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 80px 20px;
    color: #dc2626;
}

.btn-retry {
    margin-top: 20px;
    padding: 10px 24px;
    background: #2d5f3f;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.btn-retry:hover {
    background: #1a472a;
}

/* Brands Container */
.brands-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Letter Section */
.brand-letter-section {
    margin-bottom: 50px;
}

.brand-letter-section:last-child {
    margin-bottom: 0;
}

.brand-letter-header {
    font-size: 2rem;
    font-weight: 700;
    color: #2d5f3f;
    margin: 0 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid #2d5f3f;
}

/* Brand Grid */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Brand Card */
.brand-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Brand Logo Image - Increased size for better visibility */
.brand-card-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

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

.brand-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #2d5f3f;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.brand-card:hover {
    border-color: #2d5f3f;
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.15);
    transform: translateY(-2px);
}

.brand-card:hover::before {
    transform: scaleY(1);
}

.brand-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-name {
    /* Removed - logo contains brand name */
    display: none;
}

/* Product counts removed for performance - was causing 8-second delay */

.brand-card-arrow {
    /* Removed - unnecessary visual clutter */
    display: none;
}

/* No Brands State */
.no-brands {
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
    font-size: 1.125rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .brands-page-container {
        padding: 20px 16px;
    }

    .brands-title {
        font-size: 2rem;
    }

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

    .brands-container {
        padding: 24px 16px;
    }

    .brand-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .brand-letter-header {
        font-size: 1.5rem;
    }

    .brand-card {
        padding: 20px;
    }

    .brand-name {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .brands-title {
        font-size: 1.75rem;
    }

    .brands-header {
        margin-bottom: 30px;
    }

    .brand-search-container {
        margin-bottom: 30px;
    }

    .brand-letter-section {
        margin-bottom: 40px;
    }
}

/* Print Styles */
@media print {
    .brands-page-container {
        background: white;
    }

    .brand-search-container {
        display: none;
    }

    .brand-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

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

/* Override body overflow for brands page to enable scrolling */
body {
    overflow: auto !important;
    height: auto !important;
}

.brands-page-container {
    min-height: 100vh;
}
