.catalog-page {
    min-height: 70vh;
    padding: 44px 20px 72px;
    background: #f8f5ef;
    color: #332c28;
}

.catalog-page__header { margin-bottom: 28px; }

.catalog-page__header h1 {
    margin: 4px 0 10px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
}

.catalog-page__header p:last-child { max-width: 760px; line-height: 1.6; }
.catalog-browser { min-height: 280px; }
.catalog-controls {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.catalog-controls label {
    display: grid;
    gap: 6px;
    color: #625851;
    font-size: .88rem;
    font-weight: 700;
}

.catalog-sort {
    min-width: 220px;
    padding: 10px 34px 10px 12px;
    border: 1px solid #b9aea4;
    border-radius: 4px;
    background: #fff;
    color: #332c28;
    font: inherit;
}

.catalog-search {
    display: flex;
    min-width: 0;
    flex: 1 1 620px;
    align-items: end;
    gap: 8px;
}

.catalog-search__label { flex: 1 1 320px; }

.catalog-search__input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #b9aea4;
    border-radius: 4px;
    background: #fff;
    color: #332c28;
    font: inherit;
}

.catalog-search__input:focus,
.catalog-sort:focus { outline: 3px solid rgba(43, 110, 104, .24); outline-offset: 1px; }

.catalog-search__actions { display: flex; gap: 8px; }

.catalog-summary { margin: 0 0 14px; color: #625851; font-weight: 700; }

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: 18px;
}

.catalog-product {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 16px;
    border: 1px solid #ded5cc;
    border-radius: 8px;
    background: #fff;
}

.catalog-product__image,
.catalog-detail__image { width: 100%; object-fit: contain; background: #fff; }
.catalog-product__image { aspect-ratio: 1; }

.catalog-product__brand {
    margin: 14px 0 4px;
    color: #75685f;
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.catalog-product h2,
.catalog-detail h2 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.08rem;
    line-height: 1.3;
}

.catalog-product__meta { min-height: 1.25em; margin: 6px 0; color: #6e635c; }

.catalog-product__price {
    margin: auto 0 14px;
    padding-top: 12px;
    color: #2b6e68;
    font-size: 1.18rem;
    font-weight: 800;
}

.catalog-product__actions,
.catalog-detail__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-product__actions .button,
.catalog-detail__actions .button { flex: 1 1 150px; }

.catalog-browser .button {
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid #654a36;
    border-radius: 6px;
    background: #654a36;
    color: #fffaf3;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.catalog-browser .button:hover { background: #493422; }
.catalog-browser .button.secondary { border-color: #b9aea4; background: #fff; color: #4e392a; }
.catalog-browser .button.secondary:hover { background: #eee7df; }
.catalog-browser .button:disabled { cursor: default; opacity: .55; }

.catalog-detail {
    display: grid;
    grid-template-columns: minmax(220px, 420px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    padding: 18px;
    border: 1px solid #ded5cc;
    border-radius: 8px;
    background: #fff;
}

.catalog-detail__description { max-width: 72ch; line-height: 1.65; white-space: pre-line; }
.catalog-state { padding: 40px 20px; text-align: center; }
.catalog-state--error { color: #9b2f2f; }

.catalog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
}

.site-cart-dialog {
    width: min(calc(100% - 32px), 780px);
    max-height: min(84vh, 760px);
    padding: 0;
    border: 1px solid #cdbfb2;
    border-radius: 8px;
    background: #fffdf9;
    color: #332c28;
    box-shadow: 0 18px 60px rgba(43, 32, 24, .28);
}

.site-cart-dialog::backdrop {
    background: rgba(34, 27, 22, .55);
}

.site-cart-dialog__header {
    position: sticky;
    z-index: 1;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 1px solid #ded5cc;
    background: #fffdf9;
}

.site-cart-dialog__header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.site-cart-dialog__close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 0;
    background: transparent;
    color: #4e392a;
    font: inherit;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.site-cart-dialog__close:hover,
.site-cart-dialog__close:focus-visible {
    background: #eee7df;
}

.site-cart-dialog__content {
    padding: 18px 20px 22px;
    overflow-y: auto;
}

.site-cart-dialog__intro,
.site-cart-dialog__empty,
.site-cart-dialog__disclosure {
    margin: 0;
    line-height: 1.55;
}

.site-cart-dialog__empty {
    padding: 30px 0;
    color: #625851;
}

.site-cart-dialog__disclosure {
    margin-top: 18px;
    color: #625851;
    font-size: .86rem;
}

.site-cart-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.site-cart-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) minmax(170px, auto);
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid #ded5cc;
    border-radius: 8px;
    background: #fff;
}

.site-cart-item__image {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.site-cart-item__description {
    min-width: 0;
}

.site-cart-item__description h3 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1rem;
    line-height: 1.3;
}

.site-cart-item__meta {
    margin: 6px 0;
    color: #6e635c;
    font-size: .86rem;
}

.site-cart-item__price {
    margin: 0;
    color: #2b6e68;
    font-weight: 800;
}

.site-cart-item__actions {
    display: grid;
    gap: 8px;
}

.site-cart-item__partner,
.site-cart-item__remove {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid #654a36;
    border-radius: 6px;
    font: inherit;
    font-size: .86rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.site-cart-item__partner {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #654a36;
    color: #fffaf3;
}

.site-cart-item__remove {
    background: #fff;
    color: #4e392a;
}

.site-cart-item__partner:hover { background: #493422; }
.site-cart-item__remove:hover { background: #eee7df; }

.shelf-dialog .catalog-browser {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: min(68vh, 720px);
    overflow-x: clip;
    overflow-y: auto;
    padding: 2px 2px 12px;
}

.shelf-dialog .catalog-controls { justify-content: flex-end; }

.shelf-dialog .catalog-content,
.shelf-dialog .catalog-grid { min-width: 0; max-width: 100%; }

.shelf-dialog .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: 12px;
}

.shelf-dialog .catalog-product { padding: 10px; }
.shelf-dialog .catalog-product__image { max-height: 170px; }
.shelf-dialog .catalog-product__brand { margin-top: 9px; font-size: .72rem; }
.shelf-dialog .catalog-product h2 { font-size: .95rem; }
.shelf-dialog .catalog-product__meta { margin: 4px 0; font-size: .82rem; }
.shelf-dialog .catalog-product__price { padding-top: 7px; font-size: 1.02rem; }
.shelf-dialog .catalog-product__actions { gap: 6px; }
.shelf-dialog .catalog-product__actions .button {
    flex-basis: 100%;
    min-height: 38px;
    padding: 8px 9px;
    font-size: .78rem;
}

@media (max-width: 700px) {
    .catalog-page { padding: 28px 14px 54px; }
    .catalog-controls, .catalog-search { align-items: stretch; flex-direction: column; }
    .catalog-controls label, .catalog-sort { width: 100%; }
    .catalog-search { flex-basis: auto; }
    .catalog-search__label { flex-basis: auto; }
    .catalog-search__actions .button { flex: 1; }
    .catalog-detail { grid-template-columns: 1fr; padding: 12px; }
    .shelf-dialog .catalog-browser { width: 100%; }
    .site-cart-dialog { width: min(calc(100% - 20px), 780px); }
    .site-cart-dialog__header { padding: 14px; }
    .site-cart-dialog__content { padding: 14px; }
    .site-cart-item { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
    .site-cart-item__image { width: 76px; height: 76px; }
    .site-cart-item__actions { grid-column: 1 / -1; grid-template-columns: 1fr auto; }
}
