:root {
  --brand: #1fa4a8;
  --brand-dark: #172d44;
  --brand-soft: #e8f6f5;
  --accent: #dc9d45;
  --ink: #1f2b35;
  --muted: #66737e;
  --line: #dfe6e9;
  --surface: #ffffff;
  --canvas: #f4f7f8;
  --success: #236c4b;
  --warning: #8a5c12;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header { background: var(--surface); padding: 22px clamp(18px, 4vw, 56px) 30px; border-bottom: 1px solid var(--line); }
.brand-block { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--brand-dark); }
.brand-mark { display: grid; place-items: center; width: 66px; height: 54px; border-radius: 10px; background: var(--brand-dark); color: var(--brand); font-size: 1.85rem; font-weight: 900; }
.brand-block strong { display: block; font-size: 1.25rem; line-height: 1; }
.brand-block span:not(.brand-mark) { display: block; color: var(--muted); margin-top: 5px; font-size: .86rem; }
.commercial-summary { margin-top: 24px; text-align: center; }
.commercial-summary p { margin: 0; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; }
.commercial-summary h1 { margin: 5px 0 12px; color: var(--brand-dark); font-size: clamp(1.35rem, 2.7vw, 2rem); }
.chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.chips span { border: 1px solid var(--brand); border-radius: 999px; padding: 5px 12px; color: var(--brand-dark); font-size: .83rem; }

.cart-summary { position: fixed; z-index: 20; top: 18px; right: 22px; display: grid; grid-template-columns: auto auto; gap: 4px 10px; align-items: center; min-width: 180px; padding: 12px; border: 2px solid var(--brand); border-radius: 12px; background: white; color: var(--brand-dark); }
.cart-summary .cart-icon { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.cart-summary .cart-icon svg { width: 24px; height: 24px; }
.cart-summary span { display: flex; flex-direction: column; align-items: flex-start; }
.cart-summary small { color: var(--muted); }
.cart-summary strong { font-size: 1rem; }
.cart-summary b { grid-column: 1 / -1; background: var(--brand); color: white; padding: 7px 10px; border-radius: 7px; font-size: .82rem; }

.catalog { width: min(1500px, calc(100% - 32px)); margin: 28px auto 80px; }
.category { margin: 0 0 42px; }
.category-heading { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; align-items: center; margin-bottom: 20px; padding: 12px 14px; background: var(--brand-soft); }
.category-heading span { grid-column: 1; color: var(--brand-dark); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.category-heading h2 { grid-column: 1; margin: 0; color: var(--brand); font-size: clamp(1.25rem, 2vw, 1.7rem); }
.category-heading::after { content: ""; grid-column: 2; grid-row: 1 / span 2; height: 2px; background: color-mix(in srgb, var(--brand) 45%, white); }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.product-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.product-visual { position: relative; display: grid; place-items: center; min-height: 220px; overflow: hidden; background: var(--brand-soft); }
.product-visual img { width: 100%; height: 260px; object-fit: cover; display: block; transition: transform .3s ease; }
.product-card:hover .product-visual img { transform: scale(1.035); }
.product-visual svg { width: 78px; height: 78px; color: var(--brand); opacity: .72; }
.minimum-badge { position: absolute; left: 10px; top: 10px; border-radius: 7px; padding: 6px 8px; background: #27212a; color: white; font-size: .75rem; }
.image-credit { position: absolute; z-index: 2; right: 8px; bottom: 8px; padding: 4px 7px; border-radius: 6px; background: rgba(23, 45, 68, .86); color: white; font-size: .68rem; text-decoration: none; }
.image-credit:hover { background: var(--brand-dark); text-decoration: underline; }
.product-body { display: flex; flex: 1; flex-direction: column; padding: 15px; }
.product-code { color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.product-card h3 { min-height: 3.6em; margin: 8px 0 14px; color: var(--brand-dark); font-size: .98rem; line-height: 1.25; text-transform: uppercase; }
.product-price { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: auto; padding: 12px; border-radius: 10px; background: #faf9fa; }
.product-price strong { color: var(--brand); font-size: 1.27rem; }
.stock { color: var(--muted); font-size: .75rem; text-align: right; line-height: 1.45; }
.stock b { color: var(--ink); }
.volume-preview { margin: 12px 0 0; color: var(--muted); font-size: .75rem; }
.buy-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin-top: 13px; border: 0; border-radius: 9px; padding: 11px 12px; background: var(--brand); color: white; font-weight: 750; }
.buy-button svg, .button-with-icon svg { flex: 0 0 auto; width: 20px; height: 20px; }
.buy-button > span { display: block; }
.buy-button small { display: block; margin-top: 2px; font-weight: 500; opacity: .86; }

.dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 18px; background: transparent; }
.dialog::backdrop { background: rgba(30, 18, 29, .58); backdrop-filter: blur(3px); }
.dialog-shell { position: relative; margin: 0; border-radius: 18px; overflow: auto; background: white; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-size: 1.55rem; line-height: 1; }
.close-dialog { position: absolute; z-index: 2; top: 14px; right: 14px; }
.product-dialog-grid { display: grid; grid-template-columns: 40% 60%; gap: 0; }
.dialog-visual { display: grid; place-items: center; min-height: 420px; overflow: hidden; background: var(--brand-soft); color: var(--brand); }
.dialog-visual img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; }
.dialog-visual svg { width: 110px; height: 110px; opacity: .72; }
.dialog-content { padding: 40px 34px 24px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.dialog-content h2 { margin: 0 45px 22px 0; color: var(--brand-dark); font-size: 1.25rem; line-height: 1.25; }
.price-block { display: flex; flex-direction: column; margin-bottom: 16px; }
.price-block small { color: var(--muted); }
.price-block strong { color: var(--brand); font-size: 1.7rem; }
.tier-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tier { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .72rem; }
.tier.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.field-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .85rem; }
.quantity-control { display: grid; grid-template-columns: 42px 80px 42px; width: max-content; }
.quantity-control button, .quantity-control input { height: 42px; border: 1px solid var(--line); background: white; text-align: center; }
.quantity-control button:first-child { border-radius: 8px 0 0 8px; }
.quantity-control button:last-child { border-radius: 0 8px 8px 0; }
.quantity-control input { width: 80px; border-left: 0; border-right: 0; }
.helper { display: block; margin: 6px 0; color: var(--muted); }
.availability { display: inline-block; margin: 3px 0 16px; padding: 5px 8px; border-radius: 7px; background: #e9f5ef; color: var(--success); font-size: .76rem; }
.availability.warning { background: #fff3d8; color: var(--warning); }
.subtotal { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
.subtotal strong { color: var(--brand); font-size: 1.3rem; }
.commercial-info { padding: 18px 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.commercial-info strong { color: var(--ink); }
.commercial-info p { margin: 5px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 34px 28px; }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 9px; padding: 10px 16px; font-weight: 750; }
.button.primary { background: var(--brand); color: white; }
.button-with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.success { background: var(--success); color: white; }

.cart-dialog { width: min(1180px, calc(100% - 24px)); }
.cart-shell { max-height: calc(100vh - 32px); }
.cart-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; background: var(--brand-dark); color: white; }
.cart-header .eyebrow { color: #ead9e7; }
.cart-header h2 { margin: 0; }
.cart-content { padding: 24px 26px; }
.empty-cart { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-cart strong { display: block; margin-bottom: 7px; color: var(--brand-dark); font-size: 1.25rem; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { padding: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .78rem; text-align: left; }
.cart-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-product { display: flex; flex-direction: column; gap: 3px; }
.cart-product small { color: var(--muted); }
.cart-qty { display: flex; align-items: center; gap: 6px; }
.cart-qty button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.cart-qty span { min-width: 40px; text-align: center; }
.remove-item { border: 0; background: transparent; color: #a12d3b; text-decoration: underline; }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 10px 0; }
.cart-total-row strong { color: var(--brand); font-size: 1.55rem; }
.clear-cart { border: 0; background: transparent; color: #a12d3b; text-decoration: underline; }
.checkout-panel { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 12px; align-items: end; padding: 20px 26px 26px; border-top: 1px solid var(--line); background: #faf9fa; }
.checkout-panel h3 { margin: 0 0 4px; font-size: 1rem; }
.checkout-panel p { margin: 0; color: var(--muted); font-size: .8rem; }
.checkout-panel label { color: var(--muted); font-size: .78rem; }
.checkout-panel input { display: block; width: 100%; height: 42px; margin-top: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: white; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translate(-50%, 20px); min-width: min(420px, calc(100% - 32px)); padding: 13px 18px; border-radius: 10px; background: #27212a; color: white; text-align: center; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.site-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; padding: 26px 20px 100px; border-top: 1px solid var(--line); background: var(--brand-dark); color: #dce8ed; font-size: .82rem; }
.site-footer strong { color: white; }
.site-footer details { width: min(900px, 100%); text-align: center; }
.site-footer summary { cursor: pointer; color: white; font-weight: 700; }
.credit-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 18px; margin-top: 12px; text-align: left; }
.credit-list a { color: #9ee2df; }

@media (max-width: 1050px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .checkout-panel { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .site-header { padding-top: 18px; }
  .brand-block { justify-content: flex-start; padding-right: 125px; }
  .cart-summary { top: 12px; right: 12px; min-width: 148px; grid-template-columns: 30px auto; padding: 9px; }
  .cart-summary .cart-icon { width: 30px; height: 30px; }
  .cart-summary .cart-icon svg { width: 21px; height: 21px; }
  .cart-summary span { align-items: center; }
  .cart-summary b { font-size: .75rem; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .product-visual { min-height: 180px; }
  .product-dialog-grid { grid-template-columns: 1fr; }
  .dialog-visual, .dialog-visual img { min-height: 220px; max-height: 300px; }
  .dialog-content { padding: 28px 22px 20px; }
  .commercial-info, .dialog-actions { padding-left: 22px; padding-right: 22px; }
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; }
  .cart-table tr { position: relative; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .cart-table td { padding: 5px 0; border: 0; }
  .cart-table td:last-child { position: absolute; right: 0; top: 8px; }
  .checkout-panel { grid-template-columns: 1fr; }
  .credit-list { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .catalog { width: min(100% - 20px, 1500px); }
  .product-grid { grid-template-columns: 1fr; }
  .product-card h3 { min-height: 0; }
  .product-visual { min-height: 230px; }
  .brand-block strong { font-size: 1rem; }
  .brand-mark { width: 50px; height: 44px; font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
