/* ===== ОСНОВНЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --primary-dark: #e85d2c;
    --primary-light: #ff8c5a;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    
    --border-radius-sm: 5px;
    --border-radius-md: 10px;
    --border-radius-lg: 15px;
    
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.1);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
}

/* ===== ТЕМЫ ===== */
.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-footer: #2c3e50;
    
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-light: #ffffff;
    
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
    --input-border: #dddddd;
    --input-focus: var(--primary-color);
    
    --shadow-color: rgba(0,0,0,0.1);
    --hover-bg: #f5f5f5;
    
    --link-color: var(--primary-color);
    --link-hover: var(--primary-dark);
    
    --gradient-start: #ff6b35;
    --gradient-end: #ff8c5a;
}

.dark-theme {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #333333;
    --bg-header: #2d2d2d;
    --bg-footer: #000000;
    
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --text-light: #ffffff;
    
    --border-color: #404040;
    --input-bg: #404040;
    --input-border: #505050;
    --input-focus: var(--primary-light);
    
    --shadow-color: rgba(0,0,0,0.3);
    --hover-bg: #3d3d3d;
    
    --link-color: var(--primary-light);
    --link-hover: var(--primary-color);
    
    --gradient-start: #ff6b35;
    --gradient-end: #ff8c5a;
}

/* ===== БАЗОВЫЕ СТИЛИ ===== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===== ТИПОГРАФИЯ ===== */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.3;
}

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

p {
    margin-bottom: 15px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--link-hover);
}

/* ===== HEADER ===== */
header {
    background-color: var(--bg-header);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    color: var(--primary-color);
    font-size: 28px;
}

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

/* Навигация */
.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color var(--transition-fast);
}

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

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Мобильное меню */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Theme switcher */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-secondary);
    padding: 3px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.theme-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-btn:hover {
    color: var(--primary-color);
    background: var(--hover-bg);
}

.theme-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* User menu */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 8px 15px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.user-btn:hover {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    min-width: 220px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

/* Добавляем невидимый мост между кнопкой и меню */
.user-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.dropdown-menu a i {
    width: 20px;
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

.discount-badge-small {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
}
/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    text-align: center;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gradient-end), var(--gradient-start));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

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

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

.btn-large {
    padding: 15px 40px;
    font-size: 18px;
}

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
    border-radius: var(--border-radius-sm);
}

.btn-block {
    display: block;
    width: 100%;
}

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

/* ===== CARDS ===== */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--input-border);
    border-radius: var(--border-radius-md);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 16px;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    padding: 100px 0;
    text-align: center;
    margin-bottom: 60px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.hero-buttons .btn {
    min-width: 200px;
}

.hero-buttons .btn-outline {
    border-color: white;
    color: white;
}

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

/* ===== FEATURES SECTION ===== */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 50px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.feature-card {
    text-align: center;
    padding: 40px 20px;
}

.feature-card i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.product-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

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

.product__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.product__title {
    padding: 15px 15px 5px;
    font-size: 1.2rem;
    font-weight: 600;
}

.product__desc {
    padding: 0 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
}

.product__price {
    padding: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.product-card .btn {
    margin: 0 15px 15px;
}

/* ===== STEPS ===== */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.step {
    text-align: center;
    position: relative;
}

.step__num {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 20px;
}

/* ===== CTA ===== */
.cta {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 80px 0;
    margin: 50px 0;
}

.cta__title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta__text {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.cta__buttons .btn {
    margin: 0 10px;
}

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

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

/* ===== CALCULATOR ===== */
.calculator__wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin: 50px 0;
}

.category-block {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.category-header {
    padding: 15px 20px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.category-products {
    padding: 20px;
}

.product-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.product-row:last-child {
    border-bottom: none;
}

.product-info {
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 500;
}

.product-price {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.product-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.product-inputs input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Cart */
.calculator__cart {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 20px;
    position: sticky;
    top: 100px;
    height: fit-content;
    border: 1px solid var(--border-color);
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
}

.cart-item-quantity {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
}

.cart-item-remove:hover {
    color: var(--danger-color);
}

.cart-totals {
    margin: 20px 0;
    padding: 20px 0;
    border-top: 2px solid var(--border-color);
}

.total-row, .discount-row, .final-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.final-row {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Order form */
.order-form {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 30px;
    margin-top: 30px;
    border: 1px solid var(--border-color);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-footer);
    color: var(--text-light);
    padding: 50px 0 20px;
    margin-top: 50px;
}

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

.footer__nav a, .footer__catalog a {
    display: block;
    color: #b3b3b3;
    text-decoration: none;
    margin: 5px 0;
}

.footer__nav a:hover, .footer__catalog a:hover {
    color: var(--primary-color);
}

.footer__bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #b3b3b3;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .container { padding: 0 15px; }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-header);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-md);
        border-top: 1px solid var(--border-color);
    }
    
    .nav-menu.active { display: flex; }
    
    .header-content { flex-wrap: wrap; }
    .header-actions { margin-left: auto; }
    
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    
    .calculator__wrapper { grid-template-columns: 1fr; }
    .product-row { grid-template-columns: 1fr; }
    .product-inputs { justify-content: flex-start; }

@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: 1px solid var(--border-color);
        margin-top: 10px;
    }
    
    .user-dropdown:hover .dropdown-menu {
        display: none;
    }
    
    .user-dropdown.active .dropdown-menu {
        display: block;
    }
}

@media (max-width: 480px) {
    .nav { flex-direction: column; align-items: center; }
    .nav a { margin: 5px 0; }
    .cta__buttons .btn { display: block; margin: 10px 0; }
    .features-grid,
    .products-grid,
    .steps { grid-template-columns: 1fr; }
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.6s ease forwards; }

/* ===== СКРОЛЛБАР ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }