/* Global Styles */
.shop-by-bikes-page {
    background-color: #f8f9fa;
    padding: 60px 0;
    min-height: calc(100vh - 300px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-title {
    font-size: 42px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.page-subtitle {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Brands Grid */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
}

/* Brand Card */
.brand-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.brand-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Brand Header with dynamic coloring */
.brand-header {
    padding: 25px;
    background: #1a1a1a;
    /* Default fallback */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    height: 100px;
}

.brand-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

/* Brand Specific Colors */
[data-brand="Yamaha"] .brand-header {
    background: linear-gradient(135deg, #0033cc 0%, #001f7a 100%);
}

[data-brand="Honda"] .brand-header {
    background: linear-gradient(135deg, #cc0000 0%, #8a0000 100%);
}

[data-brand="KTM"] .brand-header {
    background: linear-gradient(135deg, #ff6600 0%, #b34700 100%);
}

[data-brand="BMW"] .brand-header {
    background: linear-gradient(135deg, #0066b1 0%, #003359 100%);
}

[data-brand="Ducati"] .brand-header {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
}

[data-brand="Kawasaki"] .brand-header {
    background: linear-gradient(135deg, #00cc00 0%, #008000 100%);
}

[data-brand="Suzuki"] .brand-header {
    background: linear-gradient(135deg, #003399 0%, #001f5c 100%);
}

[data-brand="Triumph"] .brand-header {
    background: linear-gradient(135deg, #0b1a2f 0%, #000000 100%);
}

[data-brand="Husqvarna"] .brand-header {
    background: linear-gradient(135deg, #002550 0%, #001229 100%);
}

[data-brand="Aprilia"] .brand-header {
    background: linear-gradient(135deg, #ff0000 0%, #000000 100%);
}

[data-brand="Benelli"] .brand-header {
    background: linear-gradient(135deg, #006633 0%, #00331a 100%);
}

[data-brand="CFMOTO"] .brand-header {
    background: linear-gradient(135deg, #0099cc 0%, #00668f 100%);
}

[data-brand="Moto Morini"] .brand-header {
    background: linear-gradient(135deg, #990000 0%, #330000 100%);
}

/* Decorative huge letter */
.brand-header::after {
    content: attr(data-brand-initial);
    position: absolute;
    right: -20px;
    bottom: -40px;
    font-size: 180px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.1);
    z-index: 0;
    pointer-events: none;
    font-family: sans-serif;
}

/* Add initial for CSS attr usage (need JS or simple Django limitation workaround) 
   Workaround: use a class or just rely on the badge 
*/

.brand-name {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.brand-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.brand-icon {
    width: 90px;
    /* Увеличено с 60px */
    height: 90px;
    /* Увеличено с 60px */
    background: #ffffff;
    /* Полностью белый фон */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    margin-top: -65px;
    /* Скорректировано для большего размера */
    z-index: 3;
    border: 5px solid #fff;
    /* Увеличена обводка */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    /* Более заметная тень */
    transition: all 0.3s ease;
}

.brand-card:hover .brand-icon {
    transform: scale(1.1);
    /* Эффект увеличения при наведении */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.brand-initial {
    font-size: 36px;
    /* Увеличено с 30px */
    font-weight: 800;
    color: #333;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    /* Увеличено с 8px для лучшей видимости */
}

/* Actions */
.brand-actions {
    margin-bottom: 25px;
}

.btn-brand-main {
    display: block;
    width: 100%;
    padding: 12px 0;
    text-align: center;
    background: #1a1a1a;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-brand-main:hover {
    background: #333;
    transform: translateY(-2px);
}

/* Dynamic button coloring on hover using same specificities? 
   Actually hard to do without more CSS variables. Keep it dark/neutral or match header.
*/
[data-brand="Yamaha"] .btn-brand-main:hover {
    background: #0033cc;
}

[data-brand="Honda"] .btn-brand-main:hover {
    background: #cc0000;
}

[data-brand="KTM"] .btn-brand-main:hover {
    background: #ff6600;
}

/* ... add more if desired, or keep generic */

/* Models Preview */
.brand-models-preview {
    margin-top: auto;
}

.preview-label {
    display: block;
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.models-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-chip {
    font-size: 13px;
    padding: 6px 12px;
    background: #f0f0f0;
    color: #555;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.model-chip:hover {
    background: #fff;
    border-color: #ddd;
    color: #1a1a1a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.more-models {
    font-size: 12px;
    color: #999;
    padding: 6px 8px;
    align-self: center;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px;
    color: #999;
    font-style: italic;
}

.no-results i {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .brands-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 32px;
    }
}