.mt-dowels {
    --mt-dowel-ink: #202f3e;
    --mt-dowel-muted: #526374;
    --mt-dowel-line: #dbe2e9;
    --mt-dowel-accent: #174e80;
    color: var(--mt-dowel-ink);
}

.mt-dowels [hidden] { display: none !important; }
.mt-dowels h1 { margin: 0 0 20px; }
.mt-dowels__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mt-dowels__card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--mt-dowel-line);
    border-radius: 10px;
    background: #fff;
}

.mt-dowels__photo {
    display: grid;
    place-items: center;
    min-width: 0;
    aspect-ratio: 4 / 3;
    background: #fff;
    border-bottom: 1px solid var(--mt-dowel-line);
    color: var(--mt-dowel-muted);
}

.mt-dowels__photo a, .mt-dowels__photo img { display: block; width: 100%; height: 100%; }
.mt-dowels__photo img { object-fit: contain; }
.mt-dowels__body { display: flex; flex: 1; flex-direction: column; gap: 14px; padding: 16px; }
.mt-dowels__body h2 { margin: 0; color: inherit; font-size: 1.17em; line-height: 1.3; }
.mt-dowels__body form { display: flex; flex: 1; margin: 0; }
.mt-dowels__body fieldset { display: flex; flex: 1; flex-direction: column; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.mt-dowels__options { display: grid; gap: 5px; }
.mt-dowels label { margin: 0; color: var(--mt-dowel-muted); font-size: .875em; }
.mt-dowels__options select + label { margin-top: 5px; }
.mt-dowels select, .mt-dowels input, .mt-dowels button { box-sizing: border-box; min-height: 44px; margin: 0; font: inherit; }
.mt-dowels select, .mt-dowels input {
    width: 100%;
    min-width: 0;
    padding: 6px 9px;
    border: 1px solid #9caab9;
    border-radius: 5px;
    color: var(--mt-dowel-ink);
    background: #fff;
}

.mt-dowels__details { display: grid; gap: 3px; margin-top: auto; }
.mt-dowels__article, .mt-dowels__cost span, .mt-dowels [data-dowel-stock] { color: var(--mt-dowel-muted); font-size: .875em; }
.mt-dowels__article { overflow-wrap: anywhere; }
.mt-dowels__cost strong { font-size: 1.25em; }
.mt-dowels__buy { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: end; gap: 10px; }
.mt-dowels__buy label { display: grid; gap: 5px; }
.mt-dowels button {
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: var(--mt-dowel-accent);
    color: #fff;
    cursor: pointer;
}

.mt-dowels button:hover:not(:disabled) { background: #0e3d69; }
.mt-dowels button:disabled, .mt-dowels input:disabled { border-color: var(--mt-dowel-line); color: #4a5b6a; background: #eef1f4; cursor: default; }
.mt-dowels :focus-visible { outline: 2px solid var(--mt-dowel-accent); outline-offset: 2px; }
.mt-dowels__photo a:focus-visible { outline-offset: -3px; }

@media (max-width: 1010px) {
    .mt-dowels__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .mt-dowels__grid { grid-template-columns: minmax(0, 1fr); }
    .mt-dowels__photo { max-height: 250px; }
}

.mt-dowels { --mt-dowel-accent: #0865ed; }
.mt-dowels h1 { margin-bottom: 10px; }
.mt-dowels__summary { max-width: 90ch; margin: 0 0 28px; font-size: 1rem; line-height: 1.58; }
.mt-dowels__summary p { margin: 0 0 10px; }
.mt-dowels__catalogue { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; }
.mt-dowels__results { min-width: 0; }
.mt-dowels__filters, .mt-dowels__empty {
    padding: 15px;
    border: 1px solid var(--mt-dowel-line);
    border-radius: 9px;
    background: #f5f8fc;
}
.mt-dowels__filters summary { cursor: pointer; font-weight: 700; }
.mt-dowels__filters summary::marker { color: var(--mt-dowel-accent); }
.mt-dowels__filters summary [data-dowel-filter-count] {
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--mt-dowel-accent);
    color: #fff;
    font-size: .8em;
}
.mt-dowels__filter-body { display: grid; gap: 7px; padding-top: 12px; }
.mt-dowels__filter-body select + label, .mt-dowels [data-dowel-reset] { margin-top: 6px; }
.mt-dowels [data-dowel-reset]:not(:disabled) { color: var(--mt-dowel-accent); border-color: var(--mt-dowel-line); background: #fff; }
.mt-dowels__counts { min-height: 1.25em; margin: 0 0 12px; color: var(--mt-dowel-muted); font-size: .875em; }
.mt-dowels__counts:empty { display: none; }
.mt-dowels__card h2 a { color: inherit; text-decoration: none; }
.mt-dowels__card h2 a:hover { color: var(--mt-dowel-accent); text-decoration: underline; }
.mt-dowels__dimensions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 7px 0;
    margin: 0;
    border-block: 1px solid var(--mt-dowel-line);
    font-size: .875em;
}
.mt-dowels__dimensions div { display: flex; flex-wrap: wrap; gap: 3px 6px; }
.mt-dowels__dimensions dt { color: var(--mt-dowel-muted); font-weight: 400; }
.mt-dowels__dimensions dd { margin: 0; font-weight: 600; }
.mt-dowels__photo { max-height: 240px; }
@media (min-width: 760px) {
    .mt-dowels__catalogue:has(.mt-dowels__filters:not([hidden])) { grid-template-columns: 200px minmax(0, 1fr); gap: 22px; }
    .mt-dowels__filters summary { list-style: none; cursor: default; pointer-events: none; }
    .mt-dowels__filters summary::-webkit-details-marker, .mt-dowels__filters summary [data-dowel-filter-count] { display: none; }
}
@media (min-width: 760px) and (max-width: 1020px) {
    .mt-dowels__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 759px) {
    .mt-dowels__summary { margin-bottom: 19px; }
    .mt-dowels__filters { padding-block: 0; }
    .mt-dowels__filters summary { padding-block: 12px; min-height: 44px; box-sizing: border-box; }
    .mt-dowels__filter-body { padding: 1px 0 14px; }
}

.mt-dowel-product-option { margin: 0 0 14px; }
.mt-dowel-product-option__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 7px 0 0; }
.mt-dowel-product-option__list > * {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 11px;
    box-sizing: border-box;
    border: 1px solid #c5d1e2;
    border-radius: 6px;
}
.mt-dowel-product-option__list [aria-current="page"] { border-color: #0865ed; color: #084db9; background: #eef5ff; font-weight: 600; }
.mt-dowel-product-option__list a { color: #084db9; }

.mt-dowels__breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 9px;
    margin-bottom: 8px;
    color: var(--mt-dowel-muted);
    font-size: .875em;
}
.mt-dowels__breadcrumbs a { color: var(--mt-dowel-muted); }
.mt-dowels__breadcrumbs a:hover { color: var(--mt-dowel-accent); }

.mt-dowel-product-buy { grid-area: config; min-width: 0; }
.mt-dowel-product-buy > p { margin: 0; }
