/*
Theme Name: Filtr-Med
Description: Тема-каталог медицинских изделий для WordPress и WooCommerce.
Version: 3.2.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: filtr-med
*/

/* ОСНОВНЫЕ НАСТРОЙКИ */

:root {
    --c: #1a6fb0;
    --cd: #124f80;
    --ink: #1c2a36;
    --mut: #66788a;
    --line: #dde6ee;
    --bg: #f4f8fb;
    --r: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font: 16px/1.55 Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #fff;
}

a {
    color: var(--c);
    text-decoration: none;
}

a:hover {
    color: var(--cd);
}

img {
    max-width: 100%;
    height: auto;
}

/* ОБЩАЯ ШИРИНА */

.fm-wrap {
    width: calc(100% - 64px);
    max-width: 1600px;
    margin-inline: auto;
}

/* ШАПКА */

.fm-head {
    border-bottom: 1px solid var(--line);
}

.fm-head-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 14px 0;
}

.fm-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.fm-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-brand-image {
    display: block;
    width: 82px;
    height: 82px;
    object-fit: contain;
}

.fm-brand-name {
    display: flex;
    flex-direction: column;
    color: var(--ink);
}

.fm-brand-name strong {
    font-size: 26px;
    line-height: 1.2;
}

.fm-brand-name span {
    font-size: 13px;
    color: var(--mut);
}

.fm-logo-mark {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--c);
    color: #fff;
    font-weight: 800;
}

/* БЛАГОТВОРИТЕЛЬНОСТЬ */

.fm-charity {
    display: flex;
    align-items: center;
    gap: 12px;

    width: min(100%, 590px);
    max-width: 590px;
    min-height: 70px;

    margin-left: auto;
    padding: 12px 18px;

    border: 1px solid #efd3d3;
    border-radius: 12px;
    background: #fff7f7;

    cursor: pointer;
    text-align: left;

    transition: background .2s, border-color .2s, transform .2s;
}

.fm-charity:hover {
    background: #ffeded;
    border-color: #df9999;
    transform: translateY(-1px);
}

.fm-charity-heart {
    font-size: 30px;
    flex-shrink: 0;
}

.fm-charity-text {
    display: block;
    min-width: 0;
}

.fm-charity-text strong {
    display: block;
    font-size: 16px;
    line-height: 1.25;
    color: #963535;
}

.fm-charity-text small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.35;
    color: #705656;
}

/* МЕНЮ */

.fm-nav {
    background: var(--c);
}

.fm-nav .fm-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.fm-menu {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fm-menu a {
    display: block;
    padding: 14px 20px;
    color: #fff;
    font-weight: 700;
}

.fm-menu a:hover,
.fm-menu .current-menu-item > a {
    background: rgba(255,255,255,.16);
    color: #fff;
}

/* ПОИСК */

.fm-search {
    display: flex;
    margin-left: auto;
}

.fm-search input {
    border: 0;
    padding: 8px 12px;
    border-radius: 6px 0 0 6px;
    width: 200px;
    margin: 8px 0;
}

.fm-search button {
    border: 0;
    background: var(--cd);
    color: #fff;
    padding: 0 14px;
    border-radius: 0 6px 6px 0;
    margin: 8px 0;
    cursor: pointer;
}

/* РАЗДЕЛЫ */

.fm-sec {
    padding: 40px 0;
}

.fm-sec h1,
.fm-sec h2 {
    margin: 0 0 6px;
    font-size: clamp(26px, 3.4vw, 34px);
}

.fm-lead {
    color: var(--mut);
    margin: 0 0 24px;
}

/* ПЛИТКИ ПРОИЗВОДИТЕЛЕЙ */

.fm-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.fm-tile {
    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
    gap: 12px;

    padding: 28px 20px;

    border: 1px solid var(--line);
    border-radius: var(--r);

    background: #fff;
    color: var(--ink);

    transition: .18s;
}

.fm-tile:hover {
    border-color: var(--c);
    box-shadow: 0 8px 24px rgba(20,70,110,.12);
    transform: translateY(-2px);
    color: var(--ink);
}

.fm-tile-img {
    display: grid;
    place-items: center;
    width: 100%;
    height: 110px;
}

.fm-tile-img img {
    max-height: 110px;
    object-fit: contain;
}

.fm-tile-letter {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--c);

    display: grid;
    place-items: center;

    font-size: 38px;
    font-weight: 800;
}

.fm-tile strong {
    font-size: 20px;
}

.fm-tile small {
    color: var(--mut);
    font-size: 13px;
    line-height: 1.45;
}

.fm-tile em {
    font-style: normal;
    color: var(--c);
    font-weight: 700;
    font-size: 14px;
    margin-top: auto;
}

/* ГЛАВНАЯ */

.fm-home .fm-wrap {
    width: calc(100% - 64px);
    max-width: 1600px;
}

.fm-home .fm-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.fm-home .fm-tile {
    min-height: 330px;
    padding: 30px;
}

.fm-home .fm-tile-img {
    height: 150px;
}

.fm-home .fm-tile-img img {
    max-height: 150px;
    max-width: 90%;
    width: auto;
    object-fit: contain;
}

/* СТРАНИЦЫ */

.fm-page {
    padding: 30px 0 56px;
}

.fm-crumbs {
    font-size: 13px;
    color: var(--mut);
    margin-bottom: 14px;
}

.fm-page h1,
.woocommerce-products-header__title {
    font-size: clamp(26px, 3.4vw, 34px);
    margin: 0 0 18px;
}

.fm-article {
    width: 100%;
    max-width: 1400px;
    line-height: 1.75;
}

/* WOOCOMMERCE */

.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    list-style: none;
    padding: 0 !important;
    margin: 0 0 30px !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

.woocommerce ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 16px;

    border: 1px solid var(--line);
    border-radius: var(--r);
    text-align: center;
}

.woocommerce ul.products li.product-category a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

.woocommerce ul.products li.product-category h2 {
    font-size: 17px !important;
    padding: 0 !important;
    margin: 0;
}

.woocommerce ul.products li.product-category mark {
    background: none;
    color: var(--mut);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px;
    line-height: 1.35;
    padding: 8px 0;
}

.woocommerce ul.products li.product .price,
.woocommerce div.product p.price {
    display: none !important;
}

.fm-order {
    display: inline-block;
    color: #1f7a50;
    font-weight: 700;
    font-size: 14px;
}

/* КНОПКИ */

.button,
.fm-btn,
.wp-element-button {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    background: var(--c);
    color: #fff !important;
    padding: 11px 18px;
    font-weight: 700;
    cursor: pointer;
}

.button:hover,
.fm-btn:hover {
    background: var(--cd);
}

/* ФОРМЫ */

.fm-form {
    display: grid;
    gap: 12px;
    max-width: 640px;
}

.fm-form label {
    display: grid;
    gap: 5px;
    font-size: 14px;
    font-weight: 700;
}

.fm-form input:not([type=checkbox]),
.fm-form textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #c9d7e2;
    border-radius: 7px;
    font: inherit;
}

.fm-form .fm-consent {
    display: flex;
    gap: 8px;
    font-weight: 400;
    font-size: 12px;
}

.fm-ok {
    padding: 14px;
    border-radius: 8px;
    background: #ebf7f0;
    border: 1px solid #b6e0c7;
    margin-bottom: 14px;
}

.fm-err {
    padding: 14px;
    border-radius: 8px;
    background: #fff2f1;
    border: 1px solid #f0b8b3;
    margin-bottom: 14px;
}

/* ДОПОЛНИТЕЛЬНЫЕ БЛОКИ */

.fm-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin: 30px 0 10px;
    padding: 22px 24px;

    border-radius: var(--r);
    background: var(--bg);
    border: 1px solid var(--line);
}

.fm-cta span {
    color: var(--mut);
    font-size: 14px;
}

.term-description,
.woocommerce-products-header .term-description {
    max-width: 1400px;
    color: #3d4f5e;
    margin-bottom: 22px;
}

.woocommerce table.shop_attributes th {
    width: 34%;
}

/* БЛАГОТВОРИТЕЛЬНОЕ ОКНО */

.fm-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;

    background: rgba(0,0,0,.55);

    align-items: center;
    justify-content: center;

    padding: 20px;
}

.fm-modal.active {
    display: flex;
}

.fm-modal [hidden] {
    display: none !important;
}

.fm-modal-box {
    position: relative;

    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;

    background: #fff;
    border-radius: 16px;

    padding: 32px;
    text-align: center;

    box-shadow: 0 15px 50px rgba(0,0,0,.2);
}

.fm-modal-box h2 {
    margin-top: 0;
    font-size: 24px;
}

.fm-modal-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.fm-modal-actions button {
    padding: 12px 20px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.fm-charity-yes {
    background: var(--c);
    color: #fff;
}

.fm-charity-no {
    background: #edf1f4;
    color: #333;
}

.fm-modal-close {
    position: absolute;
    right: 15px;
    top: 10px;

    border: 0;
    background: transparent;

    font-size: 28px;
    cursor: pointer;
}

/* ПОДВАЛ */

.fm-foot {
    background: #14303f;
    color: #c5d5df;
    padding: 30px 0 18px;
    margin-top: 20px;
    font-size: 14px;
}

.fm-foot a {
    color: #fff;
}

.fm-foot-in {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.fm-foot-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fm-foot-contact strong {
    color: #fff;
}

.fm-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;

    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: 20px;
    padding-top: 14px;

    font-size: 12px;
    color: #97aebd;
}

/* ДОСТУПНОСТЬ */

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px,1px,1px,1px);
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ПЛАНШЕТЫ */

@media (max-width: 1000px) {

    .fm-home .fm-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fm-head-in {
        flex-wrap: wrap;
        gap: 20px;
    }

    .fm-charity {
        max-width: 100%;
    }

}

/* ТЕЛЕФОНЫ */

@media (max-width: 700px) {

    .fm-wrap,
    .fm-home .fm-wrap {
        width: calc(100% - 30px);
    }

    .fm-head-in {
        flex-direction: column;
        align-items: stretch;
    }

    .fm-brand {
        gap: 12px;
    }

    .fm-brand-image {
        width: 64px;
        height: 64px;
    }

    .fm-brand-name strong {
        font-size: 22px;
    }

    .fm-charity {
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .fm-home .fm-tiles {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .fm-home .fm-tile {
        min-height: auto;
        padding: 24px 18px;
    }

    .fm-menu a {
        padding: 12px 14px;
    }

    .fm-search {
        width: 100%;
        margin: 0 0 8px;
    }

    .fm-search input {
        flex: 1;
        width: auto;
    }

    .fm-modal-box {
        padding: 28px 18px;
    }

    .fm-modal-box h2 {
        font-size: 21px;
    }

}