/*
Theme Name: Десертология Маркет
Theme URI: https://десертология.рф/
Author: OpenAI для «Десертологии»
Description: Самостоятельная тема WooCommerce для магазина товаров кондитерам. Вдохновлена структурой крупного отраслевого интернет-магазина, но написана с нуля: многоуровневый каталог, поиск, фильтры, автоматические подборки, адаптивная витрина и карточки товаров.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: desertology-market
Tags: e-commerce, custom-logo, custom-menu, featured-images, responsive-layout, accessibility-ready
*/

:root {
    --dm-bg: #f6f7f9;
    --dm-surface: #ffffff;
    --dm-surface-alt: #f0f4f2;
    --dm-text: #20272b;
    --dm-muted: #6e787d;
    --dm-line: #e1e6e8;
    --dm-accent: #158365;
    --dm-accent-dark: #0d6650;
    --dm-accent-soft: #e1f3ed;
    --dm-warm: #fff3df;
    --dm-danger: #bd3a45;
    --dm-radius: 14px;
    --dm-radius-lg: 22px;
    --dm-shadow: 0 14px 40px rgba(26, 43, 49, .08);
    --dm-shadow-sm: 0 6px 22px rgba(26, 43, 49, .06);
    --dm-container: 1480px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--dm-bg);
    color: var(--dm-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:hover { color: var(--dm-accent-dark); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.dm-container { width: min(calc(100% - 40px), var(--dm-container)); margin-inline: auto; }
.dm-hidden { display: none !important; }
.screen-reader-text {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Top strip */
.dm-topbar { background: #273239; color: #f4f6f7; font-size: 13px; }
.dm-topbar__inner { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dm-topbar__group { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.dm-topbar a { color: #fff; text-decoration: none; }
.dm-topbar svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px; }

/* Header */
.dm-header { position: relative; z-index: 80; background: var(--dm-surface); box-shadow: 0 1px 0 var(--dm-line); }
.dm-header__main {
    min-height: 94px; display: grid; grid-template-columns: minmax(190px, 310px) minmax(330px, 1fr) auto;
    align-items: center; gap: 28px;
}
.dm-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: var(--dm-text); text-decoration: none; }
.dm-brand .custom-logo { display: block; max-width: 260px; max-height: 70px; width: auto; }
.dm-brand__fallback { display: flex; flex-direction: column; line-height: 1; }
.dm-brand__name { font-size: clamp(24px, 2.2vw, 34px); font-weight: 850; letter-spacing: -.045em; }
.dm-brand__tagline { margin-top: 7px; color: var(--dm-muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.dm-search { min-width: 0; }
.dm-search .woocommerce-product-search, .dm-search .search-form { position: relative; display: flex; }
.dm-search .search-field {
    width: 100%; height: 52px; padding: 0 122px 0 19px; border: 2px solid var(--dm-accent);
    border-radius: 10px; background: #fff; color: var(--dm-text); outline: none;
}
.dm-search .search-field:focus { box-shadow: 0 0 0 4px rgba(21, 131, 101, .12); }
.dm-search button {
    position: absolute; top: 5px; right: 5px; height: 42px; min-width: 104px; padding: 0 18px;
    border: 0; border-radius: 7px; background: var(--dm-accent); color: #fff; font-weight: 750;
}
.dm-search button:hover { background: var(--dm-accent-dark); }
.dm-header__actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.dm-action {
    display: inline-flex; min-height: 48px; align-items: center; gap: 9px; padding: 9px 12px;
    border: 1px solid var(--dm-line); border-radius: 10px; background: #fff; color: var(--dm-text); text-decoration: none;
}
.dm-action:hover { border-color: var(--dm-accent); color: var(--dm-accent-dark); }
.dm-action svg { width: 22px; height: 22px; flex: 0 0 auto; }
.dm-action__text { display: flex; flex-direction: column; line-height: 1.15; }
.dm-action__label { color: var(--dm-muted); font-size: 11px; }
.dm-action__value { font-size: 13px; font-weight: 750; }
.dm-cart-count {
    display: inline-grid; min-width: 23px; height: 23px; padding: 0 6px; place-items: center;
    border-radius: 99px; background: var(--dm-accent); color: #fff; font-size: 11px; font-weight: 800;
}

/* Navigation and mega catalog */
.dm-navbar { border-top: 1px solid var(--dm-line); border-bottom: 1px solid var(--dm-line); background: #fff; }
.dm-navbar__inner { min-height: 58px; display: flex; align-items: stretch; gap: 25px; }
.dm-catalog { position: relative; display: flex; align-items: stretch; flex: 0 0 265px; }
.dm-catalog__button {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px;
    border: 0; background: var(--dm-accent); color: #fff; font-weight: 800;
}
.dm-catalog__button:hover, .dm-catalog__button[aria-expanded="true"] { background: var(--dm-accent-dark); }
.dm-catalog__button svg { width: 22px; height: 22px; }
.dm-catalog__button .dm-chevron { width: 15px; height: 15px; transition: transform .18s ease; }
.dm-catalog__button[aria-expanded="true"] .dm-chevron { transform: rotate(180deg); }
.dm-mega {
    position: absolute; z-index: 90; top: calc(100% + 1px); left: 0; width: min(1120px, calc(100vw - 40px));
    max-height: min(680px, calc(100vh - 160px)); overflow: auto; padding: 22px; border: 1px solid var(--dm-line);
    border-radius: 0 0 var(--dm-radius-lg) var(--dm-radius-lg); background: #fff; box-shadow: var(--dm-shadow);
    visibility: hidden; opacity: 0; transform: translateY(-7px); pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.dm-mega.is-open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
.dm-mega__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 25px 30px; }
.dm-mega__group { min-width: 0; }
.dm-mega__root {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--dm-text);
    font-size: 15px; font-weight: 850; text-decoration: none;
}
.dm-mega__root::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--dm-accent); }
.dm-mega__children { margin: 0; padding: 0; list-style: none; }
.dm-mega__children li { margin: 6px 0; }
.dm-mega__children a { color: #536067; font-size: 13px; text-decoration: none; }
.dm-mega__children a:hover { color: var(--dm-accent-dark); text-decoration: underline; }
.dm-mega__more { display: inline-block; margin-top: 8px; color: var(--dm-accent-dark); font-size: 12px; font-weight: 800; }
.dm-primary-nav { flex: 1; display: flex; align-items: stretch; }
.dm-primary-nav > div { width: 100%; }
.dm-primary-nav ul { height: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; margin: 0; padding: 0; list-style: none; }
.dm-primary-nav a { color: var(--dm-text); font-size: 14px; font-weight: 700; text-decoration: none; }
.dm-primary-nav a:hover, .dm-primary-nav .current-menu-item > a { color: var(--dm-accent-dark); }
.dm-mobile-menu-button { display: none; align-items: center; gap: 8px; padding: 0 14px; border: 0; background: transparent; font-weight: 800; }

/* Home */
.dm-home-main { padding-bottom: 72px; }
.dm-hero { padding: 28px 0 34px; }
.dm-hero__box {
    position: relative; overflow: hidden; min-height: 410px; display: grid; grid-template-columns: 1.1fr .9fr;
    align-items: center; gap: 35px; padding: clamp(34px, 5vw, 72px); border-radius: 26px;
    background: linear-gradient(125deg, #dff4ed 0%, #f4f9f7 47%, #fff2dc 100%); box-shadow: var(--dm-shadow-sm);
}
.dm-hero__box::before, .dm-hero__box::after { content: ""; position: absolute; border-radius: 50%; }
.dm-hero__box::before { width: 330px; height: 330px; right: -95px; top: -120px; background: rgba(21,131,101,.12); }
.dm-hero__box::after { width: 190px; height: 190px; right: 28%; bottom: -105px; background: rgba(255,186,78,.18); }
.dm-hero__content { position: relative; z-index: 2; }
.dm-eyebrow { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: #fff; color: var(--dm-accent-dark); font-size: 12px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.dm-hero h1 { max-width: 820px; margin: 17px 0 18px; font-size: clamp(40px, 5.7vw, 78px); line-height: .98; letter-spacing: -.055em; }
.dm-hero__text { max-width: 690px; margin: 0 0 27px; color: #506067; font-size: clamp(16px, 1.7vw, 21px); }
.dm-button {
    display: inline-flex; min-height: 49px; align-items: center; justify-content: center; gap: 9px; padding: 11px 22px;
    border: 0; border-radius: 10px; background: var(--dm-accent); color: #fff; font-weight: 800; text-decoration: none;
}
.dm-button:hover { background: var(--dm-accent-dark); color: #fff; }
.dm-button--light { border: 1px solid var(--dm-line); background: #fff; color: var(--dm-text); }
.dm-button--light:hover { border-color: var(--dm-accent); background: #fff; color: var(--dm-accent-dark); }
.dm-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dm-hero__visual { position: relative; z-index: 2; min-height: 285px; display: grid; place-items: center; }
.dm-hero__visual-card {
    position: absolute; width: 220px; min-height: 245px; padding: 24px; border: 1px solid rgba(255,255,255,.75);
    border-radius: 25px; background: rgba(255,255,255,.82); box-shadow: 0 24px 50px rgba(43, 74, 66, .14); backdrop-filter: blur(8px);
}
.dm-hero__visual-card:nth-child(1) { transform: translate(-80px, 14px) rotate(-8deg); }
.dm-hero__visual-card:nth-child(2) { transform: translate(70px, -12px) rotate(7deg); }
.dm-hero__visual-icon { display: grid; width: 68px; height: 68px; place-items: center; margin-bottom: 55px; border-radius: 20px; background: var(--dm-accent-soft); color: var(--dm-accent-dark); }
.dm-hero__visual-icon svg { width: 34px; height: 34px; }
.dm-hero__visual-title { font-size: 22px; font-weight: 900; line-height: 1.05; }
.dm-hero__visual-sub { margin-top: 7px; color: var(--dm-muted); font-size: 13px; }
.dm-home-section { padding: 33px 0; }
.dm-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dm-section-head h2 { margin: 0; font-size: clamp(28px, 3.4vw, 46px); line-height: 1.05; letter-spacing: -.035em; }
.dm-section-head p { max-width: 650px; margin: 8px 0 0; color: var(--dm-muted); }
.dm-section-link { color: var(--dm-accent-dark); font-size: 14px; font-weight: 800; white-space: nowrap; }
.dm-category-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.dm-category-card {
    position: relative; min-height: 180px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
    padding: 17px; border: 1px solid var(--dm-line); border-radius: var(--dm-radius-lg); background: #fff; box-shadow: var(--dm-shadow-sm); text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dm-category-card:hover { transform: translateY(-4px); border-color: rgba(21,131,101,.35); box-shadow: var(--dm-shadow); }
.dm-category-card__image { position: absolute; inset: 0 0 58px; }
.dm-category-card__image img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.dm-category-card__placeholder {
    position: absolute; inset: 0 0 58px; display: grid; place-items: center;
    background: linear-gradient(145deg, var(--dm-accent-soft), #fff6e7); color: rgba(21,131,101,.75); font-size: 52px; font-weight: 900;
}
.dm-category-card__footer { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dm-category-card__name { color: var(--dm-text); font-size: 14px; font-weight: 850; line-height: 1.2; }
.dm-category-card__count { color: var(--dm-muted); font-size: 11px; white-space: nowrap; }
.dm-benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dm-benefit { display: flex; gap: 14px; padding: 22px; border: 1px solid var(--dm-line); border-radius: var(--dm-radius); background: #fff; }
.dm-benefit__icon { flex: 0 0 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: var(--dm-accent-soft); color: var(--dm-accent-dark); }
.dm-benefit__icon svg { width: 25px; height: 25px; }
.dm-benefit h3 { margin: 0 0 4px; font-size: 15px; }
.dm-benefit p { margin: 0; color: var(--dm-muted); font-size: 13px; }
.dm-about { display: grid; grid-template-columns: 1.15fr .85fr; gap: 25px; padding: clamp(30px, 5vw, 65px); border-radius: 25px; background: #273239; color: #fff; }
.dm-about h2 { margin: 0 0 15px; font-size: clamp(30px, 4vw, 52px); letter-spacing: -.04em; }
.dm-about p { color: rgba(255,255,255,.78); }
.dm-about__facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dm-fact { padding: 20px; border-radius: 16px; background: rgba(255,255,255,.08); }
.dm-fact strong { display: block; margin-bottom: 4px; font-size: 23px; }
.dm-fact span { color: rgba(255,255,255,.7); font-size: 12px; }

/* General content */
.dm-site-main { min-height: 55vh; padding: 34px 0 72px; }
.dm-content-card { padding: clamp(24px, 4vw, 55px); border: 1px solid var(--dm-line); border-radius: var(--dm-radius-lg); background: #fff; box-shadow: var(--dm-shadow-sm); }
.entry-title, .woocommerce-products-header__title.page-title { margin: 0 0 24px; font-size: clamp(34px, 4.6vw, 62px); line-height: 1.03; letter-spacing: -.045em; }
.entry-content > * { max-width: 860px; }
.entry-content > .alignwide { max-width: 1240px; }
.entry-content > .alignfull { max-width: none; }
.woocommerce-breadcrumb { margin: 0 0 20px !important; color: var(--dm-muted); font-size: 13px; }

/* Shop layout */
.dm-shop-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 25px; align-items: start; }
.dm-shop-sidebar { position: sticky; top: 20px; display: grid; gap: 16px; }
.admin-bar .dm-shop-sidebar { top: 52px; }
.dm-sidebar-card { padding: 18px; border: 1px solid var(--dm-line); border-radius: var(--dm-radius); background: #fff; box-shadow: var(--dm-shadow-sm); }
.dm-sidebar-title { margin: 0 0 13px; font-size: 16px; }
.dm-category-tree, .dm-category-tree ul { margin: 0; padding: 0; list-style: none; }
.dm-category-tree ul { margin: 5px 0 3px 13px; padding-left: 13px; border-left: 1px solid var(--dm-line); }
.dm-category-tree li { margin: 5px 0; }
.dm-category-tree a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; color: #4c595f; font-size: 13px; text-decoration: none; }
.dm-category-tree a:hover, .dm-category-tree .is-current > a { color: var(--dm-accent-dark); font-weight: 800; }
.dm-category-tree__count { color: #9aa2a6; font-size: 10px; }
.dm-filter-form { display: grid; gap: 11px; }
.dm-filter-form label { display: grid; gap: 5px; color: var(--dm-muted); font-size: 12px; font-weight: 700; }
.dm-filter-form select, .dm-filter-form input {
    width: 100%; height: 41px; padding: 0 10px; border: 1px solid var(--dm-line); border-radius: 8px; background: #fff; color: var(--dm-text);
}
.dm-price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dm-filter-actions { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.dm-filter-actions button { min-height: 42px; border: 0; border-radius: 8px; background: var(--dm-accent); color: #fff; font-weight: 800; }
.dm-filter-reset { display: grid; min-width: 42px; place-items: center; border: 1px solid var(--dm-line); border-radius: 8px; background: #fff; text-decoration: none; }
.dm-shop-content { min-width: 0; }
.dm-mobile-filter-button { display: none; margin: 0 0 15px; }
.dm-mobile-filter-close { display: none; }
.dm-archive-categories { margin: 0 0 26px; }
.dm-archive-categories h2 { margin: 0 0 13px; font-size: 22px; }
.dm-archive-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dm-archive-category {
    display: flex; min-height: 67px; align-items: center; gap: 11px; padding: 11px;
    border: 1px solid var(--dm-line); border-radius: 11px; background: #fff; text-decoration: none;
}
.dm-archive-category:hover { border-color: var(--dm-accent); }
.dm-archive-category__thumb { flex: 0 0 43px; height: 43px; overflow: hidden; display: grid; place-items: center; border-radius: 9px; background: var(--dm-accent-soft); color: var(--dm-accent-dark); font-weight: 900; }
.dm-archive-category__thumb img { width: 100%; height: 100%; object-fit: contain; }
.dm-archive-category__name { font-size: 12px; font-weight: 800; line-height: 1.2; }
.dm-archive-category__count { display: block; margin-top: 3px; color: var(--dm-muted); font-size: 10px; font-weight: 500; }

/* Woo toolbar */
.woocommerce .woocommerce-result-count { color: var(--dm-muted); font-size: 13px; }
.woocommerce .woocommerce-ordering select { min-height: 42px; padding: 0 38px 0 11px; border: 1px solid var(--dm-line); border-radius: 9px; background: #fff; color: var(--dm-text); }

/* Product grid and cards */
.woocommerce ul.products, .woocommerce-page ul.products {
    display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px 12px !important; clear: both; margin: 0 !important; padding: 0 !important;
}
.woocommerce ul.products::before, .woocommerce ul.products::after,
.woocommerce-page ul.products::before, .woocommerce-page ul.products::after { display: none !important; content: none !important; }
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
    position: relative; display: flex !important; width: auto !important; min-width: 0; height: 100%; flex-direction: column;
    margin: 0 !important; padding: 11px 11px 13px !important; border: 1px solid var(--dm-line); border-radius: 13px;
    background: #fff; box-shadow: 0 4px 15px rgba(29, 47, 53, .04); text-align: left; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.woocommerce ul.products li.product:hover { transform: translateY(-3px); border-color: rgba(21,131,101,.35); box-shadow: var(--dm-shadow-sm); }
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link { display: flex; flex: 1 1 auto; flex-direction: column; color: var(--dm-text); text-decoration: none; }
.woocommerce ul.products li.product img {
    display: block; width: 100% !important; height: 225px !important; margin: 0 0 11px !important; padding: 5px;
    border-radius: 9px; background: #fff; object-fit: contain !important; object-position: center;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    display: -webkit-box; min-height: 4.35em; margin: 0 0 8px !important; padding: 0 !important; overflow: hidden;
    color: var(--dm-text); font-size: 14px !important; font-weight: 700; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
}
.woocommerce ul.products li.product .price { display: block; min-height: 1.55em; margin: auto 0 11px !important; color: var(--dm-accent-dark) !important; font-size: 17px !important; font-weight: 850; }
.woocommerce ul.products li.product .price del { color: #949da1; font-size: 12px; font-weight: 500; }
.woocommerce ul.products li.product .price ins { text-decoration: none; }
.woocommerce ul.products li.product .button {
    width: 100%; min-height: 41px; margin: 0 !important; padding: 10px 12px !important; border-radius: 8px;
    background: var(--dm-accent); color: #fff; font-size: 13px; font-weight: 800; text-align: center;
}
.woocommerce ul.products li.product .button:hover { background: var(--dm-accent-dark); color: #fff; }
.woocommerce ul.products li.product .added_to_cart { margin-top: 7px; color: var(--dm-accent-dark); font-size: 12px; font-weight: 800; }
.woocommerce ul.products li.product.outofstock img { opacity: .57; filter: grayscale(.15); }
.dm-badge-row { position: absolute; z-index: 4; top: 18px; left: 18px; right: 18px; display: flex; flex-wrap: wrap; gap: 5px; pointer-events: none; }
.dm-product-badge { display: inline-flex; padding: 6px 8px; border-radius: 6px; color: #fff; font-size: 9px; font-weight: 900; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
.dm-product-badge--out { background: #4e585d; }
.dm-product-badge--new { background: #2977c3; }
.dm-product-badge--sale { background: var(--dm-danger); }
.woocommerce span.onsale { display: none !important; }

/* Product single */
.woocommerce div.product { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: clamp(32px, 5vw, 70px); }
.woocommerce div.product div.images, .woocommerce div.product div.summary { float: none; width: auto; }
.woocommerce div.product .product_title { margin-top: 0; font-size: clamp(31px, 4vw, 52px); line-height: 1.07; letter-spacing: -.035em; }
.woocommerce div.product p.price { color: var(--dm-accent-dark) !important; font-size: 29px !important; font-weight: 900; }
.woocommerce div.product .woocommerce-product-gallery__image img { border-radius: 16px; background: #fff; object-fit: contain; }
.woocommerce div.product form.cart .button, .woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
    border-radius: 8px; background: var(--dm-accent); color: #fff; font-weight: 800;
}
.woocommerce div.product form.cart .button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--dm-accent-dark); color: #fff; }
.woocommerce .quantity .qty { min-height: 43px; border: 1px solid var(--dm-line); border-radius: 8px; }
.woocommerce-tabs ul.tabs li { border-radius: 8px 8px 0 0 !important; }

/* Pagination, notices and checkout */
.woocommerce nav.woocommerce-pagination { margin-top: 38px; }
.woocommerce nav.woocommerce-pagination ul { overflow: visible; border: 0; }
.woocommerce nav.woocommerce-pagination ul li { margin: 0 3px; border: 0; }
.woocommerce nav.woocommerce-pagination ul li a, .woocommerce nav.woocommerce-pagination ul li span {
    display: grid; min-width: 40px; height: 40px; padding: 0 9px; place-items: center; border: 1px solid var(--dm-line); border-radius: 8px; background: #fff;
}
.woocommerce nav.woocommerce-pagination ul li span.current { border-color: var(--dm-accent); background: var(--dm-accent); color: #fff; }
.woocommerce-message, .woocommerce-info, .woocommerce-error { border-radius: 10px; background: #fff; box-shadow: var(--dm-shadow-sm); }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .select2-container--default .select2-selection--single {
    min-height: 45px; padding: 9px 11px; border: 1px solid var(--dm-line); border-radius: 8px; background: #fff;
}
.woocommerce table.shop_table { overflow: hidden; border-color: var(--dm-line); border-radius: 12px; background: #fff; }

/* Footer */
.dm-footer { padding: 50px 0 22px; background: #273239; color: #fff; }
.dm-footer__grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 40px; }
.dm-footer h2, .dm-footer h3 { margin: 0 0 14px; }
.dm-footer h2 { font-size: 28px; }
.dm-footer h3 { font-size: 15px; }
.dm-footer p, .dm-footer li, .dm-footer a { color: rgba(255,255,255,.73); font-size: 13px; }
.dm-footer a { text-decoration: none; }
.dm-footer a:hover { color: #fff; }
.dm-footer ul { margin: 0; padding: 0; list-style: none; }
.dm-footer li { margin: 7px 0; }
.dm-footer__contacts { display: grid; gap: 9px; }
.dm-footer__bottom { margin-top: 35px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.13); color: rgba(255,255,255,.55); font-size: 12px; }

/* Overlay */
.dm-overlay { position: fixed; z-index: 70; inset: 0; background: rgba(20,31,36,.48); visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .16s, visibility .16s; }
.dm-overlay.is-open { visibility: visible; opacity: 1; pointer-events: auto; }

/* Responsive */
@media (max-width: 1250px) {
    .dm-header__main { grid-template-columns: minmax(180px, 250px) minmax(280px, 1fr) auto; gap: 15px; }
    .dm-action__text { display: none; }
    .dm-category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dm-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dm-mega__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .dm-archive-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .dm-topbar__inner { justify-content: center; }
    .dm-topbar__group:last-child { display: none; }
    .dm-header__main { grid-template-columns: 1fr auto; min-height: 78px; }
    .dm-search { grid-column: 1 / -1; padding-bottom: 15px; }
    .dm-brand .custom-logo { max-height: 55px; }
    .dm-navbar__inner { min-height: 54px; }
    .dm-catalog { flex-basis: 230px; }
    .dm-primary-nav { display: none; position: fixed; z-index: 100; inset: 0 17% 0 0; padding: 80px 25px 30px; overflow: auto; background: #fff; box-shadow: var(--dm-shadow); }
    .dm-primary-nav.is-open { display: block; }
    .dm-primary-nav ul { height: auto; display: grid; gap: 18px; }
    .dm-primary-nav a { font-size: 18px; }
    .dm-mobile-menu-button { display: flex; margin-left: auto; }
    .dm-mega { position: fixed; top: 0; left: 0; width: min(88vw, 430px); height: 100vh; max-height: none; padding: 75px 20px 30px; border-radius: 0; transform: translateX(-105%); opacity: 1; visibility: visible; pointer-events: auto; }
    .dm-mega.is-open { transform: none; }
    .dm-mega__grid { grid-template-columns: 1fr; }
    .dm-hero__box { grid-template-columns: 1fr; min-height: 0; }
    .dm-hero__visual { display: none; }
    .dm-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dm-shop-layout { grid-template-columns: 1fr; }
    .dm-shop-sidebar {
        position: fixed; z-index: 110; top: 0; bottom: 0; left: 0; width: min(88vw, 360px); overflow: auto;
        padding: 65px 16px 25px; background: var(--dm-bg); transform: translateX(-105%); transition: transform .2s ease;
    }
    .dm-shop-sidebar.is-open { transform: none; }
    .dm-mobile-filter-button { display: inline-flex; }
    .dm-mobile-filter-close { position: absolute; top: 14px; right: 14px; display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid var(--dm-line); border-radius: 9px; background: #fff; }
    .dm-about { grid-template-columns: 1fr; }
    .dm-footer__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .dm-container { width: min(calc(100% - 24px), var(--dm-container)); }
    .dm-topbar { display: none; }
    .dm-header__main { gap: 8px; }
    .dm-action { min-height: 43px; padding: 8px 10px; }
    .dm-action--account { display: none; }
    .dm-navbar__inner { gap: 8px; }
    .dm-catalog { flex-basis: auto; flex: 1; }
    .dm-catalog__button { min-height: 52px; }
    .dm-mobile-menu-button { min-height: 52px; }
    .dm-hero { padding-top: 15px; }
    .dm-hero__box { padding: 30px 24px; border-radius: 18px; }
    .dm-hero h1 { font-size: clamp(38px, 12vw, 58px); }
    .dm-section-head { align-items: flex-start; flex-direction: column; }
    .dm-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .dm-category-card { min-height: 155px; }
    .dm-benefits { grid-template-columns: 1fr; }
    .dm-about__facts { grid-template-columns: 1fr 1fr; }
    .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 11px 8px !important; }
    .woocommerce ul.products li.product { padding: 8px 8px 10px !important; border-radius: 11px; }
    .woocommerce ul.products li.product img { height: 170px !important; margin-bottom: 8px !important; }
    .woocommerce ul.products li.product .woocommerce-loop-product__title { min-height: 4.4em; font-size: 12.5px !important; line-height: 1.47; }
    .woocommerce ul.products li.product .price { font-size: 14px !important; }
    .woocommerce ul.products li.product .button { min-height: 37px; padding: 8px 6px !important; font-size: 11px; }
    .dm-badge-row { top: 12px; left: 12px; right: 12px; }
    .dm-product-badge { padding: 5px 6px; font-size: 8px; }
    .dm-archive-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .woocommerce div.product { grid-template-columns: 1fr; }
    .dm-footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .dm-brand__name { font-size: 22px; }
    .dm-brand__tagline { display: none; }
    .dm-search .search-field { height: 48px; padding-right: 93px; }
    .dm-search button { min-width: 78px; height: 38px; }
    .dm-about__facts { grid-template-columns: 1fr; }
    .woocommerce ul.products li.product img { height: 145px !important; }
}

/* AJAX cart feedback in product grids */
.dm-loop-cart__feedback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 10px;
    min-height: 24px;
    margin-top: 8px;
    font-size: 13px;
}

.dm-loop-cart__status {
    color: #287f78;
    font-weight: 700;
}

.dm-loop-cart__view-cart {
    color: #287f78;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dm-loop-cart__feedback [hidden] {
    display: none !important;
}

.dm-loop-add-button.dm-is-added {
    background: #2e8b72 !important;
    border-color: #2e8b72 !important;
}

.dm-cart-summary {
    white-space: nowrap;
}

@media (max-width: 720px) {
    .dm-loop-cart__feedback {
        align-items: flex-start;
        flex-direction: column;
        font-size: 12px;
    }
}

/* Keep the cart icon compact inside product buttons. */
.woocommerce ul.products li.product .dm-loop-add-button img.emoji {
    display: inline-block !important;
    width: 15px !important;
    min-width: 15px !important;
    height: 15px !important;
    min-height: 15px !important;
    margin: 0 4px 0 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    vertical-align: -2px;
}

/* WooCommerce hides the field when only one unit is available; show that value clearly. */
.dm-fixed-quantity-wrap {
    display: block !important;
}

.dm-fixed-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 64px;
    min-height: 42px;
    padding: 8px 10px;
    color: #172027;
    background: #fff;
    border: 1px solid #c8d6d9;
    border-radius: 13px;
    font-size: 16px;
    line-height: 1;
}

/* Remove control beside the live cart quantity. */
.dm-loop-cart__remove {
    appearance: none;
    padding: 0;
    color: #a33d3d;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.dm-loop-cart__remove:hover,
.dm-loop-cart__remove:focus {
    color: #7d2020;
}

.dm-loop-add-button.dm-cart-update-mode {
    background: #317f79 !important;
    border-color: #317f79 !important;
}

/* Floating cart summary: always visible while the customer scrolls. */
.dm-header__actions > a.dm-action[href*="/cart/"] {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 10020;
    min-width: 158px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(70, 139, 133, .28);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(28, 54, 62, .18);
    backdrop-filter: blur(8px);
}

body.admin-bar .dm-header__actions > a.dm-action[href*="/cart/"] {
    top: 48px;
}

.dm-header__actions > a.dm-action[href*="/cart/"] .dm-cart-summary {
    color: #287f78;
    font-weight: 800;
}

@media (max-width: 720px) {
    .dm-header__actions > a.dm-action[href*="/cart/"] {
        top: 10px;
        right: 10px;
        min-width: 126px;
        padding: 8px 11px;
        border-radius: 13px;
    }

    body.admin-bar .dm-header__actions > a.dm-action[href*="/cart/"] {
        top: 56px;
    }

    .dm-header__actions > a.dm-action[href*="/cart/"] .dm-action__label {
        font-size: 10px;
    }

    .dm-header__actions > a.dm-action[href*="/cart/"] .dm-cart-summary {
        font-size: 13px;
    }
}

/* Pilot 50 g packaging */
.dm-pack-price,
.dm-kg-price {
    display: block;
}

.dm-pack-price {
    color: #287f78;
    font-weight: 800;
}

.dm-pack-price small {
    font-size: .72em;
    font-weight: 700;
}

.dm-kg-price {
    margin-top: 3px;
    color: #6f7f85;
    font-size: 12px;
    font-weight: 600;
}

.dm-loop-cart[data-pack-weight="0.05"] .dm-loop-cart__controls {
    display: grid;
    grid-template-columns: minmax(64px, 92px) minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 4px 10px;
    align-items: stretch;
}

.dm-loop-cart[data-pack-weight="0.05"] .quantity {
    grid-column: 1;
    grid-row: 1;
}

.dm-loop-cart[data-pack-weight="0.05"] .dm-pack-unit {
    grid-column: 1;
    grid-row: 2;
    color: #6f7f85;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
}

.dm-loop-cart[data-pack-weight="0.05"] .dm-loop-add-button {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.dm-single-pack-unit,
.dm-cart-pack-unit {
    margin-left: 8px;
    color: #5e7479;
    font-size: 13px;
    font-weight: 700;
}

.woocommerce-cart-form .dm-cart-pack-unit {
    display: inline-block;
    margin-top: 5px;
}


/* Compact five-column catalog refinements (2026-08-28). */
@media (min-width: 1201px) {
    .dm-archive-category-grid,
    .dm-category-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

    body.home ul.products {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 14px 10px !important;
    }

    body.home ul.products li.product {
        padding: 9px 9px 11px !important;
    }

    body.home ul.products li.product > a img.wp-post-image {
        height: 185px !important;
    }

    body.home ul.products li.product .woocommerce-loop-product__title {
        font-size: 15px !important;
        line-height: 1.3 !important;
    }
}

@media (min-width: 721px) and (max-width: 1200px) {
    .dm-archive-category-grid,
    .dm-category-grid,
    body.home ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    .dm-archive-category-grid,
    .dm-category-grid,
    body.home ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* WordPress turns the cart emoji into an image; keep it icon-sized everywhere. */
.dm-loop-add-button img.emoji,
button.dm-loop-add-button img.emoji,
a.dm-loop-add-button img.emoji {
    display: inline-block !important;
    width: 15px !important;
    min-width: 15px !important;
    max-width: 15px !important;
    height: 15px !important;
    min-height: 15px !important;
    max-height: 15px !important;
    margin: 0 5px 0 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    vertical-align: -2px !important;
}


/* Homepage product grid: explicit layout, independent of WooCommerce wrappers. */
body.home ul.products {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 14px 10px !important;
    clear: both !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.home ul.products::before,
body.home ul.products::after {
    display: none !important;
    content: none !important;
}

body.home ul.products li.product {
    float: none !important;
    display: flex !important;
    width: auto !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 9px 9px 11px !important;
}

body.home ul.products li.product > a img.wp-post-image {
    width: 100% !important;
    height: 185px !important;
    max-height: 185px !important;
    object-fit: contain !important;
}

@media (min-width: 721px) and (max-width: 1200px) {
    body.home ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    body.home ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.home ul.products li.product > a img.wp-post-image {
        height: 150px !important;
        max-height: 150px !important;
    }
}


/* Archive/shop layout: match the centered, compact homepage grid. */
body.woocommerce:not(.home) > .woocommerce-breadcrumb,
body.woocommerce:not(.home) > .woocommerce-products-header,
body.woocommerce:not(.home) > .dm-archive-category-grid,
body.woocommerce:not(.home) > .woocommerce-notices-wrapper,
body.woocommerce:not(.home) > .woocommerce-result-count,
body.woocommerce:not(.home) > .woocommerce-ordering,
body.woocommerce:not(.home) > ul.products,
body.woocommerce:not(.home) > .woocommerce-pagination {
    box-sizing: border-box;
    width: min(calc(100% - 40px), var(--dm-container));
    margin-left: auto !important;
    margin-right: auto !important;
}
@media (min-width: 1201px) {
    body.woocommerce:not(.home) ul.products {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 14px 10px !important;
    }
    body.woocommerce:not(.home) ul.products li.product {
        padding: 9px 9px 11px !important;
    }
    body.woocommerce:not(.home) ul.products li.product > a img.wp-post-image {
        height: 185px !important;
        max-height: 185px !important;
        object-fit: contain !important;
    }
}
@media (min-width: 721px) and (max-width: 1200px) {
    body.woocommerce:not(.home) ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 720px) {
    body.woocommerce:not(.home) > .woocommerce-breadcrumb,
    body.woocommerce:not(.home) > .woocommerce-products-header,
    body.woocommerce:not(.home) > .dm-archive-category-grid,
    body.woocommerce:not(.home) > .woocommerce-notices-wrapper,
    body.woocommerce:not(.home) > .woocommerce-result-count,
    body.woocommerce:not(.home) > .woocommerce-ordering,
    body.woocommerce:not(.home) > ul.products,
    body.woocommerce:not(.home) > .woocommerce-pagination {
        width: min(calc(100% - 24px), var(--dm-container));
    }
    body.woocommerce:not(.home) ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    body.woocommerce:not(.home) ul.products li.product > a img.wp-post-image {
        height: 150px !important;
        max-height: 150px !important;
        object-fit: contain !important;
    }
}


/* Keep category heading and subcategory cards inside the same shop container. */
body.woocommerce:not(.home) > h1.page-title,
body.woocommerce:not(.home) > .dm-archive-categories {
    box-sizing: border-box;
    width: min(calc(100% - 40px), var(--dm-container));
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (max-width: 720px) {
    body.woocommerce:not(.home) > h1.page-title,
    body.woocommerce:not(.home) > .dm-archive-categories {
        width: min(calc(100% - 24px), var(--dm-container));
    }
}


/* Align WooCommerce result count and sorting with the centered product grid. */
body.woocommerce:not(.home) > .woocommerce-result-count,
body.woocommerce:not(.home) > .woocommerce-ordering {
    float: none !important;
    box-sizing: border-box;
    width: min(calc(100% - 40px), var(--dm-container));
    margin-left: auto !important;
    margin-right: auto !important;
}
body.woocommerce:not(.home) > .woocommerce-result-count {
    margin-bottom: 14px !important;
}
body.woocommerce:not(.home) > .woocommerce-ordering {
    display: flex !important;
    justify-content: flex-end;
    margin-top: -48px !important;
    margin-bottom: 16px !important;
}
@media (max-width: 720px) {
    body.woocommerce:not(.home) > .woocommerce-result-count,
    body.woocommerce:not(.home) > .woocommerce-ordering {
        width: min(calc(100% - 24px), var(--dm-container));
    }
    body.woocommerce:not(.home) > .woocommerce-ordering {
        margin-top: 0 !important;
        justify-content: stretch;
    }
    body.woocommerce:not(.home) > .woocommerce-ordering select {
        width: 100%;
    }
}

/* Keep product labels local and floating cart aligned with the site container. */
body ul.products li.product {
    position: relative !important;
}
body .dm-header__actions > a.dm-action[href*="/cart/"] {
    right: max(20px, calc((100% - var(--dm-container, 1480px)) / 2)) !important;
    left: auto !important;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
}
@media (max-width: 720px) {
    body .dm-header__actions > a.dm-action[href*="/cart/"] {
        right: 12px !important;
        max-width: calc(100vw - 24px);
    }
}

/* App-style mobile bottom navigation. */
.dm-mobile-dock,
.dm-mobile-search-panel {
    display: none;
}

@media (max-width: 782px) {
    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    body .dm-header__actions > a.dm-action[href*="/cart/"] {
        display: none !important;
    }

    .dm-mobile-dock {
        position: fixed;
        z-index: 10040;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: 70px;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--dm-line);
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 -9px 28px rgba(28, 54, 62, .13);
        backdrop-filter: blur(12px);
    }

    .dm-mobile-dock__item {
        position: relative;
        min-width: 0;
        min-height: 58px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        margin: 0;
        padding: 5px 2px;
        border: 0;
        border-radius: 13px;
        background: transparent;
        color: #637176;
        font-size: 11px;
        font-weight: 750;
        line-height: 1.1;
        text-align: center;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .dm-mobile-dock__item svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .dm-mobile-dock__item:first-child svg,
    .dm-mobile-dock__item:nth-child(2) svg {
        fill: currentColor;
        stroke: none;
    }

    .dm-mobile-dock__item:hover,
    .dm-mobile-dock__item:focus,
    .dm-mobile-dock__item.is-active {
        background: var(--dm-accent-soft);
        color: var(--dm-accent-dark);
    }

    .dm-mobile-dock__item:focus-visible {
        outline: 2px solid var(--dm-accent);
        outline-offset: -2px;
    }

    .dm-mobile-dock__icon-wrap {
        position: relative;
        display: inline-grid;
        place-items: center;
    }

    .dm-mobile-dock__badge {
        position: absolute;
        top: -7px;
        right: -12px;
        display: grid;
        min-width: 19px;
        height: 19px;
        padding: 0 5px;
        place-items: center;
        border: 2px solid #fff;
        border-radius: 999px;
        background: var(--dm-danger);
        color: #fff;
        font-size: 9px;
        font-weight: 900;
        line-height: 1;
    }

    .dm-mobile-dock__badge.is-empty {
        display: none;
    }

    .dm-mobile-search-panel {
        position: fixed;
        z-index: 10039;
        right: 12px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        left: 12px;
        display: block;
        padding: 10px;
        border: 1px solid var(--dm-line);
        border-radius: 15px;
        background: #fff;
        box-shadow: 0 14px 40px rgba(28, 54, 62, .2);
    }

    .dm-mobile-search-panel[hidden] {
        display: none !important;
    }

    .dm-mobile-search-panel form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .dm-mobile-search-panel input[type="search"] {
        width: 100%;
        min-width: 0;
        height: 46px;
        padding: 0 13px;
        border: 2px solid var(--dm-accent);
        border-radius: 10px;
        background: #fff;
        color: var(--dm-text);
        outline: none;
    }

    .dm-mobile-search-panel button {
        min-width: 78px;
        height: 46px;
        padding: 0 15px;
        border: 0;
        border-radius: 10px;
        background: var(--dm-accent);
        color: #fff;
        font-weight: 800;
    }
}


/* DM mobile polish 2026-09-09 */
/* Soft framed wordmark, matching the rounded storefront interface. */
.dm-brand {
    width: max-content;
    max-width: 100%;
    padding: 9px 13px;
    border: 1px solid rgba(21, 131, 101, .18);
    border-radius: 16px;
    background: linear-gradient(135deg, #f3fbf8 0%, #fffaf1 100%);
    box-shadow: 0 6px 18px rgba(28, 54, 62, .07);
}

/* The inline SVG is filtered by WordPress in the header; provide a reliable phone glyph. */
.dm-action--phone::before {
    content: "☎";
    display: inline-grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    color: var(--dm-accent-dark);
    font-size: 21px;
    line-height: 1;
    transform: rotate(-10deg);
}

.dm-catalog__button,
.dm-mobile-menu-button {
    border-radius: 14px;
}

.dm-category-card__name,
.dm-archive-category__name,
.dm-mega__root,
.dm-mega__children a,
.dm-category-tree a span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* One stable cart-control layout and colour on the home page and category archives. */
.dm-loop-cart__controls {
    display: grid;
    grid-template-columns: minmax(58px, 78px) minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 5px 8px;
    align-items: stretch;
}
.dm-loop-cart__controls .quantity,
.dm-loop-cart__controls .dm-fixed-quantity-wrap {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
}
.dm-loop-cart__controls .qty,
.dm-loop-cart__controls .dm-fixed-quantity {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px;
}
.dm-loop-cart__controls .dm-pack-unit {
    grid-column: 1;
    grid-row: 2;
    color: var(--dm-muted);
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
}
.woocommerce ul.products li.product .dm-loop-cart__controls .dm-loop-add-button {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0;
    min-height: 42px;
    padding: 8px 9px !important;
    border-radius: 10px !important;
    background: #70c3bd !important;
    color: #fff !important;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
}
.woocommerce ul.products li.product .dm-loop-cart__controls .dm-loop-add-button:hover {
    background: var(--dm-accent-dark) !important;
}
.woocommerce ul.products li.product .dm-loop-cart__controls .dm-loop-add-button.dm-cart-update-mode {
    background: #317f79 !important;
}

@media (max-width: 980px) {
    .dm-navbar { padding: 7px 0; }
    .dm-navbar__inner { min-height: 52px; align-items: center; }
    .dm-catalog { align-self: center; }
    .dm-catalog__button,
    .dm-mobile-menu-button {
        min-height: 52px;
        overflow: hidden;
        border-radius: 14px;
    }
    .dm-mobile-menu-button {
        border: 1px solid var(--dm-line);
        background: #fff;
    }
}

@media (max-width: 720px) {
    .dm-brand {
        padding: 8px 10px;
        border-radius: 14px;
    }
    .dm-brand__name { font-size: 22px; }

    .dm-category-card {
        min-height: 176px;
        padding: 13px;
    }
    .dm-category-card__image { inset: 3px 3px 68px; }
    .dm-category-card__image img { padding: 2px; }
    .dm-category-card__placeholder { inset: 3px 3px 68px; }
    .dm-category-card__footer { align-items: flex-end; gap: 5px; }
    .dm-category-card__name { font-size: 12.5px; line-height: 1.18; }
    .dm-category-card__count { font-size: 9px; }

    .dm-archive-category {
        min-height: 86px;
        align-items: center;
        gap: 8px;
        padding: 9px;
        overflow: hidden;
    }
    .dm-archive-category__thumb {
        flex-basis: 50px;
        height: 50px;
    }
    .dm-archive-category__name { font-size: 11.5px; line-height: 1.16; }

    .dm-loop-cart__controls {
        grid-template-columns: minmax(48px, 60px) minmax(0, 1fr);
        gap: 4px 6px;
    }
    .woocommerce ul.products li.product .dm-loop-cart__controls .dm-loop-add-button {
        min-height: 40px;
        padding: 7px 5px !important;
        font-size: 11px !important;
    }
}


/* DM storefront button scope fix 2026-09-09 */
ul.products li.product .dm-loop-cart__controls .dm-loop-add-button {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0;
    min-height: 42px;
    padding: 8px 9px !important;
    border-radius: 10px !important;
    background: #70c3bd !important;
    color: #fff !important;
    font-size: 12px !important;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}
ul.products li.product .dm-loop-cart__controls .dm-loop-add-button:hover {
    background: var(--dm-accent-dark) !important;
}
.dm-badge-row,
.dm-product-badge {
    display: none !important;
}


/* Keep ordinary product buttons equal to the quantity field height. */
.dm-loop-cart__controls:not(:has(.dm-pack-unit)) .dm-loop-add-button {
    grid-row: 1 !important;
}
