/*
Theme Name: WB Radiodetal
Theme URI: https://yoursite.com
Author: Your Name
Version: 2.0
Text Domain: wb-radiodetal
Description: Тема в стиле маркетплейса Wildberries для скупки радиодеталей.
*/

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f6f6;
    --bg-card: #ffffff;
    --bg-hover: #f0f0f0;
    --text-primary: #242424;
    --text-secondary: #868695;
    --accent: #cb11ab; /* Фирменный фиолетовый */
    --accent-hover: #a90e8f;
    --success: #00a046; /* Зеленый как у WB */
    --border: #e0e0e0;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 12px;
}

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

body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--accent); }

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* === HEADER (Стиль WB) === */
.site-header {
    background: #ffffff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.site-logo { font-size: 24px; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; text-transform: uppercase; }
.site-logo img { max-height: 40px; }

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
}

.main-navigation a:hover { background: var(--bg-hover); color: var(--accent); }

/* Кнопки связи в шапке */
.header-contact-buttons {
    display: flex;
    gap: 10px;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-phone {
    background: var(--accent);
    color: #fff;
}
.btn-phone:hover { background: var(--accent-hover); color: #fff; }

.btn-whatsapp {
    background: var(--success);
    color: #fff;
}
.btn-whatsapp:hover { background: #008a3c; color: #fff; }

/* Мобильное меню */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
}

@media (max-width: 992px) {
    .menu-toggle { display: flex; }
    .main-navigation {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: #fff;
        padding: 20px;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    .main-navigation.active { left: 0; }
    .main-navigation ul { flex-direction: column; }
    .header-contact-buttons { flex-direction: column; width: 100%; margin-top: 20px; }
    .btn-contact { width: 100%; justify-content: center; }
}

/* === HERO BANNER (Светлый) === */
.hero-banner {
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}

/* Затемнение для читаемости текста */
.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    padding: 40px;
}

.hero-content h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
    color: var(--text-primary);
}

.hero-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* === BUTTONS (Стиль WB) === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: transform 0.1s, opacity 0.2s;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-whatsapp { background: var(--success); color: #fff; }
.btn-whatsapp:hover { background: #008a3c; color: #fff; }

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

.contact-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* === CARDS & GRID (Маркетплейс) === */
.section-row { margin: 40px 0; }
.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    padding-left: 0;
}

.row-scroller {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
}
.row-scroller::-webkit-scrollbar { height: 6px; }
.row-scroller::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.row-card {
    flex: 0 0 220px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.row-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}

.row-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #f0f0f0;
}

.row-card-info { padding: 12px; }
.row-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.row-card-meta {
    font-size: 13px;
    color: var(--success);
    font-weight: 700;
}
.row-card-old-price {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-left: 5px;
}

/* === FILTERS (Светлые) === */
.advanced-filter, .modern-filter-section {
    background: #fff;
    padding: 25px;
    margin: 30px 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.filter-grid, .modern-filter-form .filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-group label, .filter-field label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.filter-group select, .filter-group input,
.filter-field input, .filter-field select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.filter-group select:focus, .filter-group input:focus,
.filter-field input:focus, .filter-field select:focus {
    border-color: var(--accent);
    background: #fff;
}

.filter-submit { grid-column: 1 / -1; text-align: center; margin-top: 15px; }
.btn-search {
    background: var(--accent);
    color: #fff;
    width: 100%;
    max-width: 300px;
}

/* === DETAIL PAGE (Карточка товара) === */
.detail-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background: #fff;
    padding: 30px;
    border-radius: var(--radius);
    margin: 30px 0;
    box-shadow: var(--shadow);
}

.detail-poster {
    flex: 0 0 300px;
    max-width: 300px;
    background: #f9f9f9;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-poster img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
}

.detail-info { flex: 1; min-width: 300px; }
.detail-info h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.detail-subtitle { font-size: 18px; color: var(--text-secondary); margin-bottom: 10px; }
.detail-slogan { font-size: 14px; color: var(--accent); font-weight: 600; margin-bottom: 20px; text-transform: uppercase; }
.detail-meta { color: var(--text-primary); margin-bottom: 25px; line-height: 1.6; }
.detail-price {
    font-size: 32px;
    color: var(--success);
    font-weight: 800;
    margin: 20px 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.detail-price span { font-size: 14px; color: var(--text-secondary); font-weight: 400; }

/* === CONTENT BLOCKS === */
.content-block {
    margin: 40px 0;
    padding: 30px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.content-block h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-left: 4px solid var(--accent);
    padding-left: 15px;
}
.content-block p, .content-block div {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
}

/* === TABLES (Прайс-лист) === */
.price-table, .metal-table, .price-table-edit {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.price-table th, .metal-table th, .price-table-edit th {
    padding: 15px;
    text-align: left;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
}

.price-table td, .metal-table td, .price-table-edit td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
}

.price-table tr:hover, .price-table-edit tr:hover { background: var(--bg-hover); }

/* === EXTRA INFO BLOCKS (Сетка) === */
.extra-info-section { margin: 40px 0; }
.extra-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.extra-block {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.extra-block:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}

.extra-block-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.extra-block-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(203, 17, 171, 0.1);
    color: var(--accent);
    border-radius: 8px;
}

.extra-block-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.extra-block-content { color: var(--text-secondary); line-height: 1.5; font-size: 14px; }

/* === BREADCRUMBS === */
.breadcrumbs {
    padding: 15px 0;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .separator { margin: 0 8px; color: #ccc; }

/* === FOOTER === */
.site-footer {
    background: #242424;
    padding: 60px 0 30px;
    margin-top: 80px;
    color: #fff;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-grid h4 { color: #fff; margin-bottom: 20px; font-size: 16px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { color: #ccc; font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #333;
    color: #666;
    font-size: 13px;
}

/* === CATEGORY GRID (3 колонки) === */
.category-grid-section { margin: 40px 0; }
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.category-grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
    transition: transform 0.2s;
    display: block;
    background: #fff;
    box-shadow: var(--shadow);
}
.category-grid-item:hover { transform: scale(1.02); }
.category-grid-item img { width: 100%; height: 100%; object-fit: cover; }
.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}
.category-title { color: #fff; font-size: 16px; font-weight: 700; }

@media (max-width: 992px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .category-grid { grid-template-columns: 1fr; } }

/* === PAGINATION === */
.pagination { display:flex; justify-content:center; gap:8px; margin:40px 0; }
.pagination a, .pagination span {
    display:inline-flex; align-items:center; justify-content:center;
    min-width:40px; height:40px; padding:0 15px;
    background:#fff; border:1px solid var(--border); border-radius:8px;
    color:var(--text-primary); text-decoration:none; font-size:14px;
}
.pagination a:hover, .pagination .current { background:var(--accent); border-color:var(--accent); color:#fff; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 28px; }
    .detail-hero { flex-direction: column; }
    .detail-poster { max-width: 100%; }
    .contact-buttons { flex-direction: column; }
    .btn { width: 100%; }
}