/* ========================================
   DESPERADOSPORT - Основные стили
   Темная премиальная тема
   ======================================== */

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Переменные цветов */
:root {
    /* Базовые поверхности */
    --primary-dark: #f5f2ec;        /* основной фон страниц (молочный) */
    --secondary-dark: #2f2d2c;      /* тёплый тёмный для шапки/дропа */
    --surface-alt: #efe7dc;         /* светлая подложка секций */
    --card-bg: #ffffff;             /* карточки и модальные */
    --header-bg: #2f2d2c;           /* фон шапки */
    
    /* Акцентные цвета */
    --accent-blue: #2196F3;
    --accent-blue-hover: #1976D2;
    --accent-blue-light: #42A5F5;
    
    /* Текст */
    --text-primary: #1b1e23;
    --text-secondary: #42474f;
    --text-muted: #6f747d;
    --text-on-dark: #f5f5f5;
    
    /* Границы */
    --border-color: #e0d7cb;
    --divider: #d7cec2;
    
    /* Состояния */
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    
    /* Тени */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.16);
    
    /* Переходы */
    --transition: all 0.3s ease;
}

/* Базовые стили */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--primary-dark);
    overflow-x: hidden;
}

/* Контейнер */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Типографика */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-blue-light);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: var(--text-primary);
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--accent-blue);
    border: 2px solid var(--accent-blue);
}

.btn-outline:hover {
    background-color: var(--accent-blue);
    color: var(--text-primary);
}

/* Секции */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ========================================
   БАННЕРЫ
   ======================================== */

.banners-section {
    padding: 40px 0;
    display: none; /* Показываем только на ПК */
}

@media (min-width: 1024px) {
    .banners-section {
        display: block;
    }
}

/* Основная разметка баннеров */
.banners-layout {
    display: grid;
    /* Центральный баннер должен быть 840x380 (пропорция 1680x760),
       поэтому фиксируем центральную колонку в 840px.
       Боковые колонки могут "ужиматься" в разумных пределах. */
    grid-template-columns: minmax(160px, 260px) 840px minmax(160px, 260px);
    gap: 20px;
    align-items: center;
}

/* ========================================
   БОКОВЫЕ БАННЕРЫ
   ======================================== */

.side-banners {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-banner {
    display: block;
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.side-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: var(--transition);
}

.side-banner:hover::after {
    background: rgba(33, 150, 243, 0.1);
}

.side-banner:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.side-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========================================
   ЦЕНТРАЛЬНЫЙ БАННЕР (СЛАЙДЕР)
   ======================================== */

.main-banner {
    position: relative;
    width: 100%;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.main-banner__slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.main-banner__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.main-banner__slide.active {
    opacity: 1;
    visibility: visible;
}

.main-banner__slide img {
    width: 100%;
    height: 100%;
    /* Без обрезки. При правильной пропорции 1680x760 заполнит контейнер полностью,
       а если вдруг картинка отличается — будет letterbox, но НИЧЕГО не отрежет. */
    object-fit: contain;
    object-position: center;
    display: block;
}

/* Контент баннера */
.main-banner__content {
    position: absolute;
    bottom: 20px;
    left: 30px;
    right: 30px;
    z-index: 2;
    background: rgba(47, 45, 44, 0.5);
    backdrop-filter: blur(8px);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-banner__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-on-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.main-banner__text {
    display: none; /* Прячем подзаголовок для компактности */
}

.main-banner__content .btn {
    margin: 0;
    padding: 8px 20px;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Навигация баннера */
.main-banner__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.main-banner__arrow:hover {
    background: var(--accent-blue);
    transform: translateY(-50%) scale(1.1);
}

.main-banner__arrow--prev {
    left: 15px;
}

.main-banner__arrow--next {
    right: 15px;
}

/* Индикаторы (точки) */
.main-banner__dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.main-banner__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    padding: 0;
}

.main-banner__dot.active {
    background: var(--accent-blue);
    width: 24px;
    border-radius: 5px;
}

.main-banner__dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

/* На узких ПК убираем боковые баннеры,
   чтобы центральный оставался 840x380 и не "ломал" пропорцию */
@media (max-width: 1200px) {
    .banners-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .side-banners {
        display: none;
    }

    .main-banner {
        width: 840px;
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .banners-section {
        display: none;
    }
}

/* Преимущества */
.advantages-section {
    background-color: var(--surface-alt);
}

/* Преимущества */
.advantages-section {
    padding: 40px 0;
    background: transparent;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.advantage-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.advantage-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.12);
    border-color: var(--accent-blue);
}

.advantage-card__icon {
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-hover) 100%);
    border-radius: 12px;
    color: white;
    flex-shrink: 0;
}

.advantage-card__icon svg {
    stroke-width: 2;
}

.advantage-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    line-height: 1.3;
}

.advantage-card__text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

/* Загрузчик */
.products-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Адаптивность */
@media (max-width: 1024px) {
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .banner__title {
        font-size: 2rem;
    }
    
    .banner__text {
        font-size: 1.125rem;
    }
    
    section {
        padding: 60px 0;
    }
    
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .btn {
        padding: 10px 24px;
        font-size: 14px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .advantage-card {
        padding: 20px 16px;
    }
    
    .advantage-card__icon {
        width: 48px;
        height: 48px;
    }
}

/* ===========================
   Уведомление о добавлении в корзину
   =========================== */
.cart-notification {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--accent-blue);
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-weight: 500;
}

.cart-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Уведомление о пустой корзине (рядом с иконкой) */
.cart-notification--empty {
    position: fixed;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 200px;
    opacity: 0;
    transform: translateY(-10px);
    background: var(--card-bg);
    border: 2px solid var(--accent-blue);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    --arrow-position: 40px;
}

.cart-notification--empty.show {
    opacity: 1;
    transform: translateY(0);
}

/* Стрелочка вверх для уведомления о пустой корзине */
.cart-notification--empty::before {
    content: '';
    position: absolute;
    top: -10px;
    right: var(--arrow-position);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--accent-blue);
}

.cart-notification--empty::after {
    content: '';
    position: absolute;
    top: -7px;
    right: calc(var(--arrow-position) + 2px);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--card-bg);
}

/* Адаптив для уведомления о пустой корзине */
@media (max-width: 768px) {
    .cart-notification--empty {
        max-width: calc(100vw - 20px);
        width: auto;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .cart-notification--empty {
        max-width: calc(100vw - 20px);
        width: auto;
        min-width: 160px;
    }
}

/* ===========================
   ПЛАВАЮЩАЯ КНОПКА КОРЗИНЫ
   =========================== */
.floating-cart {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    background: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    z-index: 9999;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
}

.floating-cart.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.floating-cart:hover {
    background: var(--accent-blue-hover);
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

.floating-cart:active {
    transform: scale(0.95);
}

.floating-cart svg {
    color: white;
}

.floating-cart__counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 3px solid var(--primary-dark);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Адаптив для плавающей корзины */
@media (max-width: 768px) {
    .floating-cart {
        width: 56px;
        height: 56px;
        right: 16px;
        bottom: 16px;
    }
    
    .floating-cart svg {
        width: 24px;
        height: 24px;
    }
    
    .floating-cart__counter {
        min-width: 22px;
        height: 22px;
        font-size: 11px;
        border-width: 2px;
    }
}

@media (max-width: 480px) {
    .floating-cart {
        width: 52px;
        height: 52px;
        right: 12px;
        bottom: 12px;
    }
}

