:root {
    --primary: #333333;
    --accent: #fa5b3d;
    --accent-hover: #e04a2d;
    --bg-body: #f9f9f9;
    --bg-card: #ffffff;
    --text-main: #444444;
    --text-muted: #888888;
    --border: #eeeeee;
    --radius: 8px;
    --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; width: 100%; max-width: 100vw; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: 1300px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

/* HEADER */
header { background: #ffffff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; flex-wrap: wrap; }

.nav-left { display: flex; align-items: center; gap: 15px; }
.menu-btn { display: none; font-size: 26px; background: none; border: none; cursor: pointer; color: var(--primary); }
.logo { font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: 1px; text-transform: uppercase; }

.search-form { flex: 1 1 auto; max-width: 500px; display: flex; margin: 0 20px; position: relative; }
.search-form input { flex: 1; padding: 12px 20px; border: 1px solid var(--border); border-radius: 50px; outline: none; font-size: 14px; background: var(--bg-body); transition: all 0.2s; min-width: 0; }
.search-form input:focus { background: #fff; border-color: var(--text-muted); box-shadow: 0 0 0 3px rgba(0,0,0,0.03); }
.search-form button { position: absolute; right: 5px; top: 5px; bottom: 5px; padding: 0 20px; background: var(--primary); color: white; border: none; border-radius: 50px; cursor: pointer; font-size: 13px; font-weight: 600; }

.lang-switch a { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 50px; background: var(--bg-body); color: var(--text-muted); transition: all 0.2s; display: inline-block; }
.lang-switch a.active, .lang-switch a:hover { background: var(--accent); color: white; }

/* LAYOUT */
.main-layout { display: flex; gap: 40px; margin-top: 40px; margin-bottom: 60px; align-items: flex-start; width: 100%; max-width: 100%; }
.content-area { flex: 1; min-width: 0; width: 100%; max-width: 100%; }

/* SIDEBAR */
.sidebar { width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 100px; background: var(--bg-card); border-radius: var(--radius); padding: 30px 20px; box-shadow: 0 5px 20px rgba(0,0,0,0.03); }
.sidebar-title { font-size: 14px; font-weight: 700; text-transform: uppercase; color: var(--primary); letter-spacing: 1px; margin-bottom: 20px; }

.cat-nav li { margin-bottom: 5px; }
.cat-nav a { display: block; padding: 10px 15px; border-radius: 6px; font-size: 14px; color: var(--text-main); font-weight: 500; transition: all 0.2s; }
.cat-nav a:hover, .cat-nav a.active { background: var(--bg-body); color: var(--accent); padding-left: 20px; }

.cat-nav details { margin-top: 15px; }
.cat-nav summary { padding: 10px 15px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-top: 1px solid var(--border); list-style: none; transition: color 0.2s; }
.cat-nav summary:hover { color: var(--accent); }
.cat-nav summary::-webkit-details-marker { display: none; }
.cat-nav details[open] summary { color: var(--primary); border-bottom: 1px solid var(--border); margin-bottom: 10px; }

.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; }

@media (max-width: 992px) {
    .main-layout { flex-direction: column; align-items: stretch; margin-top: 20px; }
    .menu-btn { display: block; }
    .search-form { order: 3; flex: 0 0 100%; max-width: 100%; margin: 15px 0 0 0; }
    .sidebar { position: fixed; top: 0; left: -320px; height: 100vh; width: 300px; z-index: 1000; overflow-y: auto; transition: left 0.3s; border-radius: 0; }
    .sidebar.open { left: 0; }
    .mobile-overlay.open { display: block; }
}

/* PRODUCT GRID */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 30px; }
.item-card { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: all 0.3s ease; box-shadow: 0 2px 10px rgba(0,0,0,0.02); border: 1px solid transparent; }
.item-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.06); border-color: var(--border); }

.item-img-box { width: 100%; aspect-ratio: 1; padding: 30px; display: flex; align-items: center; justify-content: center; background: #fff; }
.item-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform 0.3s; }
.item-card:hover .item-img-box img { transform: scale(1.05); }

.item-info { padding: 25px; display: flex; flex-direction: column; flex: 1; border-top: 1px solid var(--border); }
.item-category { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; letter-spacing: 0.5px; }
.item-title { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 15px; color: var(--primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-title:hover { color: var(--accent); }

.price-current { font-size: 18px; font-weight: 800; color: var(--accent); }
.price-old { font-size: 13px; text-decoration: line-through; color: #adb5bd; margin-left: 8px; font-weight: 500; }

.btn-view { display: inline-block; padding: 10px 20px; background: var(--bg-body); color: var(--primary); border-radius: 50px; font-size: 13px; font-weight: 600; text-align: center; transition: all 0.2s; margin-top: auto; }
.btn-view:hover { background: var(--accent); color: white; }

/* PRODUCT SINGLE PAGE */
.product-wrap { display: flex; gap: 50px; background: var(--bg-card); padding: 40px; border-radius: var(--radius); box-shadow: 0 5px 20px rgba(0,0,0,0.02); min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
.product-gallery { width: 45%; position: sticky; top: 110px; align-self: flex-start; min-width: 0; max-width: 100%; }
.img-main { width: 100%; max-width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--bg-body); border-radius: var(--radius); padding: 30px; margin-bottom: 15px; overflow: hidden; }
.img-main img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.thumb-list { display: flex; gap: 10px; overflow-x: auto; width: 100%; max-width: 100%; padding-bottom: 10px; box-sizing: border-box; -webkit-overflow-scrolling: touch; }
.thumb-item { width: 80px; height: 80px; background: var(--bg-body); border-radius: 8px; padding: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; border: 2px solid transparent; transition: all 0.2s; flex-shrink: 0; }
.thumb-item.active, .thumb-item:hover { border-color: var(--accent); background: #fff; }
.thumb-item img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.product-details { width: 55%; min-width: 0; max-width: 100%; }
.breadcrumbs { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; word-wrap: break-word; }
.breadcrumbs a:hover { color: var(--accent); }

.product-details h1 { font-size: 32px; font-weight: 800; line-height: 1.2; margin-bottom: 25px; color: var(--primary); overflow-wrap: anywhere; word-break: break-word; }

.price-huge { font-size: 36px; font-weight: 800; color: var(--accent); margin-bottom: 30px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 15px; padding-bottom: 30px; border-bottom: 1px solid var(--border); }
.price-huge .old { font-size: 20px; color: #adb5bd; text-decoration: line-through; font-weight: 600; }

.specs-table { width: 100%; max-width: 100%; border-collapse: collapse; margin-bottom: 40px; font-size: 14px; table-layout: fixed; word-break: break-word; overflow-wrap: break-word; }
.specs-table td { padding: 15px 0; border-bottom: 1px solid var(--border); }
.specs-table tr td:first-child { width: 40%; color: var(--text-muted); font-weight: 600; }
.specs-table tr td:last-child { font-weight: 500; color: var(--primary); }

.prose { line-height: 1.8; color: #555; font-size: 15px; width: 100%; max-width: 100%; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; }
.prose h2, .prose h3 { color: var(--primary); margin: 30px 0 15px; font-weight: 700; font-size: 20px; }
.prose p { margin-bottom: 15px; }
.prose ul { margin-left: 20px; margin-bottom: 15px; }
.prose img { border-radius: var(--radius); margin: 20px 0; max-width: 100%; height: auto; display: block; }
.prose table { width: 100%; border-collapse: collapse; overflow-x: auto; display: block; }

@media (max-width: 992px) {
    .product-wrap { 
        flex-direction: column; 
        padding: 20px; 
        gap: 30px; /* Уменьшаем отступ для мобилок, иначе он ломает сетку */
        width: 100%; 
        max-width: 100%; 
        overflow-x: hidden; /* Глухая защита от горизонтального растягивания детьми */
    }
    .product-gallery, .product-details { 
        width: 100%; 
        min-width: 0; 
        max-width: 100%; 
    }
    .product-gallery { position: relative; top: 0; }
}

/* PAGINATION */
.pagination { display: flex; gap: 10px; justify-content: center; margin-top: 50px; flex-wrap: wrap; }
.page-link { min-width: 40px; height: 40px; padding: 0 15px; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border-radius: 50px; font-weight: 600; color: var(--text-main); transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.page-link:hover { background: var(--accent); color: white; transform: translateY(-2px); }
.page-link.active { background: var(--primary); color: white; }

/* FOOTER */
footer { background: var(--primary); color: white; padding: 60px 0 30px; margin-top: auto; width: 100%; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
footer h3 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; color: #888; }
footer p, footer a { color: #ccc; font-size: 14px; transition: color 0.2s; }
footer a:hover { color: var(--accent); }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid #444; color: #888; font-size: 13px; }