@font-face {
    font-family: 'pf_bague_sans_proregular';
    src: url('font/pfbaguesanspro-regular.woff2') format('woff2'),
         url('font/pfbaguesanspro-regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* { 
    margin: 0; 
    padding: 0; 
}

html, body {
    height: 100%;
    font-family: 'pf_bague_sans_proregular';
    line-height: 1.2em;
    -webkit-text-size-adjust: 100%;
}

/* Паттерн фона вешаем на html, чтобы он заполнял весь экран */
html {
    background: url(back-main.png) repeat;
}

/* У body убираем фон, чтобы центрированный контейнер был прозрачным по бокам */
body {
    font-size: 150%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { border: 0; }

a { color: #000; }
a:hover { text-decoration: none; }

input[type=button], input[type=submit] {
    border: 1px outset #5189a7;
    background-color: #5189a7;
    color: #fff;
    font-family: 'pf_bague_sans_proregular';
    font-size: .9em;
    padding: 0.3em 0.4em;
    border-radius: 0.3em;
    box-sizing: border-box;
    white-space: normal;
    height: auto;
    margin-bottom: 1em;
}
 
input[type=button]:hover, input[type=submit]:hover {
    border: 1px inset #5189a7;
}

input[type=text], input[type=password], select, textarea {
    font-family: 'pf_bague_sans_proregular';
    font-size: .9em;
    border: 1px solid #5189a7;
    border-radius: 0.3em;
    padding: 0.4em;
    box-sizing: border-box;
}

input[type=button]:disabled, input[type=submit]:disabled {
    color: silver;
}

h1 {
    font-size: 1.1em;
    border-bottom: 2px solid #00519a;
    margin-bottom: 1em;
    padding: 0.3em;
    color: #00519a;
    text-transform: uppercase;
}

h2 {
    font-size: 1.1em;
    margin-bottom: 0.5em;
    color: #633a19;
    line-height: 1.3em;
}

sup {
    color: #ba3c20;
    font-size: 1.2em;
    vertical-align: middle;
}

th {
    font-weight: 400;
    background-color: #F5FAC0;
    border-right: 2px solid #fff;
}

ol { counter-reset: myCounter; }

ol li {
    margin-left: 1.2em;
    list-style: none;
    padding-bottom: 1.7em;
}

ol li::before {
    counter-increment: myCounter;
    content: counter(myCounter);
    color: #fff;
    background: #2980B9;
    display: inline-block;
    text-align: center;
    margin-right: 0.5em;
    margin-left: -2.2em;
    line-height: 1.8em;
    width: 1.8em;
    height: 1.8em;
    font-size: 0.8em;
    border-radius: 2em;
}

ul { margin-bottom: 1em; }

ul li {
    margin-left: 2em;
    list-style: none;
}

ul li::before {
    content: '•';
    color: #F40005;
    margin-right: 0.5em;
    margin-left: -1em;
}

p { margin-bottom: 1.5em; }

fieldset {
    background-color: #fefff5;
    border: 0.02em solid #d2cf51;
    margin-top: 0.6em;
    font-size: 1em;
    padding: 0 0.5em 0.5em 0.5em;
    color: #000;
}

fieldset fieldset { background-color: #fdfdfc; }
fieldset strong { color: #5c7d68; }

legend {
    font-size: 0.85em;
    margin-bottom: 1em;
    color: #fff;
    background-color: #969569;
    padding: 0.2em 0.6em;
    border-radius: 0.3em;
}

.logo {
    width: 26%;
    margin: .5em 0 1em 1em;
}

.content {
    background-color: #fff;
    border: 1px solid #789900;
    border-top: 0;
    border-bottom: 0;
    position: relative;
    vertical-align: top;
    padding-top: 3em;
}

.content #text {
    padding: 0.7em;
    font-size: 1em;
}

.content #text img:not(.icon), .rightsidebar img:not(.icon) {
    border: 1px solid #eff4fc;
    border-radius: 0.7em;
    padding: 2px;
}

.content p {
    margin-bottom: 1em;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

.contentblock {
    border: 0.03em solid #bcb700;
    background: #FEFFF5;
    padding: 1em;
    border-radius: 0.3em;
    margin-bottom: 1em;
}

.contentblock > .top {
    background: #729c1d;
    margin: -1em -1em 0 -1em;
    border-radius: 0.3em 0.3em 0 0;
    padding: 0.5em 1em;
    margin-bottom: 0.5em;
}

.contentblock > .top > strong { color: #fff; }
.contentblock > .top > em { font-size: 0.8em; color: #ccc; }

.contentblock > .bottom {
    background: #F8FFA9;
    margin: 0 -1em -1em -1em;
    padding: 0.5em 0.5em 0.5em 4em;
    border-radius: 0 0 0.7em 0.7em;
    position: relative;
}

.contentblock > li { margin-left: 1em; }

.content h2 {
    font-size: 1.2em;
    text-decoration: underline;
    margin-bottom: 0.7em;
}

.menu {
    position: absolute;
    z-index: 10;
    left: 0.3em;
    right: 0.3em;
    top: 0;
    border-radius: 0 0 1em 1em;
    line-height: 0.5em;
    padding: 0.6em;
    background: #557E00;
    background: linear-gradient(to top, #557E00, #649800);
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.75);
    display: none;
    font-size:0.95em;
}

.menu, .menu a { color: #fff; }
.menu a:hover { text-decoration: none; }

.tab, .tabselected {
    display: inline-block;
    border: 2px solid transparent;
    position: static;
}

.tab:hover {
    border-radius: 0.6em;
    border: 2px solid #DFF982;
}

.tabselected {
    border: 2px solid #6a8700;
    background: url(back-main.png);
    border-radius: 0.6em;
}

.tabselected a { color: #000; }

.submenu {
    position: absolute;
    width: auto;
    background-color: #557E00;
    white-space: nowrap;
    border-radius: 0.2em;
    padding: 0.5em 1em;
    z-index: 20;
    left: 0;
    right: 0;
    top: 3.2em;
}

.menu_level1 { display: block; }
.menu_level1selected a, .menu_level1 a:hover { color: #F0FF2A; }
.menu_level2 { display: block; padding-left: 1em; }
.menu_level2selected a { color: #F0FF2A; }
.menu_level3 { display: block; padding-left: 1.5em; }
.menu_level3selected a { color: #F0FF2A; }

.folded {
    background-image: url(icon-plus.png);
    background-position: left;
    background-repeat: no-repeat;
    padding: 0.3em 0.3em 0.3em 1.8em;
    font-size: 1.1em;
}

.unfolded {
    background-image: url(icon-minus.png);
    background-position: left;
    background-repeat: no-repeat;
    padding: 0.3em 0.3em 0.3em 1.8em;
    font-size: 1.1em;
}

#message {
    font-size: 1em;
    color: #fff;
    padding: 0.5em 0;
    border: 0;
    text-align: center;
    background-color: #d20000;
    border-radius: 1em;
}

.debug {
    border: 1px solid #000;
    border-left: 0;
    border-right: 0;
    background-color: #fff;
    color: #000;
    padding: 0.2em;
    font-size:.8em
}

/* --- Модуль пагинации (.pager) --- */
.pager {
    display: flex !important;
    align-items: center !important;
    overflow-x: auto !important;    
    padding: 0.6em 0 !important;
    -webkit-overflow-scrolling: touch; 
    background-color: #fff !important; 
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pager::-webkit-scrollbar {
    display: none; 
}

.pager > * {
    flex-shrink: 0 !important; 
}

/* Закрепленные стрелки навигации */
.pager > :first-child:not(.pager_dig):not(.pager_dig_selected) {
    position: sticky !important;
    left: 0 !important;               
    z-index: 10 !important;           
    background-color: #fff !important; 
    display: flex !important;
    align-items: center !important;
    padding: 0.6em 0.4em 0.6em 0 !important; 
    margin: -0.6em 0 !important; 
}

.pager > :last-child:not(.pager_dig):not(.pager_dig_selected) {
    position: sticky !important;
    right: 0 !important;              
    z-index: 10 !important;
    background-color: #fff !important; 
    display: flex !important;
    align-items: center !important;
    padding: 0.6em 0 0.6em 0.4em !important;
    margin: -0.6em 0 !important;
}

/* Элементы страниц */
.pager_dig, 
.pager_dig_selected { 
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 2.2em !important;       
    height: 2.2em !important;      
    border-radius: 50% !important; 
    font-size: 0.9em !important; 
    border: 1px solid #81A55C !important;
    box-sizing: border-box !important; 
    margin: 0 0.25em !important;
    background-color: #fff !important;
}

.pager_dig a {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;       
    height: 100% !important;
    text-decoration: none !important;
    color: #473E2D !important;    
    border-radius: 50% !important; 
}

.pager_dig_selected {
    font-weight: 700 !important;
    color: #fff !important;
    background-color: #81A55C !important;
}

.pager img, 
.pager input[type="image"] {
    max-height: 2.2em !important;
    width: auto !important;
    display: block !important;
    background-color: transparent !important; 
}

/* --- Боковая панель и вспомогательные блоки --- */
.sidebarblock {
    background: url(back-sidebar.jpg);
    padding: 0.7em;
    margin: .7em;
    border-radius: 0.6em;
    border: 0.05em solid #789900;
}

.sidebarblock, .sidebarblock a { color: #00519a; }
.sidebarblock p { margin-bottom: 0.5em; }
.sidebarblock a:hover { text-decoration: none; }

.sidebarblock h2 {
    margin-bottom: 0.5em;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.9em;
    text-shadow: 1px 1px 1px rgba(150,150,150,0.7);
}

.sidebarblock h2 a { color: #633a19; }

.catalogmenu { border: 2px solid transparent; }
.catalogmenu:hover {
    border-radius: 0.6em;
    border: 2px solid #CBD098;
}

.catalogmenuselected {
    background-color: #FEFFDB;
    border-radius: 0.6em;
    border: 2px solid #CBD098;
}

.price {
    color: #3ea1b9;
    font-weight: 700;
    margin-top: 0.5em;
    text-align: center;
}

.unit {
    font-size: 0.7em;
    color: #ff8530;
}

.spoiler_header {
    background-color: #c8d4e9;
    color: #37496a;
    border: 1px solid #7d97c6;
    border-radius: 0.3em;
    padding: 0.3em 0.3em 0.3em 1.8em;
}

.spoiler {
    background-color: #F1F1F1;
    border: 1px dotted #CDCDCB;
    border-top: 0;
    padding: 0.6em;
}

#menuicon {
    position: absolute;
    right: 0.5em;
    display: none;
    z-index: 100;
}

.fhidden { display: none; }

.statusicon {
    color: #c30000;
    margin-bottom: 0.5em;
}

hr {
    margin-top: 1em;
    margin-bottom: 1em;
    border: 0;
    border-bottom: 0.01em solid #568000;
}

/* ==========================================================================
   МЕДИАЗАПРОСЫ (Упорядочены по каскаду)
   ========================================================================== */

/* 1. Масштабирование шрифта базового контейнера */
@media screen and (max-width: 1000px) {
    body { font-size: 120%; }
}

@media screen and (max-width: 400px) {
    body { font-size: 110%; }
}

/* 2. Ориентация устройства и колонки подменю */
@media screen and (orientation: portrait) {
    .submenu {
        -webkit-column-count: 3;
        -moz-column-count: 3;
        column-count: 3;
        line-height: 2em;
    }
    .tab, .tabselected { padding: 0.4em; }
}

@media screen and (orientation: landscape) {
    .submenu {
        -webkit-column-count: 4;
        -moz-column-count: 4;
        column-count: 4;
        line-height: 1.7em;
        top: 3.6em;
    }
    .tab, .tabselected { padding: 0.4em 0.2em; }
    /* Исправление "мертвой зоны" при наведении и широкое подменю (Mega Menu) */
    .tab, .tabselected {
        position: static; /* Убрали relative, чтобы подменю привязывалось к главному контейнеру .menu */
    }
    .submenu {
        top: 100%; 
        margin-top: -0.6em; /* Поднимаем подменю ровно на размер нижнего padding (0.6em) родительского .menu, стыкуя с окантовкой таба */
        left: 0;
        right: 0; /* Растягиваем подменю на всю ширину родительского .menu от левого края */
        width: auto; 
    }
    .tab:hover .submenu, 
    .tabselected:hover .submenu {
        display: block !important; 
    }
    
}

/* 3. Ограничения высоты экрана (Альбомный режим) */
@media screen and (orientation: landscape) and (max-height: 400px) {
    .submenu { font-size: 0.9em; }
    .menu { font-size: 0.9em; }    
}

@media screen and (orientation: landscape) and (max-height: 300px) {
    .submenu { font-size: 0.8em; top: 4.1em; }    
}

/* 4. Планшеты с шириной от 800px до 1023px */
@media screen and (min-width: 800px) and (max-width: 1023px) {
    .tab, .tabselected { padding: 0.4em; }
    .submenu { line-height: 2em; }
}

/* 5. Мобильные планшеты и смартфоны (<= 800px) */
@media screen and (max-width: 800px) and (orientation: landscape) {
    .logo { width: 100%; max-width:8.5em }
    .content { padding-top: 3.5em; }    
}

/* 6. Небольшие экраны (<= 530px) */
@media screen and (max-width: 530px) {
    .content { padding-top: 5em; }
}

@media screen and (max-width: 530px) and (orientation: portrait) {
    .submenu {
        top: 5em;
        -webkit-column-count: 2;
        -moz-column-count: 2;
        column-count: 2;
    }
}

/* 7. Узкие устройства (<= 350px и <= 290px) */
@media screen and (max-width: 350px) {
    #basket { font-size: 0.9em; }
    #basket img { display: none; }
}

@media screen and (max-width: 290px) {
    .content { padding-top: 6em; }
}

/* 8. Десктопы (>= 1024px) */
@media screen and (min-width: 1024px) {
    body {
        margin: 0 auto;
        position: relative; /* Создаем контекст позиционирования внутри body */
        font-size: 125%; 
    }
    .content {
        margin: 0 10em; /* Увеличенные прозрачные полосы по бокам (было 3em) */
        padding: 3.5em 0.5em 0.5em 0.5em; /* Внутренние отступы контента */
        background-color: #fff; /* Оставляем контент строго белым */
        border-top: 1px solid #789900;
    }
    .menu {
        left: 10.3em; /* Выравниваем меню с учетом увеличенных боковых полос (было 3.3em) */
        right: 10.3em;
    }
    .logo {
        width: 100%;
        max-width: 8.5em;
        margin: .2em 0 0 1em;
    }
    
    /* Исправление "мертвой зоны" при наведении и широкое подменю (Mega Menu) */
    .tab, .tabselected {
        position: static; /* Убрали relative, чтобы подменю привязывалось к главному контейнеру .menu */
    }
    .submenu {
        top: 100%; 
        margin-top: -0.6em; /* Поднимаем подменю ровно на размер нижнего padding (0.6em) родительского .menu, стыкуя с окантовкой таба */
        left: 0;
        right: 0; /* Растягиваем подменю на всю ширину родительского .menu от левого края */
        width: auto; 
    }
    .tab:hover .submenu, 
    .tabselected:hover .submenu {
        display: block !important; 
    }
}

/* 9. Телевизоры и Ultra-Wide мониторы (>= 1600px) */
@media screen and (min-width: 1600px) {
    body {
        font-size: 130%; 
    }
}