/*
Theme Name: КРЕПВЕНТ
Theme URI: https://krepvent.ru
Author: КРЕПВЕНТ
Author URI: https://krepvent.ru
Description: Тема для сайта КРЕПВЕНТ — крепёж и вентиляционные комплектующие
Version: 2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: krepvent
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #E8611A;
    --primary-hover: #d45510;
    --dark: #1a1a2e;
    --text: #333;
    --text-light: #666;
    --bg: #f5f5f5;
    --white: #fff;
    --border: #e0e0e0;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --transition: 0.3s ease;
    --font-head: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --container: 1200px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    text-align: center;
    line-height: 1;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232,97,26,0.35);
}

.btn-outline {
    background: transparent;
    color: var(--dark);
    border-color: var(--dark);
}
.btn-outline:hover {
    background: var(--dark);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-white {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
}
.btn-white:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ===== HEADER ===== */
.site-header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 150px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.site-logo img {
    height: 140px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav ul {
    display: flex;
    gap: 24px;
}

.main-nav a {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    position: relative;
    padding: 4px 0;
    white-space: nowrap;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}

.main-nav a:hover::after,
.main-nav .current-menu-item a::after {
    width: 100%;
}

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

.header-cta .btn { padding: 10px 24px; font-size: 14px; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    transition: all var(--transition);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    padding: 80px 0;
    overflow: hidden;
    min-height: 520px;
    display: flex;
    align-items: center;
}

.hero-bg {
    position: absolute;
    top: 0; right: 0;
    width: 55%; height: 100%;
    background-size: cover;
    background-position: center;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, #f0f0f0 0%, rgba(240,240,240,0.5) 50%, transparent 100%);
}

.hero .container { position: relative; z-index: 2; }

.hero-content { max-width: 550px; }

.hero-content h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    font-style: italic;
}

.hero-content p {
    font-size: 17px;
    color: var(--text-light);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

/* ===== ADVANTAGES ===== */
.advantages {
    padding: 50px 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

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

.advantage-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.advantage-icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    background: #FFF3EC;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.advantage-icon svg {
    width: 24px; height: 24px;
    stroke: var(--primary);
    fill: none;
    stroke-width: 2;
}

.advantage-text h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.advantage-text p { font-size: 13px; color: var(--text-light); line-height: 1.4; }

/* ===== SECTIONS ===== */
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 32px; margin-bottom: 10px; }
.section-header p { font-size: 16px; color: var(--text-light); }

/* ===== CATEGORIES GRID ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

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

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

.category-card-image {
    width: 100%;
    height: 260px;
    background: #f0f0f0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.4s ease;
}

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

.category-card-body {
    padding: 18px 20px;
}

.category-card-body h3 { font-size: 17px; margin-bottom: 6px; }
.category-card-body p { font-size: 13px; color: var(--text-light); line-height: 1.5; }

/* ===== CTA SECTION ===== */
.cta-section {
    padding: 70px 0;
    background: var(--dark);
    text-align: center;
    color: var(--white);
}
.cta-section h2 { color: var(--white); font-size: 30px; margin-bottom: 14px; }
.cta-section p {
    color: rgba(255,255,255,0.7);
    font-size: 17px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto; margin-right: auto;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #111122;
    color: rgba(255,255,255,0.7);
    padding: 50px 0 24px;
}

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

.footer-col h4 { color: var(--white); font-size: 15px; margin-bottom: 16px; font-family: var(--font-head); }
.footer-col p { font-size: 14px; line-height: 1.7; margin-bottom: 6px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { font-size: 14px; color: rgba(255,255,255,0.7); }
.footer-col ul a:hover { color: var(--primary); }

.footer-logo {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 18px;
    color: var(--white);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo img { height: 80px; width: auto; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
}

/* ===== CATALOG PAGE ===== */
.page-hero {
    background: linear-gradient(135deg, var(--dark) 0%, #2a2a4e 100%);
    padding: 55px 0;
    color: var(--white);
    text-align: center;
}
.page-hero h1 { color: var(--white); font-size: 34px; margin-bottom: 10px; }
.page-hero p { color: rgba(255,255,255,0.7); font-size: 16px; }

.catalog-filters {
    padding: 24px 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.filters-row { display: flex; gap: 10px; flex-wrap: wrap; }

.filter-btn {
    padding: 9px 22px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--white);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
}

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

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 48px 0;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.product-card-image {
    width: 100%; height: 180px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card-image img { width: 100%; height: 100%; object-fit: cover; }

.product-card-body { padding: 16px; }
.product-card-body h3 { font-size: 15px; margin-bottom: 5px; }
.product-card-body .product-desc { font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.product-card-body .product-price {
    font-family: var(--font-head); font-weight: 700; font-size: 17px;
    color: var(--primary); margin-bottom: 10px;
}
.product-card-body .btn { width: 100%; justify-content: center; padding: 9px; font-size: 13px; }

/* ===== CALCULATOR ===== */
.calc-section { padding: 80px 0; background: var(--white); }

.calc-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #fafafa;
    border-radius: 16px;
    padding: 44px;
    box-shadow: var(--shadow);
}
.calc-wrapper h2 { text-align: center; margin-bottom: 10px; font-size: 28px; }
.calc-wrapper > p { text-align: center; color: var(--text-light); margin-bottom: 32px; }

.calc-form { display: grid; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--dark); }

.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color var(--transition);
    background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,97,26,0.1);
}

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

.calc-result {
    margin-top: 28px; padding: 22px; background: var(--white);
    border-radius: var(--radius); border: 2px solid var(--primary);
    display: none;
}
.calc-result.show { display: block; }
.calc-result h3 { font-size: 19px; margin-bottom: 14px; color: var(--primary); }

.calc-result-table { width: 100%; border-collapse: collapse; }
.calc-result-table th, .calc-result-table td {
    padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px;
}
.calc-result-table th {
    font-family: var(--font-head); font-weight: 600; color: var(--dark); background: var(--bg);
}
.calc-result-total {
    font-family: var(--font-head); font-weight: 700; font-size: 19px;
    color: var(--primary); margin-top: 14px; text-align: right;
}

/* ===== CONTACTS ===== */
.contacts-section { padding: 80px 0; }

.contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.contact-info-card, .contact-form-card {
    background: var(--white);
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow);
}

.contact-info-card h2, .contact-form-card h2 { font-size: 26px; margin-bottom: 20px; }
.contact-form-card > p { color: var(--text-light); margin-bottom: 24px; font-size: 15px; }

.contact-item { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }

.contact-item-icon {
    flex-shrink: 0; width: 42px; height: 42px;
    background: #FFF3EC; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.contact-item-icon svg { width: 20px; height: 20px; stroke: var(--primary); fill: none; stroke-width: 2; }

.contact-item-text h4 { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.contact-item-text p, .contact-item-text a { font-size: 15px; color: var(--text-light); }
.contact-item-text a:hover { color: var(--primary); }

.contact-form .form-group textarea { min-height: 110px; resize: vertical; }
.contact-form .btn { margin-top: 6px; }

.map-section {
    margin-top: 50px; border-radius: 16px; overflow: hidden; height: 380px;
    background: #e0e0e0; display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #999;
}

/* ===== 404 ===== */
.page-404 { text-align: center; min-height: 50vh; display: flex; align-items: center; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .advantages-grid, .categories-grid, .catalog-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero-content h1 { font-size: 34px; }
}

@media (max-width: 768px) {
    .header-inner { height: 100px; }
    .site-logo img { height: 80px; }

    .main-nav ul {
        display: none;
        position: absolute;
        top: 100px; left: 0; right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 16px 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        gap: 0;
    }
    .main-nav ul.active { display: flex; }
    .main-nav ul li a { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); }
    .menu-toggle { display: flex; }
    .header-cta { display: none; }

    .hero { padding: 50px 0; min-height: auto; }
    .hero-bg { width: 100%; opacity: 0.2; }
    .hero-content h1 { font-size: 28px; }
    .advantages-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    .categories-grid, .catalog-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .contacts-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .calc-wrapper { padding: 24px 18px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
    .advantages-grid, .categories-grid, .catalog-grid { grid-template-columns: 1fr; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; justify-content: center; }
    .section { padding: 50px 0; }
}
