/*
 * Svit Medu - phone / tablet layout.
 * Desktop (wider than 980px) is untouched: every rule lives inside the media query.
 * Three page skeletons, each scoped by its root element:
 *   #area     - classic 915px table pages (index-ua.html, products.html, order*.php ...)
 *   #contmain - article pages on styles.css (honey-*.html, vosk*.html, links*.html ...)
 *   #gz-wrap  - PHP shop (index.php)
 */
/* "Купить в магазине" buttons on the old .html pages and blog posts (desktop + phones) */
.sm-buy { clear: both; margin: 14px 0 !important; padding: 0 !important; text-align: center !important; }
.sm-buy a.sm-buy-btn, #content #main .sm-buy a.sm-buy-btn {
    display: inline-block; padding: 12px 28px !important; border-radius: 8px; background: #66a533 !important;
    box-shadow: 0 2px 0 #4d8226; color: #fff !important; font: bold 17px/1.25 Arial, Helvetica, sans-serif !important;
    text-decoration: none !important; text-transform: none !important;
}
.sm-buy a.sm-buy-btn:hover, #content #main .sm-buy a.sm-buy-btn:hover { background: #57902b !important; text-decoration: none !important; }

@media screen and (max-width: 980px) {

    html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    body { min-width: 0 !important; overflow-x: hidden; }
    img { max-width: 100%; height: auto; }
    iframe, embed, object, video { max-width: 100% !important; }
    iframe[src*="youtube"], iframe[src*="youtu.be"] { height: auto; aspect-ratio: 16 / 9; }
    input, select, textarea { font-size: 16px !important; max-width: 100%; box-sizing: border-box; }
    .m-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
    .m-scroll > table { max-width: none; }
    img.m-wide { float: none !important; display: block !important; width: 100% !important; max-width: 100% !important; height: auto !important; margin: 12px 0 !important; }
    /* one-off pages: 404 page tables, embedded survey widget */
    body > table[width], center table[width], center td[width] { width: auto !important; max-width: 100%; }
    center img[width] { width: auto !important; max-width: 100% !important; }
    #survey-wrap, #survey-wrap *, .start-survey, .width400 { width: auto !important; max-width: 100% !important; box-sizing: border-box; white-space: normal !important; }

    /* ---------- A: #area table layout ---------- */
    #area, #area > tbody, #area > tbody > tr { display: block; width: auto !important; height: auto !important; }
    #area > tbody > tr > td[width="50%"] { display: none; }
    #area > tbody > tr > td[width="915"] { display: block; width: auto !important; background-size: 100% auto; }
    #area div[style*="width: 915px"], #area div[style*="width:915px"] { width: auto !important; }

    #area div#top { height: auto; padding: 8px 10px; }
    #area #top div { padding-top: 0; text-align: center; line-height: 1.6; }
    #area #top select { min-height: 40px; margin: 0 4px; }
    #area #top span { margin-left: 8px; padding-left: 14px; display: inline-block; }
    #area #top a { font-size: 14px; display: inline-block; padding: 8px 4px; }

    #area div[style*="height: 194px"] { height: auto !important; text-align: center; }
    #area div[style*="height: 194px"] > div { position: static !important; width: auto !important; height: auto !important; }
    #area div[style*="height: 194px"] > div + div { display: none; }

    #area #text { height: auto !important; padding: 6px 10px; }
    #area #text div { position: static !important; width: auto !important; height: auto !important; line-height: 1.4; text-align: center !important; font-size: 16px; }

    #area .navyy { padding: 0 6px; }
    #area .navyy li { display: inline-block; margin: 2px 0; }
    #area .navyy a { font-size: 18px; padding: 10px 12px; }

    #area #content > table, #area #content > table > tbody, #area #content > table > tbody > tr,
    #area #content > table > tbody > tr > td { display: block; width: auto !important; height: auto !important; }
    #area #content > table > tbody > tr > td { background-image: none !important; }
    #area #content > table > tbody > tr > td[width="203"] > div {
        display: flex; flex-wrap: wrap; justify-content: center; padding-top: 10px !important; background-image: none !important;
    }
    #area #content #menu { width: 50%; min-width: 175px; text-align: center; }
    #area #content #menu img { margin: 4px auto; display: block; }
    #area #content div#field { width: 171px; margin: 10px auto !important; }
    #area #content > table > tbody > tr > td[valign="bottom"] { text-align: center; }
    #area #content img[src*="content_left_bottom"] { display: none; }
    #area #content > table > tbody > tr > td[width="203"]:empty { display: none; }

    #area #main { width: auto !important; margin: 10px !important; overflow-wrap: break-word; }
    #area #content #main img { margin: 6px auto; max-width: calc(100% - 12px); }
    #area #content #main img[align="right"], #area #content #main img[align="left"] { float: none; display: block; }
    #area #main table { max-width: 100%; }
    #area #main table[width], #area #main table[style*="width"] { width: auto !important; }
    #area #main #pricetable { width: 100% !important; height: auto !important; background-size: cover; }

    #area div#form { margin: 0; }
    #area #form table, #area #form tbody, #area #form tr, #area #form td { display: block; width: auto !important; height: auto; }
    #area #form td { padding: 2px 0; }
    #area #form input, #area #form select, #area #form textarea { width: 100% !important; }
    #area #form input[type="submit"], #area #form input[type="checkbox"], #area #form input[type="radio"] { width: auto !important; }

    #area div#copyright { width: auto; }
    #area #copyright div { width: auto; float: none; padding: 4px 0; }

    /* ---------- B: #contmain article layout ---------- */
    #contmain, #contmain #left1, #contmain #right1, #contmain #main, #contmain #header, #contmain #logo,
    #contmain #menu, #contmain #page, #contmain #content, #contmain #content .box, #contmain #sidebar2, #contmain #footer {
        width: auto !important; float: none;
    }
    #contmain #main { border: 0; }
    #contmain #header { height: auto; }
    #contmain #logo { height: 0; padding-top: 21%; background-size: 100% auto; position: relative; }
    #contmain #logo h2 { position: absolute; top: 2px; left: 0; right: 0; padding: 0 6px; font-size: 8px; line-height: 1.2; }
    #contmain #menu { height: auto; display: flex; flex-wrap: wrap; padding: 0; }
    #contmain #menu ul { display: flex; flex-wrap: wrap; width: 100%; }
    #contmain #menu li { float: none; flex: 1 1 auto; }
    #contmain #menu a { float: none; width: auto; height: auto; padding: 12px 10px; font-size: 1.2em; }
    #contmain #content { padding: 10px; }
    #contmain #content .box { padding: 0; }
    #contmain #content img { max-width: 100%; height: auto; }
    #contmain #content img[align] { float: none; display: block; margin: 6px auto; }
    #contmain #sidebar2 { padding: 10px; text-align: center; }
    #contmain #sidebar2 ul { text-align: left; }
    #contmain #sidebar2 li li { padding: 8px 5px; }
    #contmain #footer { height: auto; padding: 10px; }
    #contmain table { max-width: 100%; }

    /* ---------- C: PHP shop (index.php) ---------- */
    #gz-wrap { background-image: none; }
    #gz-wrap #container { width: auto; display: flex; flex-direction: column; padding-bottom: 20px; }
    #gz-wrap #header { order: 0; }
    #gz-wrap #content { order: 1; margin: 0 0 10px; overflow-wrap: break-word; }
    #gz-wrap #column_right { order: 2; }
    #gz-wrap #column_left { order: 3; }
    #gz-wrap #footer { order: 4; }
    #gz-wrap #column_left, #gz-wrap #column_right { float: none; width: auto; margin: 0 10px 10px; }

    #gz-wrap #header .div1 { height: auto; }
    #gz-wrap #header .div2 img { display: block; width: 100%; height: auto; }
    #gz-wrap #header .div3 { position: static; height: auto; padding: 6px 10px; text-align: center; border: 0; }
    #gz-wrap #header .div3 a { display: inline-block; margin: 4px 8px; padding: 6px 0 6px 20px; font-size: 14px; }
    #gz-wrap #search { position: static; text-align: center; padding: 4px 10px 10px; }
    #gz-wrap #search input { width: 70%; }
    #gz-wrap #search .button { float: none; display: inline-block; vertical-align: middle; }
    #gz-wrap #header .div4 { height: auto; padding-top: 0; background-size: cover; }
    #gz-wrap #main-nav { display: flex; flex-wrap: wrap; justify-content: center; }
    #gz-wrap #header .div4 #main-nav a { float: none; height: auto; line-height: 44px; font-size: 18px; }

    /* product grid (home + categories + search): photo left, name / price / cart right */
    #gz-wrap table.list, #gz-wrap table.list > tbody, #gz-wrap table.list > tbody > tr { display: block; width: auto !important; }
    #gz-wrap table.list > tbody > tr > td {
        display: grid !important; grid-template-columns: 110px 1fr; column-gap: 14px; align-items: center;
        width: auto !important; padding: 12px 10px !important; border-bottom: 1px solid #eee; text-align: left; box-sizing: border-box;
    }
    #gz-wrap table.list > tbody > tr > td > a:first-child { grid-column: 1; grid-row: 1 / span 2; display: block; }
    #gz-wrap table.list > tbody > tr > td > a:first-child table { margin: 0; }
    #gz-wrap table.list > tbody > tr > td > a:first-child td { width: 110px !important; height: 110px !important; display: table-cell !important; }
    #gz-wrap table.list > tbody > tr > td > a:first-child img { max-width: 108px; max-height: 108px; }
    #gz-wrap table.list > tbody > tr > td > div { grid-column: 2; padding-top: 0 !important; }
    #gz-wrap table.list > tbody > tr > td > div:nth-of-type(1) { align-self: end; font-size: 15px; line-height: 1.3; }
    #gz-wrap table.list > tbody > tr > td > div:nth-of-type(2) { align-self: start; padding-top: 6px !important; font-size: 15px; }
    #gz-wrap table.list > tbody > tr > td.m-empty { display: none !important; }
    #gz-wrap table.list a.button_add_small {
        display: inline-block; width: 40px; height: 32px; padding: 0; margin: 0 0 0 10px; vertical-align: middle;
        background-position: center; background-size: 22px 22px; border: 1px solid #e5e5e5; border-radius: 6px;
    }

    /* single product page: photo, then name/price, then quantity + button */
    #gz-wrap #content table[style*="border-collapse"], #gz-wrap #content table[style*="border-collapse"] > tbody,
    #gz-wrap #content table[style*="border-collapse"] > tbody > tr,
    #gz-wrap #content table[style*="border-collapse"] > tbody > tr > td { display: block; width: auto !important; }
    #gz-wrap #content table[style*="border-collapse"] > tbody > tr > td { padding: 0 0 10px !important; text-align: left; }
    #gz-wrap #content table[style*="border-collapse"] > tbody > tr > td[rowspan] > table { margin: 0 auto; }
    #gz-wrap #content table[style*="border-collapse"] .content { padding: 10px; }

    #gz-wrap table.cart { width: 100%; }
    #gz-wrap .box .middle input[type="text"], #gz-wrap .box .middle input[type="password"] { width: 100% !important; }
    #gz-wrap #content input[type="text"], #gz-wrap #content input[type="password"],
    #gz-wrap #content textarea, #gz-wrap #content select { width: 100% !important; }
    #gz-wrap .fb-page, #gz-wrap .fb-page iframe { max-width: 100% !important; }

    /* ---------- ONE hamburger menu on every page: shop, old .html pages, /articles/ blog (built by /js/mobile.js) ---------- */
    .m-bar {
        position: sticky !important; top: 0; z-index: 10000; box-sizing: border-box;
        display: flex !important; align-items: center; justify-content: space-between;
        width: 100%; height: 52px; margin: 0 !important; padding: 0 6px !important;
        background: #66a533; box-shadow: 0 2px 6px rgba(0,0,0,.25); text-align: left;
        font-family: Arial, Helvetica, sans-serif; line-height: normal;
    }
    #gz-wrap .m-bar { order: -1; }
    .m-bar .m-burger, .m-bar .m-cart {
        display: inline-flex !important; align-items: center; gap: 10px; height: 44px; padding: 0 12px !important; margin: 0 !important;
        background: transparent !important; border: 0 !important; color: #fff !important; cursor: pointer; text-decoration: none !important;
        font: normal 19px 'MyriadProBoldCondensed', Arial, Helvetica, sans-serif !important; text-transform: uppercase; letter-spacing: .3px;
    }
    .m-bar .m-cart { font-size: 16px !important; gap: 6px; }
    .m-bar .m-cart svg { flex: none; }
    .m-burger-icon { display: inline-block; width: 24px; }
    .m-burger-icon i { display: block; height: 3px; margin: 4px 0; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
    .m-bar.open .m-burger-icon i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .m-bar.open .m-burger-icon i:nth-child(2) { opacity: 0; }
    .m-bar.open .m-burger-icon i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .m-drawer {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        max-height: calc(100vh - 52px); overflow-y: auto; -webkit-overflow-scrolling: touch;
        background: #fff; box-shadow: 0 10px 18px rgba(0,0,0,.3); text-align: left;
    }
    .m-bar.open .m-drawer { display: block; }
    .m-drawer .m-sec-title {
        padding: 9px 16px; background: #f6f3c4; color: #5b4a08; border-top: 1px solid #e8e2a0;
        font: normal 16px 'MyriadProBoldCondensed', Arial, Helvetica, sans-serif; text-transform: uppercase; letter-spacing: .3px;
    }
    .m-drawer ul { list-style: none !important; margin: 0 !important; padding: 0 !important; }
    .m-drawer li { list-style: none !important; margin: 0 !important; padding: 0 !important; border-top: 1px solid #eee; background: none !important; }
    .m-drawer li:first-child { border-top: 0; }
    .m-drawer a {
        display: block; padding: 13px 18px !important; margin: 0 !important; border: 0 !important;
        font: normal 16px/1.3 Arial, Helvetica, sans-serif !important; color: #242026 !important; text-decoration: none !important; text-transform: none !important;
        background: none !important;
    }
    .m-drawer a:active, .m-drawer a:hover { background: #fbf8d8 !important; }
    .m-drawer .m-sub { border-top: 1px solid #eee; }
    .m-drawer .m-sub a { padding-left: 36px !important; font-size: 15px !important; color: #555 !important; }
    .m-drawer .m-sec-shop > ul > li > a { font-weight: bold !important; }
    .m-drawer .m-sec-phones a { color: #66a533 !important; font-weight: bold !important; }

    /* main menu: hidden from the page header on phones (it lives in the hamburger and the footer) */
    #gz-wrap #header .div4 { display: none !important; }
    #gz-wrap #column_left.m-moved { display: none; }
    #area .navyy, #area #content #menu, #area .m-empty-col { display: none !important; }
    #contmain #menu { display: none !important; }
    .m-kind-blog .nav-secondary, .m-kind-blog .nav-primary, .m-kind-blog .responsive-menu-icon { display: none !important; }
    /* blog header: logo at its real proportions instead of a 200px-tall box */
    .m-kind-blog .site-header { padding: 10px 0 !important; }
    .m-kind-blog .site-header .title-area { padding: 0 10px !important; }
    .m-kind-blog .site-title { margin: 0 !important; }
    .m-kind-blog .site-title a { min-height: 0 !important; height: 0 !important; padding-top: 21% !important; background-size: 100% auto !important; background-position: center !important; }
    .m-kind-blog .entry-content img.m-wide { margin: 10px 0 14px !important; }

    /* footer: the main menu as links */
    .m-footnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; padding: 12px 10px 8px; text-align: center; }
    .m-footnav a { display: inline-block; padding: 8px 2px; font: normal 15px Arial, Helvetica, sans-serif !important; color: #5b4a08 !important; text-decoration: underline !important; }
    #contmain #footer .m-footnav a, .m-kind-blog .site-footer .m-footnav a { color: inherit !important; }

    /* Акции / Избранное / Контакты / Карта сайта: in the shop footer */
    #gz-wrap #footer .m-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding: 6px 10px 6px; }
    #gz-wrap #footer .m-footer-links a { padding: 8px 0 8px 22px; font-size: 14px; background-repeat: no-repeat; background-position: left center; }

    /* Личный кабинет and other sidebar lists in the shop: clean rows instead of the stretched button image */
    #gz-wrap .box ul li { background: none !important; margin: 0; padding: 0; text-align: left; font-size: inherit; border-top: 1px solid #eee; }
    #gz-wrap .box ul li:first-child { border-top: 0; }
    #gz-wrap .box ul li a { display: block; padding: 13px 18px; font-size: 16px; color: #242026; text-decoration: none; }
    #gz-wrap .box ul li a:hover { padding-top: 13px; }

    /* Личный кабинет login form: bigger, easy-to-tap button and links */
    #gz-wrap #login_form table { width: 100%; }
    #gz-wrap #login_form td { padding: 4px 2px; font-size: 15px; }
    #gz-wrap #login_form input[type="text"], #gz-wrap #login_form input[type="password"] { height: 40px; padding: 6px 10px; }
    #gz-wrap .box .button, #gz-wrap #content .button {
        display: inline-block; padding: 0 !important; margin: 6px 0; background: #66a533 !important; border-radius: 8px; cursor: pointer;
        box-shadow: 0 2px 0 #4d8226;
    }
    #gz-wrap .box .button span, #gz-wrap #content .button span {
        display: block; padding: 12px 34px !important; background: none !important; color: #fff !important; font-size: 17px; font-weight: bold;
    }
    #gz-wrap .box .middle.pad > div[style*="text-align:center"] a { display: inline-block; padding: 8px 6px; font-size: 15px; }
}

@media screen and (max-width: 359px) {
    #area #content #menu { width: 100%; }
}

@media screen and (max-width: 480px) {
    #area .navyy a { font-size: 16px; padding: 8px 9px; }
}
