/* assets/css/main.css */

/* Переменные (добавить если нет в :root) */
:root {
    --primary-rgb: 59, 130, 246; /* Пример - заменить на свои значения */
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
}

/* Хлебные крошки */
.breadcrumbs {
    padding: 15px 0;
    font-size: 0.9rem;
    color: var(--gray);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Заголовки страниц */
.page-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--dark);
}

.page-thumbnail {
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.page-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.page-content-inner {
    line-height: 1.8;
    font-size: 1.1rem;
}

.page-content-inner p {
    margin-bottom: 20px;
}

.page-content-inner h2,
.page-content-inner h3,
.page-content-inner h4 {
    margin: 30px 0 15px;
    color: var(--dark);
}

.page-content-inner h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 10px;
}

.page-content-inner h3 {
    font-size: 1.6rem;
}

.page-content-inner ul,
.page-content-inner ol {
    margin: 20px 0;
    padding-left: 30px;
}

.page-content-inner li {
    margin-bottom: 10px;
}

.page-content-inner blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--gray);
}

.page-content-inner table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.page-content-inner th,
.page-content-inner td {
    padding: 12px;
    border: 1px solid var(--gray-light);
    text-align: left;
}

.page-content-inner th {
    background: var(--gray-light);
    font-weight: 600;
}

/* Страница товара */
.product-single {
    padding: 50px 0;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.product-gallery {
    position: sticky;
    top: 100px;
}

.main-image {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
}

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

.thumbnail {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.thumbnail.active {
    border-color: var(--primary);
}

.thumbnail img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.product-info h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.product-meta {
    background: var(--gray-light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.categories a {
    color: var(--gray);
    text-decoration: none;
    margin-right: 10px;
    transition: color 0.2s;
}

.categories a:hover {
    color: var(--primary);
}

.product-description {
    line-height: 1.8;
    margin-bottom: 30px;
}

.product-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.quantity-selector {
    display: flex;
    align-items: center;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 5px;
}

.quantity-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--dark);
    transition: background-color 0.2s;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: none;
    background: none;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Архив товаров */
.archive-header {
    text-align: center;
    padding: 50px 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.archive-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.archive-description {
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

.filters {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.filter-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
}

/* Сообщения */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid #c3e6cb;
    margin: 20px 0;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid #f5c6cb;
    margin: 20px 0;
}

.info-message {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid #bee5eb;
    margin: 20px 0;
}

/* Виджеты */
.widget {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--dark);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}

.widget a:hover {
    color: var(--primary);
    padding-left: 5px;
}

/* Комментарии */
.comments-area {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--gray-light);
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.comment-author img {
    border-radius: 50%;
    margin-right: 15px;
}

.comment-metadata {
    font-size: 0.9rem;
    color: var(--gray);
}

.comment-content {
    line-height: 1.6;
}

.comment-respond {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

.fade-in { animation: fadeIn 0.5s ease-out; }
.slide-in { animation: slideIn 0.3s ease-out; }

/* Пагинация (объединенная версия) */
.pagination {
    display: flex;
    justify-content: center;
    margin: 50px 0;
    gap: 8px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    color: var(--dark);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--gray-light);
}

.pagination a:hover,
.pagination span.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pagination .dots {
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: default;
}

.pagination .prev,
.pagination .next {
    padding: 0 15px;
}

/* Исправление для меню категорий */
.category-menu-wrapper {
    position: relative;
}

.category-toggle {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.category-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 300px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    padding: 20px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.category-menu-wrapper:hover .category-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--gray-light);
    border-radius: 8px;
    color: var(--dark);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.category-list a:hover {
    background: var(--primary);
    color: white;
    transform: translateX(5px);
}

.category-count {
    background: white;
    color: var(--dark);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 10px;
    transition: var(--transition);
}

.category-list a:hover .category-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

.no-categories-message {
    text-align: center;
    padding: 20px;
    color: var(--gray);
}

.no-categories-message p {
    margin-bottom: 15px;
}

.no-categories-message .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Исправление для боковой панели корзины */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2000;
    padding: 30px;
    overflow-y: auto;
}

.cart-sidebar.active {
    right: 0;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2001;
}

.cart-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

/* Лоадер пропеллер дрона */
.drone-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.drone-body {
    width: 80px;
    height: 40px;
    background: var(--primary);
    border-radius: 50% 50% 10px 10px;
    position: relative;
    margin-bottom: 50px;
}

.drone-body::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--dark);
    border-radius: 50%;
}

.propeller {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
}

.propeller-1 {
    top: -40px;
    left: -30px;
    animation: spin 0.8s linear infinite;
}

.propeller-2 {
    top: -40px;
    right: -30px;
    animation: spin 0.8s linear infinite reverse;
}

.propeller-3 {
    bottom: -40px;
    left: -30px;
    animation: spin 1s linear infinite;
}

.propeller-4 {
    bottom: -40px;
    right: -30px;
    animation: spin 1s linear infinite reverse;
}

.propeller-beam {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px dashed rgba(var(--primary-rgb), 0.3);
    border-radius: 50%;
    animation: pulse 2s linear infinite;
}

.propeller-beam-1 { animation-delay: 0s; }
.propeller-beam-2 { animation-delay: 0.5s; }
.propeller-beam-3 { animation-delay: 1s; }

.drone-loader-text {
    margin-top: 30px;
    color: var(--gray);
    font-size: 1.1rem;
}

.drone-loader-text p {
    margin-bottom: 10px;
}

.drone-loader-dots {
    display: inline-block;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Мини-версия */
.drone-loader-sm .drone-body {
    width: 40px;
    height: 20px;
    margin-bottom: 30px;
}

.drone-loader-sm .propeller {
    width: 30px;
    height: 30px;
}

.drone-loader-sm .propeller-1,
.drone-loader-sm .propeller-2 {
    top: -20px;
}

.drone-loader-sm .propeller-3,
.drone-loader-sm .propeller-4 {
    bottom: -20px;
}

.drone-loader-sm .propeller-1,
.drone-loader-sm .propeller-3 {
    left: -15px;
}

.drone-loader-sm .propeller-2,
.drone-loader-sm .propeller-4 {
    right: -15px;
}

/* Уведомление с дроном */
.drone-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    max-width: 350px;
    border-left: 4px solid var(--primary);
}

.drone-notification.show {
    transform: translateX(0);
}

.drone-notification .notification-drone {
    width: 30px;
    height: 15px;
    background: var(--primary);
    border-radius: 50% 50% 10px 10px;
    position: relative;
}

.drone-notification .notification-drone::before,
.drone-notification .notification-drone::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
}

.drone-notification .notification-drone::before {
    top: -15px;
    left: -10px;
    animation: spin 1s linear infinite;
}

.drone-notification .notification-drone::after {
    top: -15px;
    right: -10px;
    animation: spin 1s linear infinite reverse;
}

/* Мини-лоадер для кнопок */
.btn-drone-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-drone-loader .mini-drone {
    width: 20px;
    height: 10px;
    background: white;
    border-radius: 50% 50% 10px 10px;
    position: relative;
}

.btn-drone-loader .mini-drone::before,
.btn-drone-loader .mini-drone::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
}

.btn-drone-loader .mini-drone::before {
    top: -12px;
    left: -8px;
    animation: spin 0.6s linear infinite;
}

.btn-drone-loader .mini-drone::after {
    top: -12px;
    right: -8px;
    animation: spin 0.6s linear infinite reverse;
}

/* Утилиты (оптимизированные) */
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-5 { margin-top: 50px; }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-5 { margin-bottom: 50px; }

.d-flex { display: flex; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.align-center { align-items: center; }

.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 20px; }

/* Кастомный чекбокс */
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-checkbox input {
    display: none;
}

.checkbox-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: var(--transition);
}

.custom-checkbox input:checked + .checkbox-mark {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox input:checked + .checkbox-mark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Тултипы */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--dark);
}

/* Загрузка */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Медиа-запросы (оптимизированные) */
@media (max-width: 992px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .category-dropdown {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    .pagination a,
    .pagination span {
        min-width: 35px;
        height: 35px;
        font-size: 0.9rem;
        padding: 0 8px;
    }
}
/* Добавьте этот код в конец main.css */

/* ===== ГЛАВНАЯ СТРАНИЦА ===== */
.categories-section {
    padding: 80px 0;
    background: var(--gray-light);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    color: var(--dark);
}

.section-title span {
    color: var(--primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.category-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.category-icon i {
    font-size: 2rem;
    color: white;
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.category-card p {
    color: var(--gray);
    margin-bottom: 20px;
    line-height: 1.6;
}

.products-section {
    padding: 80px 0;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.products-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--gray-light);
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

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

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

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.product-category {
    display: inline-block;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
}

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

.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-accent {
    background: var(--accent);
}

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

/* Адаптивность для главной страницы */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .products-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .products-filter {
        width: 100%;
        justify-content: center;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .categories-section,
    .products-section {
        padding: 50px 0;
    }
    
    .category-card {
        padding: 20px;
    }
}