/* gearshop — layout: top bar, header, search, nav, grid, sidebar, breadcrumbs, footer */
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.wrap-plain { padding-top: 16px; padding-bottom: 16px; }

/* Top bar */
.topbar { background: #1b2530; color: #c9d3de; font-size: 12.5px; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; }
.topbar-note { display: inline-flex; align-items: center; gap: 8px; }
.topbar-note::before { content: "DEMO"; padding: 1px 6px; border-radius: 4px; background: #f0b429; color: #1b2530; font-weight: 800; font-size: 10.5px; letter-spacing: .5px; }
.topbar-links { display: flex; gap: 20px; }

/* Header */
.header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.header-in { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.logo { flex: 0 0 auto; display: block; line-height: 0; }
.logo:hover { text-decoration: none; }
.logo img { width: 236px; height: 40px; }
.header-search { flex: 1 1 auto; min-width: 0; max-width: 640px; }
.header-contacts { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.header-phone { font-size: 19px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.header-phone:hover { color: var(--accent); text-decoration: none; }
.header-hint { font-size: 12px; color: var(--ink-3); }

/* Search (mod_k2_tools override) */
.search-form { position: relative; display: flex; }
.search-form input[type=search] {
    min-height: 44px; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: 0; padding-left: 40px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237a8594' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
}
.search-form input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.search-form button { min-height: 44px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0 20px; }
.suggest {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(20, 32, 48, .16);
    overflow: hidden; max-height: 70vh; overflow-y: auto;
}
.suggest[hidden] { display: none; }
.suggest-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 9px 14px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item.is-active { background: var(--accent-soft); text-decoration: none; color: var(--ink); }
.suggest-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.suggest-price { font-weight: 700; white-space: nowrap; font-size: 14px; }
.suggest-meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); }
.suggest-meta .in { color: var(--ok); }
.suggest-empty { padding: 12px 14px; color: var(--ink-3); font-size: 14px; }
.suggest-all { display: block; padding: 10px 14px; background: var(--line-2); font-size: 13.5px; font-weight: 600; }

/* Main navigation (mod_menu) */
.nav { background: var(--accent); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.nav li { position: relative; }
.nav a, .nav .nav-header, .nav .separator { display: block; padding: 12px 18px; color: #fff; font-weight: 600; font-size: 14.5px; }
.nav a:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.nav li.active > a, .nav li.current > a { background: rgba(0, 0, 0, .18); }
.nav li:first-child > a::before {
    content: ""; display: inline-block; width: 14px; height: 10px; margin-right: 10px; vertical-align: 1px;
    background: linear-gradient(#fff, #fff) 0 0/100% 2px, linear-gradient(#fff, #fff) 0 4px/100% 2px, linear-gradient(#fff, #fff) 0 8px/100% 2px;
    background-repeat: no-repeat;
}
.nav ul ul { display: none; }
.nav-toggle { display: none; }

/* Main grid */
.main { padding: 20px 0 48px; min-height: 60vh; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.has-sidebar .layout { grid-template-columns: 264px minmax(0, 1fr); grid-template-areas: "side content"; }
.has-sidebar .content { grid-area: content; }
.has-sidebar .sidebar { grid-area: side; }
.content { min-width: 0; }

/* Sidebar modules */
.sidebar .moduletable {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.sidebar .moduletable > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); margin-bottom: 10px; }

/* Breadcrumbs (mod_breadcrumbs override) */
.breadcrumbs { margin: 0 0 16px; font-size: 13.5px; color: var(--ink-3); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.breadcrumbs li { display: inline-flex; align-items: center; min-width: 0; }
.breadcrumbs li + li::before { content: "›"; margin: 0 8px; color: #b3bcc7; }
.breadcrumbs a { color: var(--ink-2); }
.breadcrumbs [aria-current] { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }

/* Footer */
.footer { background: #1b2530; color: #aab6c3; font-size: 14px; padding: 36px 0 20px; }
.footer a { color: #d7e0ea; }
.footer h3, .footer h4 { color: #fff; font-size: 15px; margin-bottom: 10px; }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: 6px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding-top: 16px; border-top: 1px solid #2e3b49; font-size: 12.5px; color: #7f8c9a; }

/* Error page */
.error-box { max-width: 620px; margin: 40px auto; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 24px; box-shadow: var(--shadow); }
.error-code { font-size: 72px; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 12px; }
.error-search { display: flex; gap: 8px; margin: 20px 0; }

/* Responsive */
@media (max-width: 1080px) {
    .header-contacts .header-hint { display: none; }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .has-sidebar .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content" "side"; }
    .header-in { flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; }
    .header-search { order: 3; flex: 1 1 100%; max-width: none; }
    .header-contacts { margin-left: auto; }
    .nav-toggle {
        display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
        background: var(--accent-soft); border: 0; border-radius: var(--radius-sm); cursor: pointer;
    }
    .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
        display: block; width: 20px; height: 2px; background: var(--accent); position: relative; content: "";
    }
    .nav-toggle-bar::before { position: absolute; top: -6px; }
    .nav-toggle-bar::after { position: absolute; top: 6px; }
    .nav { display: none; }
    .nav-open .nav { display: block; }
    .nav ul { flex-direction: column; }
    .nav a { border-top: 1px solid rgba(255, 255, 255, .12); }
}
@media (max-width: 640px) {
    .topbar-links { display: none; }
    .logo img { width: 184px; height: 31px; }
    .header-phone { font-size: 15px; }
    .footer-cols { grid-template-columns: minmax(0, 1fr); }
    .error-search { flex-direction: column; }
}
@media (max-width: 400px) {
    .header-contacts { display: none; }
}
