.product-category {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.product-category > .category-image {
    flex: none;
    transition: box-shadow .2s ease;
}
.product-category:hover > .category-image,
.product-category:focus-within > .category-image {
    box-shadow: 0 0 0 2px #ed9d2d;
}
.category-details-button {
    align-self: flex-start;
    min-height: 46px;
    margin-top: auto;
    padding: 11px 22px;
    border-radius: 999px;
    background: #ed9d2d;
    color: #2b180c;
    font-weight: 500;
    font-size: 14px;
    transition: background .2s ease, transform .2s ease;
}
.category-details-button:hover { background: #f3ad4a; }
.category-details-button:active { transform: translateY(1px); }
.category-details-button:focus-visible,
.product-dialog button:focus-visible,
#product-dialog-title:focus-visible {
    outline: 3px solid #b56800;
    outline-offset: 4px;
}
.product-dialog {
    width: calc(100% - 40px);
    max-width: 1120px;
    max-height: 90vh;
    max-height: 90dvh;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 22px;
    background: #fff;
    color: #2b180c;
    box-shadow: 0 24px 100px #0005;
}
.product-dialog::backdrop {
    background: rgb(26 21 17 / 68%);
    backdrop-filter: blur(4px);
}
.product-dialog [hidden] { display: none !important; }
.product-dialog[data-view="line"] { max-width: 520px; }
.product-dialog[open] { animation: catalog-open .2s ease-out; }
.product-dialog-shell {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    max-height: 90dvh;
}
.product-dialog-header {
    display: flex;
    flex: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px 24px;
    border-bottom: 1px solid #e7e2de;
}
#product-dialog-title {
    margin: 0 0 8px;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 600;
    line-height: 1.4;
}
#product-dialog-description {
    max-width: 70ch;
    margin: 0;
    color: #625a55;
    font-size: 14px;
    line-height: 1.8;
}
.product-dialog-close {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #ded7d1;
    border-radius: 50%;
    background: #fff;
    color: #49423f;
    transition: background .2s ease;
}
.product-dialog-close:hover { background: #ebe8e6; }
.product-dialog-close svg { width: 20px; height: 20px; }
.product-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 24px 32px 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-anchor: none;
    scrollbar-gutter: stable;
    background: #f7f5f3;
}
.product-dialog-content:focus-visible {
    outline: 2px solid #b56800;
    outline-offset: -3px;
}
#product-dialog-note {
    margin: 0 0 20px;
    color: #625a55;
    font-size: 13px;
    line-height: 1.8;
}
.catalog-model-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.catalog-model {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e7e2de;
    border-radius: 12px;
    background: #fff;
}
.catalog-model-image {
    position: relative;
    width: 100%;
    height: 210px;
    margin-top: 18px;
    overflow: hidden;
    background: #fff;
}
.catalog-model-crop {
    position: relative;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}
.catalog-model-crop img { pointer-events: none; }
.catalog-model-body { padding: 20px; }
.model-name {
    margin: 0 0 7px;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.model-installation {
    min-height: 42px;
    margin: 0 0 16px;
    color: #625a55;
    font-size: 13px;
    line-height: 1.65;
}
.model-specs { margin: 0; }
.model-specs > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid #eee9e5;
    font-size: 13px;
    line-height: 1.7;
}
.model-specs dt { flex-shrink: 0; color: #625a55; }
.model-specs dd {
    margin: 0;
    text-align: right;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.product-dialog-footer {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 32px;
    border-top: 1px solid #e7e2de;
    background: #fff;
}
.catalog-all-button,
.catalog-back-button,
.catalog-line-button,
.catalog-done-button {
    min-height: 44px;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}
.catalog-all-button,
.catalog-back-button { border: 1px solid #b9aaa0; }
.catalog-all-button:hover,
.catalog-back-button:hover { background: #f7f5f3; }
.catalog-line-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-left: auto;
    background: #06c755;
    color: #07361b;
    white-space: nowrap;
}
.catalog-line-button:hover { background: #00b94f; }
.catalog-line-button i { font-size: 20px; }
.catalog-done-button {
    background: #ed9d2d;
    color: #2b180c;
}
.product-dialog[data-view="line"] .catalog-done-button { margin-left: auto; }
.catalog-done-button:hover { background: #f3ad4a; }
.catalog-line-panel { min-width: 0; margin: 0; padding: 8px 0; text-align: center; }
.catalog-line-panel:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 20px; }
.catalog-line-qr-frame {
    width: 280px;
    max-width: 100%;
    padding: 14px;
    border: 1px solid #e7e2de;
    border-radius: 16px;
    background: #fff;
}
.catalog-line-qr-frame img { display: block; width: 100%; height: auto; }
.catalog-line-caption { margin: 0 0 8px; font-weight: 600; font-size: 17px; }
.catalog-line-context { margin: 0; color: #625a55; font-size: 13px; line-height: 1.8; }
@keyframes catalog-open {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 900px) {
    .catalog-model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .product-dialog { width: calc(100% - 20px); border-radius: 16px; }
    .product-dialog-header { padding: 20px 18px 18px; gap: 12px; }
    #product-dialog-title { font-size: 21px; }
    #product-dialog-description { font-size: 13px; }
    .product-dialog-content { padding: 18px; }
    .catalog-model-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .catalog-model-image { height: 220px; }
    .model-installation { min-height: 0; }
    .product-dialog-footer { flex-wrap: wrap; padding: 14px 18px; gap: 10px; }
    .catalog-all-button,
    .catalog-back-button { flex: 1 1 100%; }
    .catalog-line-button { flex: 1; margin-left: 0; padding: 10px 12px; }
    .catalog-done-button { flex: 1; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .product-dialog[open] { animation: none; }
    .category-details-button,
    .product-category > .category-image { transition: none; }
}
