/* Catalog */
.header-cart { display: flex; align-items: center; gap: 8px; padding-left: 16px; border-left: 1px solid var(--border); }
.header-cart .icon { width: 18px; height: 18px; }
.cart-count { min-width: 24px; height: 24px; padding-inline: 4px; display: grid; place-items: center; border-radius: 5px; background: var(--secondary); color: var(--primary); font-size: 11px; font-variant-numeric: tabular-nums; }
.catalog-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin: -8px 0 var(--section-gap); color: var(--muted-foreground); font-size: 12px; }
.catalog-summary > span { display: flex; align-items: center; gap: 6px; }
.catalog-summary strong { color: var(--foreground); font-weight: 500; }
.catalog-summary .icon { display: none; }
.catalog-summary i { height: 12px; border-left: 1px solid var(--border); }
.catalog-summary > small { margin-left: auto; font-size: 12px; }
.catalog-filter { padding: var(--panel-padding); margin-bottom: var(--section-gap); }
.catalog-search { display: flex; gap: 10px; }
.search-field { position: relative; flex: 1; margin: 0; }
.search-field > .icon { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--muted-foreground); }
.search-field input { margin: 0; padding-left: 36px; height: var(--control-height); }
.catalog-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.catalog-filter-row > label { margin: 0; }
.catalog-filter-row select { margin: 0; width: 160px; min-height: 36px; height: 36px; padding: 6px 10px; font-size: 12px; }
.catalog-filter-row .check { font-size: 12px; gap: 8px; }
.filter-divider { height: 20px; border-left: 1px solid var(--border); }
.reset-link { color: var(--muted-foreground); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.results-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; color: var(--muted-foreground); font-size: 12px; }
.results-heading strong { color: var(--foreground); }
.results-heading > span { display: flex; align-items: center; gap: 5px; }
.view-indicator { display: none; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,260px),1fr)); gap: var(--section-gap); }
.product-card { min-width: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--panel-shadow); overflow: hidden; transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease); }
.product-card:focus-within { border-color: var(--ring); box-shadow: var(--hover-shadow); }
.product-visual { display: block; position: relative; aspect-ratio: 4/3; background: var(--muted); border-bottom: 1px solid var(--border); overflow: hidden; }
.product-visual > img { width: 100%; height: 100%; padding: 20px; object-fit: contain; background: #fff; }
.product-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; background: var(--sidebar); color: var(--muted-foreground); }
.product-placeholder > .icon { width: 32px; height: 32px; stroke-width: 1.1; opacity: .4; }
.product-placeholder > span { font-size: 11px; }
.stock-badge { position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); color: var(--muted-foreground); font-size: 10px; line-height: 1.4; }
.stock-badge.out { color: var(--warning); }
.product-open { position: absolute; bottom: 12px; right: 12px; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 5px; background: var(--card); opacity: 0; transform: translateY(3px); transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.product-open .icon { width: 14px; height: 14px; }
.product-card:hover .product-open, .product-card:focus-within .product-open { opacity: 1; transform: translateY(0); }
.product-info { display: flex; flex: 1; flex-direction: column; padding: clamp(16px, 1.4vw, 20px); }
.product-meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 11px; color: var(--muted-foreground); }
.product-meta small { font-size: 11px; }
.product-info h2 { min-height: 42px; font-size: 14px; font-weight: 500; line-height: 1.5; letter-spacing: -.015em; overflow-wrap: anywhere; }
.product-info h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.product-ean { margin-top: 8px; color: var(--muted-foreground); font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: .1px; }
.product-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: auto 0 16px; padding-top: 20px; color: var(--foreground); font-size: 21px; font-weight: 500; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.product-price small { font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--muted-foreground); }
.order-options { display: flex; align-items: stretch; gap: 8px; }
.quantity-control { display: flex; align-items: center; width: 92px; height: 36px; flex-shrink: 0; border: 1px solid var(--input); border-radius: 5px; background: var(--card); }
.quantity-control button { width: 28px; height: 100%; padding: 0; flex-shrink: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted-foreground); font-size: 16px; }
.quantity-control button:hover { background: var(--muted); color: var(--foreground); }
.quantity-control input { flex: 1; width: 32px; min-width: 0; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: center; font-size: 12px; box-shadow: none; appearance: textfield; -moz-appearance: textfield; }
.quantity-control:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb,var(--ring) 12%,transparent); }
.quantity-control input::-webkit-inner-spin-button, .quantity-control input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.order-options select { flex: 1; min-width: 0; margin: 0; padding: 5px 7px; min-height: 36px; height: 36px; font-size: 11px; box-shadow: none; }
.add-button { width: 100%; margin-top: 10px; min-height: 36px; font-size: 12px; }
.add-button .icon { width: 14px; height: 14px; }
.add-button[data-added] { color: var(--success); background: var(--success-bg); border-color: color-mix(in srgb,var(--success) 24%,var(--border)); opacity: 1; cursor: default; }
.add-feedback { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--destructive); }
.cart-toast { position: fixed; z-index: 40; right: var(--page-gutter); bottom: max(24px,env(safe-area-inset-bottom)); width: min(400px,calc(100% - 32px)); display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--foreground); box-shadow: var(--hover-shadow); animation: toast-enter 180ms var(--ease); }
.cart-toast > .icon { margin-top: 2px; color: var(--success); }
.cart-toast > div { flex: 1; min-width: 0; }
.cart-toast p { font-size: 13px; line-height: 1.5; color: var(--foreground); overflow-wrap: anywhere; }
.cart-toast a { display: inline-block; margin-top: 8px; color: var(--primary); font-size: 12px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.cart-toast .icon-button { margin-top: -5px; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.add-form > label { margin-top: 16px; }
.pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin: 24px 0; color: var(--muted-foreground); font-size: 12px; }
.pagination > div { display: flex; align-items: center; gap: 6px; }
.pagination .button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.disabled { opacity: .4; }
.empty-state { padding: 56px 24px; text-align: center; grid-column: 1/-1; }
.empty-state > .icon { width: 28px; height: 28px; margin-bottom: 16px; color: var(--muted-foreground); }
.empty-state h2 { font-size: 16px; font-weight: 500; }
.empty-state p { margin: 8px auto 20px; max-width: 360px; font-size: 13px; white-space: normal; }
.compact-empty { padding: 40px 24px; }

/* Product detail and management */
.product-detail-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: clamp(28px, 3vw, 56px); margin: 0 0 var(--section-gap); }
.detail-image { height: 420px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--sidebar); overflow: hidden; }
.detail-image > img { width: 100%; height: 100%; padding: 32px; object-fit: contain; background: #fff; }
.detail-image .product-placeholder > .icon { width: 48px; height: 48px; }
.thumbnails { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumbnail { width: 64px; height: 64px; padding: 5px; border: 1px solid var(--border); border-radius: 5px; background: #fff; }
.thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.thumbnail:hover, .thumbnail[aria-pressed="true"] { border-color: var(--primary); }
.product-detail-info { padding-top: 8px; }
.product-detail-info h1 { margin: 16px 0 12px; line-height: 1.35; }
.product-detail-info > p { max-width: 65ch; font-size: 13px; line-height: 1.7; margin-bottom: 16px; text-wrap: pretty; }
.detail-price { margin: 24px 0 20px; font-size: 32px; font-weight: 500; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.detail-price small { display: block; margin-top: 6px; color: var(--muted-foreground); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.detail-order { max-width: 380px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.detail-order h2 { font-size: 13px; margin-bottom: 12px; }
.detail-order .quantity-control, .detail-order select { height: 40px; }
.detail-order .add-button { min-height: 40px; }
.detail-help { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.detail-help .icon { width: 16px; height: 16px; }
.spec-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px; padding: 0 var(--panel-padding) var(--panel-padding); }
.spec-grid h3 { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
.spec-grid dl { display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; margin: 0; font-size: 12px; }
.spec-grid dt { color: var(--muted-foreground); }
.spec-grid dd { margin: 0; overflow-wrap: anywhere; }
.table-product-image { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 5px; background: var(--sidebar); overflow: hidden; }
.table-product-image img { width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; }
.table-product-image .icon { width: 18px; height: 18px; opacity: .5; }
.collection-list { padding: 0 var(--panel-padding) 8px; }
.collection-list a { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); }
.collection-list strong { font-size: 13px; font-weight: 500; }
.collection-list small { margin-left: auto; color: var(--muted-foreground); font-size: 12px; }
.collection-list a > .icon { width: 13px; height: 13px; color: var(--muted-foreground); }
.collection-list a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.collection-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--section-gap); }
.collection-cards .panel { margin-bottom: 0; }
.spaced { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
.three-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.narrow-panel { max-width: 640px; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 24px; }
.photo-grid article { width: 176px; }
.photo-grid img { display: block; width: 100%; height: 152px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 6px; object-fit: contain; background: #fff; }
.price-input { width: 136px; min-height: 34px; height: 34px; margin: 0; font-variant-numeric: tabular-nums; }

/* Cart and checkout */
.checkout-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,400px); gap: var(--section-gap); align-items: start; }
.checkout-grid > aside { position: sticky; top: 84px; }
.cart-line { padding: var(--panel-padding); border-top: 1px solid var(--border); }
.cart-product { display: flex; align-items: center; gap: 16px; }
.cart-product > img, .cart-placeholder { width: 64px; height: 64px; flex-shrink: 0; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; object-fit: contain; }
.cart-placeholder { display: grid; place-items: center; background: var(--sidebar); color: var(--muted-foreground); }
.cart-product > div { min-width: 0; }
.cart-product strong { font-size: 13px; }
.cart-product p, .cart-product small { font-size: 11px; color: var(--muted-foreground); margin-top: 4px; }
.line-total { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cart-update { display: flex; align-items: flex-end; gap: 10px; margin-top: 20px; }
.cart-update label { width: 76px; margin: 0; }
.cart-update .line-note { flex: 1; }
.cart-update .icon-button { margin-bottom: 3px; }
.order-summary { padding: var(--panel-padding); }
.order-summary h2 { margin-bottom: 24px; }
.summary-row { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; font-size: 13px; color: var(--muted-foreground); }
.summary-row strong { color: var(--foreground); }
.summary-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; }
.summary-total strong { font-size: 26px; font-weight: 500; letter-spacing: -.7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-summary > p { margin: 16px 0 24px; font-size: 12px; }
.order-summary > .button { width: 100%; padding-left: 10px; padding-right: 10px; }
.checkout-caption { display: flex; align-items: flex-start; gap: 6px; margin-top: 16px; color: var(--muted-foreground); font-size: 11px; }
.checkout-caption .icon { width: 13px; height: 16px; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 24px; font-size: 12px; }
.login-options .check { margin: 0; font-size: 12px; }
.login-options a:hover { text-decoration: underline; text-underline-offset: 3px; }
.form-body > .invitation-hint { margin-top: 20px; }
.invitation-actions { margin-top: 24px; }
.login-form #password-help { margin: -12px 0 20px; }

@media (max-width: 1380px) {
    .catalog-filter-row { gap: 10px; }
    .catalog-filter-row select { width: 146px; }
    .filter-divider { display: none; }
}
@media (max-width: 1100px) {
    .catalog-summary > small { display: none; }
    .checkout-grid { grid-template-columns: minmax(0,1fr); }
    .checkout-grid > aside { position: static; }
    .collection-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .spec-grid { gap: 20px; }
}
@media (max-width: 1000px) {
    .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .product-detail-grid { grid-template-columns: minmax(0,1fr); }
    .detail-image { height: 380px; }
    .spec-grid { grid-template-columns: minmax(0,1fr); }
    .spec-grid dl { grid-template-columns: 1fr 2fr; }
}
@media (max-width: 760px) {
    .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
    .product-visual { aspect-ratio: 1; }
    .header-cart { padding-left: 12px; gap: 6px; }
    .catalog-filter-row > label:not(.check) { flex: 1; min-width: 0; }
    .catalog-filter-row select { width: 100%; font-size: 14px; height: 40px; }
    .quantity-control { height: 40px; }
    .quantity-control input { font-size: 16px; }
    .order-options select { font-size: 14px; height: 40px; }
    .add-button { min-height: 40px; }
    .collection-cards { grid-template-columns: minmax(0,1fr); }
}
@media (hover: hover) and (pointer: fine) {
    .product-card:hover { border-color: color-mix(in srgb,var(--foreground) 18%,var(--border)); box-shadow: var(--hover-shadow); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .product-card:hover { transform: translateY(-2px); }
}
@media (hover: none) {
    .product-open { opacity: 1; transform: none; }
}
@media (max-width: 480px) {
    .catalog-summary { gap: 12px; font-size: 11px; margin-top: 0; }
    .catalog-summary i { display: none; }
    .catalog-filter { padding: 16px; }
    .catalog-search .button { padding: 8px 12px; }
    .catalog-search .button .icon { display: none; }
    .catalog-filter-row { gap: 12px; }
    .catalog-filter-row > label:not(.check) { flex-basis: 100%; }
    .catalog-filter-row .check { font-size: 12px; }
    .product-grid { gap: 12px; }
    .product-info { padding: 12px; }
    .product-info h2 { min-height: 60px; font-size: 12px; }
    .product-price { font-size: 20px; padding-top: 16px; }
    .product-price small { font-size: 10px; }
    .product-meta { font-size: 10px; }
    .product-meta small { display: none; }
    .product-ean { font-size: 9px; letter-spacing: 0; }
    .stock-badge { top: 8px; left: 8px; padding: 3px 5px; font-size: 9px; }
    .product-placeholder > span { font-size: 10px; }
    .order-options { flex-direction: column; }
    .quantity-control { width: 100%; }
    .quantity-control button { width: 34px; }
    .order-options select { flex: auto; width: 100%; }
    .add-button { font-size: 12px; padding: 8px; }
    .pagination { flex-direction: column; align-items: flex-start; }
    .pagination > div { flex-wrap: wrap; }
    .detail-image { height: 300px; }
    .detail-order .order-options { flex-direction: row; }
    .detail-order .quantity-control { width: 110px; }
    .detail-order .order-options select { flex: 1; }
    .three-stats .stat { padding: 16px 12px; }
    .three-stats .stat-top { font-size: 10px; }
    .three-stats .stat-value { font-size: 26px; }
    .cart-product { flex-wrap: wrap; gap: 12px; }
    .cart-product > div { flex: 1; min-width: 160px; }
    .line-total { margin-left: 76px; }
    .cart-update { flex-wrap: wrap; }
    .cart-update .line-note { min-width: 180px; }
}
