.product-card,
.highlight-item { cursor: pointer; }

.product-name-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-align: inherit;
}

.product-name-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }

.product-modal {
    width: min(560px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 23px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.product-modal::backdrop { background: rgba(8, 14, 25, .6); backdrop-filter: blur(4px); }
.product-modal-shell { display: flex; flex-direction: column; max-height: calc(100vh - 26px); max-height: calc(100dvh - 26px); }
.product-modal-header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 18px 24px; border-bottom: 1px solid var(--line); }
.product-modal-header h2 { margin: 0; font-size: 1.18rem; line-height: 1.4; letter-spacing: -.025em; }
.product-modal-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: var(--soft); color: var(--ink); }
.product-modal-form { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.product-modal-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.product-modal-art { display: grid; place-items: center; height: 250px; padding: 18px; background: #fff; }
.product-modal-art .product-art { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; background-color: #fff; }
.product-modal-art .product-art img { width: 100%; height: 100%; min-width: 0; min-height: 0; max-height: 100%; object-fit: contain; }
.product-modal-art .product-art.sprite-art { width: 214px; height: 214px; max-width: 100%; aspect-ratio: 1; }
.product-modal-art .product-art span { font-size: 5rem; }
.product-modal-information { padding: 20px 24px 24px; }
.product-modal-category { display: block; margin-bottom: 10px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.product-modal-prices { margin-bottom: 14px; }
.product-modal-prices del { display: block; color: var(--muted); font-size: .86rem; }
.product-modal-prices strong { font: 850 1.9rem Manrope, 'DM Sans', Arial, sans-serif; letter-spacing: -.04em; }
.product-modal-prices small { margin-left: 7px; color: var(--muted); font-size: .86rem; }
.product-modal-prices.has-offer strong { color: #d51d34; }
.product-modal-information p { margin: 0 0 13px; color: var(--muted); font-size: .85rem; line-height: 1.6; }
.product-modal-information .product-modal-barcode { margin-bottom: 20px; font-size: .75rem; overflow-wrap: anywhere; }
.product-modal-quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; }
.product-modal-quantity-row label { margin: 0; font-size: .9rem; }
.product-modal-quantity-row label small { display: block; margin: 3px 0 0; color: var(--muted); font-size: .75rem; font-weight: 400; }
.product-quantity { display: flex; align-items: center; flex: none; padding: 3px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.product-quantity button { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 10px; background: var(--soft); color: var(--ink); touch-action: manipulation; }
#product-modal-quantity { display: block; width: 62px; height: 42px; margin: 0; padding: 4px; border: 0; border-radius: 0; background: transparent; color: var(--ink); text-align: center; font-size: .95rem; font-weight: 800; -moz-appearance: textfield; }
#product-modal-quantity::-webkit-inner-spin-button,
#product-modal-quantity::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.product-modal-information .product-modal-error { margin: 12px 0 0; color: #c51631; font-size: .78rem; }
.product-modal-footer { display: flex; flex: none; flex-direction: column; gap: 12px; padding: 18px 24px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.product-modal-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-modal-total span { color: var(--muted); font-size: .82rem; }
.product-modal-total strong { font-size: 1.25rem; white-space: nowrap; }
.product-modal-add { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 50px; padding: 13px 16px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: .9rem; font-weight: 800; touch-action: manipulation; }
.product-modal button:disabled { opacity: .45; cursor: not-allowed; }
.product-modal button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
html[data-theme="dark"] .product-modal-category { color: var(--accent-text); }
html[data-theme="dark"] .product-modal-art .product-art { background-color: #fff; }
html[data-theme="dark"] .product-modal-prices.has-offer strong { color: #ff6677; }
html[data-theme="dark"] .product-modal-information .product-modal-error { color: #ff8090; }

@media (hover: hover) and (pointer: fine) {
    .product-name-button:hover { text-decoration: underline; text-underline-offset: 3px; }
    .product-modal button:not(:disabled):hover { filter: brightness(.93); }
}

@media (max-width: 600px) {
    .product-modal { border-radius: 19px; }
    .product-modal-header { padding: 13px 12px 13px 18px; gap: 10px; }
    .product-modal-header h2 { font-size: 1.04rem; }
    .product-modal-art { height: 215px; padding: 14px; }
    .product-modal-art .product-art.sprite-art { width: 187px; height: 187px; }
    .product-modal-information { padding: 17px 18px 20px; }
    .product-modal-footer { padding: 15px 18px max(18px, env(safe-area-inset-bottom)); }
    .product-modal-prices strong { font-size: 1.65rem; }
    .product-modal-quantity-row { gap: 10px; }
}
