/* Shared overrides, loaded after the original theme and page styles. */
#page {
    width: 100%;
    max-width: 1020px;
}

a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid #9c3e00;
    outline-offset: 3px;
}

#viewform {
    font-size: 0;
}

@media screen and (max-width: 1019px) {
    body {
        background: #fff;
        font-size: 14px;
    }

    body#index {
        min-height: 100vh;
        background-position: center 280px, left top !important;
        background-attachment: scroll !important;
        box-shadow: none;
    }

    #header {
        display: flex;
        flex-direction: column;
        align-items: center;
        height: auto;
        padding: 16px 0 0;
        background: #e31e25;
    }

    #header_logo {
        position: static;
        order: 2;
        width: 218px;
        height: auto;
        margin: 12px auto 0;
    }

    #header_logo img {
        display: block;
        width: 100%;
        height: auto;
    }

    #header_logo span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
    }

    .header_left {
        float: none;
        padding: 0 12px;
        text-align: center;
    }

    .phone {
        font-size: clamp(16px, 3vw, 21px);
    }

    #header .sf-contener {
        display: flex;
        flex-wrap: wrap;
        order: 3;
        width: 100%;
        height: auto;
        margin: 12px 0 0;
        background: linear-gradient(#ffe46a, #ffb600);
    }

    #header .sf-contener ul {
        position: static;
        display: flex;
        flex: 1 1 280px;
        width: auto;
        height: auto;
        overflow: visible;
    }

    #header .sf-contener ul li {
        flex: 1;
        height: auto;
        padding: 0;
    }

    #header .sf-contener li a {
        display: block;
        height: auto;
        min-height: 48px;
        padding: 0 8px;
        font-size: 16px;
        line-height: 48px;
    }

    #columns {
        min-height: 0;
        padding: 0 20px;
    }

    #center_column, #center_column.no_left {
        float: none;
        width: auto;
        min-width: 0;
        margin: 24px 0;
        overflow-wrap: anywhere;
    }

    #center_column .breadcrumb {
        margin: 0 0 12px;
        padding-left: 0;
        line-height: 1.7;
    }

    #page #center_column h1 {
        margin-left: 0 !important;
        padding-left: 0 !important;
        font-size: clamp(24px, 4vw, 34px) !important;
        line-height: 1.3 !important;
    }

    #center_column h2 {
        padding-left: 0;
        font-size: 24px;
        line-height: 1.4;
    }

    #center_column img {
        box-sizing: border-box;
        max-width: 100%;
        height: auto;
    }

    #center_column .rte p {
        text-indent: 0;
    }

    #left_column, #right_column {
        float: none;
        width: auto;
        margin: 0 0 24px;
    }

    #left_column div.block {
        width: auto;
        margin-bottom: 12px;
    }

    #categories_block_left .tree {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    #categories_block_left .tree li {
        flex: 1 1 150px;
        padding: 0;
    }

    #categories_block_left .tree a,
    #categories_block_left ul.tree a.selected {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 44px;
        height: auto;
        margin: 0;
        padding: 10px;
        border: 1px solid #eadbd9;
        line-height: 1.5;
        text-align: center;
        text-decoration: none;
    }

    a.pricepdf {
        width: auto;
        max-width: 360px;
        margin: 0;
        font-size: 18px;
    }

    a.pricepdf br {
        display: none;
    }

    ul#product_list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 28px 20px;
    }

    ul#product_list:after {
        content: none;
    }

    ul#product_list li, ul#product_list li:nth-child(3n) {
        float: none;
        width: auto;
        height: auto;
        padding: 0;
        overflow: visible;
    }

    ul#product_list li a {
        display: block;
        min-height: 0;
    }

    .description_short p {
        margin-right: 0 !important;
    }

    #primary_block {
        display: grid;
        grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
        gap: 0 24px;
    }

    #primary_block > h1, #primary_block > #left_column {
        grid-column: 1 / -1;
    }

    #primary_block #pb-right-column, #primary_block #pb-left-column {
        float: none;
        width: auto;
        min-width: 0;
        margin-top: 0;
    }

    #primary_block #image-block, #primary_block ul#usefull_link_block {
        width: 100%;
        max-width: 300px;
        height: auto;
        margin-right: auto;
        margin-left: auto;
    }

    #primary_block #image-block img#bigpic {
        display: block;
        width: 100%;
        height: auto;
    }

    #primary_block .features {
        min-height: 0;
    }

    #minic_slider {
        display: grid;
        width: 100%;
        height: auto;
        margin-top: 32px;
    }

    #minic_slider .nivoSlider {
        position: relative;
        grid-area: 1 / 1;
        min-height: 360px;
        padding: 32px 48px;
    }

    #minic_slider .slider_image {
        width: auto;
        max-width: 26%;
        max-height: 260px;
        margin: 0 0 16px 20px;
    }

    #minic_slider h1, #minic_slider p {
        width: auto !important;
    }

    #minic_slider h1 {
        font-size: 32px !important;
    }

    #minic_slider a.arrow_left, #minic_slider a.arrow_right {
        top: 50%;
        width: 40px;
        height: 48px;
        padding: 0;
        transform: translateY(-50%);
        background-position: center;
    }

    #minic_slider a.arrow_left,
    #minic_slider a.arrow_left:hover,
    #minic_slider a.arrow_left:active {
        left: 0;
        padding: 0;
    }

    #minic_slider a.arrow_right,
    #minic_slider a.arrow_right:hover,
    #minic_slider a.arrow_right:active {
        right: 0;
        padding: 0;
    }

    .granto_video {
        padding-top: 32px;
    }

    .granto_video iframe {
        width: 100% !important;
        max-width: 640px;
        height: auto !important;
        aspect-ratio: 16 / 9;
    }

    #footer {
        padding: 24px 20px 80px;
    }

    #index #footer {
        padding-bottom: 80px;
    }

    /* Override coordinates set by the legacy callback script. */
    #callme {
        top: auto;
        right: 12px;
        bottom: 12px;
        width: auto;
        height: auto;
    }

    #viewform {
        width: auto;
        min-height: 44px;
        height: auto;
        padding: 10px 16px;
        border-radius: 6px;
        background: #087d06;
        color: #fff;
        font-size: 16px;
        box-shadow: 0 2px 8px #0003;
    }

    #cme_form {
        box-sizing: border-box;
        position: fixed !important;
        top: 12px !important;
        left: 50% !important;
        right: auto;
        width: calc(100% - 24px);
        max-width: 360px;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 12px;
        overflow: auto;
        transform: translateX(-50%);
        z-index: 111;
    }

    #cme_form .cme_txt {
        box-sizing: border-box;
        width: 100% !important;
        min-height: 44px;
        font-size: 16px;
    }

    #cme_form .cme_btn {
        min-height: 44px;
    }

    #cme_form h6 {
        padding: 8px 44px 12px 0;
        font-size: 16px;
    }

    #cme_cls {
        box-sizing: border-box;
        width: 44px;
        height: 44px;
        margin: 0;
        background-position: center;
        background-repeat: no-repeat;
    }

    #cme_back {
        position: fixed;
        height: 100% !important;
    }
}

@media screen and (max-width: 600px) {
    #columns {
        padding: 0 16px;
    }

    ul#product_list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 12px;
    }

    ul#product_list .product_name {
        font-size: 13px;
        line-height: 1.5;
    }

    #primary_block {
        grid-template-columns: minmax(0, 1fr);
    }

    #primary_block #pb-left-column {
        margin-top: 16px;
    }

    #center_column .rte img {
        display: block;
        float: none !important;
        margin: 12px auto !important;
    }

    #center_column .rte p {
        text-align: left;
    }

    #center_column .rte table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    dl.gallery-item {
        width: 50%;
    }

    .block-cms li a {
        display: inline-block;
        padding: 10px 0;
    }

    #minic_slider .nivoSlider {
        min-height: 480px;
        padding: 24px 40px;
    }

    #minic_slider .slider_image {
        float: none;
        width: auto;
        max-width: 100%;
        height: 140px;
        margin: 0 auto 20px;
    }

    #minic_slider h1 {
        font-size: 24px !important;
    }

    #minic_slider h2 {
        font-size: 18px;
    }

    #minic_slider p {
        font-size: 18px !important;
        line-height: 1.5;
    }

    body#contact-form #center_column form.std fieldset {
        min-width: 0;
        margin-top: 16px;
    }

    body#contact-form #center_column form.std label {
        display: block;
        float: none;
        width: auto;
        margin-bottom: 6px;
        text-align: left;
    }

    body#contact-form #center_column form.std input[type="text"],
    body#contact-form #center_column form.std input[type="tel"],
    body#contact-form #center_column form.std input[type="email"],
    body#contact-form #center_column form.std textarea#message {
        box-sizing: border-box;
        width: 100% !important;
        min-height: 44px;
        margin: 0;
        padding: 10px;
        font-size: 16px;
    }

    body#contact-form #center_column form.std p.submit {
        padding: 0 1em !important;
    }

    body#contact-form #submitMessage {
        width: 100%;
        min-height: 44px;
        margin: 0;
    }
}

@media screen and (max-width: 380px) {
    .g-recaptcha {
        zoom: 0.85;
    }
}
