:root {
    --primary: #dc2626;
    --primary-dark: #991b1b;
    --primary-light: #fef2f2;
    --dark: #0f0f0f;
    --dark-2: #1a1a1a;
    --dark-3: #2d2d2d;
    --gray: #6b7280;
    --gray-light: #f3f4f6;
    --gray-border: #e5e7eb;
    --white: #ffffff;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --transition: 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #fafafa;
    color: #1f2937;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---- Навигация ---- */
.navbar {
    background: var(--dark);
    color: white;
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

    .logo i {
        color: var(--primary);
    }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
    position: relative;
}

    .nav-link:hover {
        color: white;
    }

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 600;
}

.user-name {
    color: #d1d5db;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

/* ---- Кнопки ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

.btn-primary {
    background: var(--primary);
    color: black;
}

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.btn-outline {
    background: transparent;
    color: black;
    border: 1.5px solid var(--gray-border);
}

    .btn-outline:hover {
        border-color: white;
    }

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all var(--transition);
}

    .btn-icon:hover {
        color: var(--danger);
        background: var(--primary-light);
    }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-3) 100%);
    color: white;
    padding: 5rem 2rem;
    text-align: center;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

    .hero h1 {
        font-size: 3rem;
        font-weight: 800;
        margin-bottom: 0.5rem;
    }

    .hero .accent {
        color: var(--primary);
    }

.hero-subtitle {
    color: #9ca3af;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero .btn-outline {
    color: white !important;
    border-color: #4b5563;
}

    .hero .btn-outline:hover {
        border-color: white !important;
    }

/* ---- Секции ---- */
.section {
    margin: 3rem 0;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.main-content {
    flex: 1;
    padding-bottom: 3rem;
}

/* ---- Преимущества ---- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform var(--transition);
}

    .feature-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

.feature-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ---- Карточки товаров ---- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
}

    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

.product-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 3rem;
}

    .product-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.product-card-body {
    padding: 1rem;
}

    .product-card-body h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

.product-card-category {
    color: var(--gray);
    font-size: 0.8rem;
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
}

.product-card-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.product-card-rating {
    font-size: 0.85rem;
    color: #f59e0b;
}

/* ---- Каталог (лейаут) ---- */
.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.product-count {
    color: var(--gray);
    font-size: 0.9rem;
}

.filters-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 80px;
}

    .filters-sidebar h3 {
        margin-bottom: 1rem;
        color: var(--dark);
    }

.filter-group {
    margin-bottom: 1rem;
}

    .filter-group label {
        display: block;
        font-weight: 500;
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        color: #374151;
    }

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--gray-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition);
    background: white;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
    }

.form-control-sm {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

textarea.form-control {
    resize: vertical;
}

/* ---- Страница товара ---- */
.product-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-top: 1rem;
}

.product-image-large {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

    .product-image-large img {
        width: 100%;
        height: 450px;
        object-fit: cover;
    }

.product-carousel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.carousel-main {
    position: relative;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

    .carousel-main img {
        width: 100%;
        height: 420px;
        object-fit: cover;
    }
    
    .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    }

    .carousel-btn:hover {
        background: rgba(0,0,0,0.7);
    }

.carousel-btn-prev {
    left: 10px;
}

.carousel-btn-next {
    right: 10px;
}

.carousel-thumbs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.carousel-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
}

    .carousel-thumb:hover {
        opacity: 1;
    }

    .carousel-thumb.active {
        border-color: var(--primary);
        opacity: 1;
    }

.product-carousel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
}

.product-info-block h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.product-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

.product-brand {
    background: var(--dark);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.product-price-large {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin: 1rem 0;
}

.product-description {
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

    .breadcrumb a {
        color: var(--primary);
        text-decoration: none;
    }

.size-buttons, .color-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.size-btn, .color-btn {
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--gray-border);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition);
}

    .size-btn:hover, .color-btn:hover {
        border-color: var(--dark);
    }

    .size-btn.active, .color-btn.active {
        background: var(--dark);
        color: white;
        border-color: var(--dark);
    }

.stock-info {
    margin: 0.8rem 0;
    font-size: 0.9rem;
}

/* ---- Корзина ---- */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    background: white;
    padding: 1.2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-info h4 {
    margin-bottom: 0.2rem;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--gray-border);
    border-radius: 50%;
    background: white;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

    .qty-btn:hover {
        background: var(--gray-light);
    }

.qty-value {
    font-weight: 600;
    min-width: 2rem;
    text-align: center;
}

.line-total {
    font-weight: 700;
    min-width: 100px;
    text-align: right;
}

.cart-summary {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 1.5rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-border);
}

.total-price {
    color: var(--primary);
    font-size: 1.4rem;
}

/* ---- Оформление заказа ---- */
.checkout-layout {
    max-width: 600px;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

    .card h3 {
        margin-bottom: 1rem;
        margin-top: 1rem;
    }

        .card h3:first-child {
            margin-top: 0;
        }

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--gray-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

    .radio-card:has(input:checked) {
        border-color: var(--primary);
        background: var(--primary-light);
    }

    .radio-card input {
        accent-color: var(--primary);
    }

    .radio-card i {
        color: var(--gray);
        width: 20px;
    }

/* ---- Модальное окно ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: var(--radius);
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

    .modal-content h2 {
        margin: 1rem 0 0.5rem;
    }

    .modal-content p {
        color: var(--gray);
        margin-bottom: 1.5rem;
    }

/* ---- Заказы ---- */
.order-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--gray-light);
}

    .order-header h3 {
        font-size: 1rem;
    }

.order-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    margin-left: 1rem;
}

.order-items {
    padding: 0.5rem 1.5rem;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-border);
    font-size: 0.9rem;
}

    .order-item-row:last-child {
        border: none;
    }

.order-footer {
    padding: 0.8rem 1.5rem;
    font-size: 0.85rem;
    display: flex;
    gap: 2rem;
    background: var(--gray-light);
}

/* ---- Бейджи ---- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-primary {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fef2f2;
    color: #991b1b;
}

/* ---- Авторизация ---- */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 440px;
}

    .auth-card h2 {
        margin-bottom: 0.3rem;
    }

        .auth-card h2 i {
            color: var(--primary);
        }

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

    .auth-switch a {
        color: var(--primary);
        text-decoration: none;
        font-weight: 500;
    }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ---- Админ-панель ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: white;
    padding: 1.2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    color: var(--gray);
    font-size: 0.85rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

    .chart-card h3 {
        margin-bottom: 1rem;
        font-size: 1rem;
    }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

    .data-table th {
        background: var(--dark);
        color: white;
        padding: 0.8rem 1rem;
        text-align: left;
        font-weight: 500;
        font-size: 0.85rem;
    }

    .data-table td {
        padding: 0.7rem 1rem;
        border-bottom: 1px solid var(--gray-border);
        font-size: 0.9rem;
    }

    .data-table tr:hover td {
        background: var(--gray-light);
    }

/* ---- Отзывы ---- */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-card {
    background: white;
    padding: 1.2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.review-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-rating {
    color: #f59e0b;
}

/* ---- Утилиты ---- */
.text-muted {
    color: var(--gray);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

    .empty-state i {
        font-size: 3rem;
        color: var(--gray);
        margin-bottom: 1rem;
        display: block;
    }

    .empty-state p {
        color: var(--gray);
        margin-bottom: 1.5rem;
        font-size: 1.1rem;
    }

.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ---- Toast уведомления ---- */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    box-shadow: var(--shadow-lg);
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* ---- Звёзды рейтинга (форма отзыва) ---- */
.rating-input {
    display: flex;
    gap: 0.3rem;
}

.rating-star {
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-border);
    transition: color 0.15s, transform 0.15s;
    padding: 0;
    line-height: 1;
}

    .rating-star:hover, .rating-star.active {
        color: #f59e0b;
        transform: scale(1.15);
    }

/* ---- Подвал ---- */
.footer {
    background: var(--dark);
    color: #9ca3af;
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h3 {
    color: white;
    margin-bottom: 0.5rem;
}

    .footer h3 i {
        color: var(--primary);
    }

.footer h4 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.footer a {
    color: #9ca3af;
    text-decoration: none;
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

    .footer a:hover {
        color: white;
    }

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ---- Адаптивность ---- */
@media (max-width: 480px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
    }

    .product-page {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero {
        padding: 3rem 1.5rem;
    }

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

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

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

    .nav-links {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .cart-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .cart-item-actions {
        flex-direction: column;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }
}

/* ---- Вкладки админ-панели ---- */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    border-bottom: 2px solid var(--gray-border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.7rem 1.2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray);
    border-bottom: 3px solid transparent;
    transition: all var(--transition);
    margin-bottom: -2px;
}

    .tab-btn:hover {
        color: var(--dark);
    }

    .tab-btn.active {
        color: var(--primary);
        border-bottom-color: var(--primary);
    }

/* Все кнопки на фоне primary цвета — белый текст */
[style*="background: var(--primary)"] .btn,
[style*="background-color: var(--primary)"] .btn,
.bg-primary .btn,
.btn-primary { /* если сама кнопка имеет этот фон */
    color: white !important;
}