.commerce-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.commerce-product-card,
.commerce-cart-line,
.commerce-summary,
.commerce-empty,
.commerce-alert {
  border: 1px solid #dbe5ef;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 12px 32px rgba(13, 47, 79, .07);
}

.commerce-product-card {
  display: flex;
  min-height: 18rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem;
}

.commerce-product-card__image,
.commerce-product-card__image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 1rem;
  border-radius: 1rem;
  background: #eef4f8;
  object-fit: cover;
}

.commerce-product-card__image-placeholder {
  display: grid;
  place-items: center;
  color: #8aa0b5;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: .2em;
}

.commerce-product-card h2,
.commerce-cart-line h2,
.commerce-summary h2,
.commerce-empty h2 {
  margin: .35rem 0;
  color: #0d2f4f;
  font-size: 1.15rem;
  font-weight: 900;
}

.commerce-product-card__sku,
.commerce-label {
  color: #167049;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.commerce-product-card__description,
.commerce-product-card small,
.commerce-cart-line p,
.commerce-summary p,
.commerce-empty p {
  color: #5f7185;
  font-size: .84rem;
  line-height: 1.55;
}

.commerce-product-card__footer {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid #edf2f7;
}

.commerce-product-card__footer strong,
.commerce-product-card__footer small {
  display: block;
}

.commerce-product-card__footer strong {
  margin-top: .3rem;
  color: #0d2f4f;
  font-size: 1.1rem;
}

.commerce-add-form,
.commerce-cart-line__actions {
  display: grid;
  gap: .6rem;
}

.commerce-add-form label,
.commerce-cart-line__actions label {
  color: #30475f;
  font-size: .75rem;
  font-weight: 800;
}

.commerce-quantity-input {
  width: 5.2rem;
  border: 1px solid #b9c8d7;
  border-radius: .7rem;
  background: #fff;
  padding: .65rem .75rem;
  color: #0d2f4f;
  font-weight: 800;
}

.commerce-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid transparent;
  border-radius: .8rem;
  background: #178b57;
  padding: .75rem 1rem;
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 .55rem 1.1rem rgba(23, 139, 87, .16);
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.commerce-button:hover { transform: translateY(-1px); box-shadow: 0 .75rem 1.35rem rgba(13,47,79,.18); }
.commerce-button:disabled,[aria-busy="true"].commerce-button { opacity:.62; cursor:wait; transform:none; }
.commerce-button svg,.commerce-link-danger svg { width:1.05rem; height:1.05rem; flex:none; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }

.commerce-button--secondary { background: #1f68ad; }
.commerce-button--checkout { width:100%; margin-top:.5rem; text-decoration:none; }
.commerce-button--outline { width:100%; margin-top:.7rem; border-color:#91a9be; background:#fff; color:#173653; text-decoration:none; box-shadow:none; }
.commerce-button--danger-outline { border-color:#e4a4aa; background:#fff; color:#922d38; box-shadow:none; }
.commerce-button--disabled { width:100%; background:#8797a6; cursor:not-allowed; }
.commerce-cart-page { min-height:65vh; padding:clamp(3rem,7vw,6rem) 0; background:#eef2f6; }
.commerce-cart-heading { margin-bottom:2.2rem; text-align:center; }
.commerce-cart-heading h1 { margin:.4rem 0; color:#0d2f4f; font-size:clamp(2.3rem,5vw,4rem); font-weight:900; letter-spacing:-.04em; }
.commerce-cart-heading>p:last-child { color:#5f7185; }
.commerce-empty { max-width:48rem; margin:auto; padding:clamp(3rem,8vw,6rem); }
.commerce-empty__icon { display:grid; width:6rem; height:6rem; margin:0 auto 1rem; place-items:center; border-radius:50%; background:#e7f5ee; font-size:2.4rem; }
.commerce-button--danger { width: 100%; background: #9f2f39; }
.commerce-cart-layout { display: grid; gap: 1.25rem; }
.commerce-cart-lines { display: grid; gap: .9rem; }

.commerce-cart-line {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.15rem;
}
.commerce-cart-line__image { width:7rem; aspect-ratio:4/3; border-radius:.8rem; background:#edf3f7; object-fit:cover; }
.commerce-cart-line__image--placeholder { display:grid; place-items:center; color:#8aa0b5; font-weight:900; letter-spacing:.15em; }
.commerce-cart-line__product h2 a { color:inherit; text-decoration:none; }
.commerce-checkout-blocked { border-radius:.8rem; background:#fff0cf; padding:.8rem; color:#714913 !important; }

.commerce-cart-line--unavailable { border-color: #d99b9b; background: #fffafa; }
.commerce-inline-form { display: flex; flex-wrap: wrap; gap: .5rem; }
.commerce-link-danger { display:inline-flex; align-items:center; gap:.4rem; border:1px solid #efc4c8; border-radius:.65rem; background:#fff7f7; padding:.55rem .7rem; color:#9f2f39; font-size:.78rem; font-weight:900; cursor:pointer; text-align:left; }
.commerce-confirm-dialog { position:fixed; inset:0; width:min(29rem, calc(100vw - 2rem)); max-height:calc(100vh - 2rem); margin:auto; padding:0; overflow:auto; border:1px solid #e5c1c5; border-radius:1.25rem; background:#fff; color:#0d2f4f; box-shadow:0 24px 70px rgba(7, 29, 50, .3); }
.commerce-confirm-dialog::backdrop { background:rgba(5, 25, 44, .68); backdrop-filter:blur(3px); }
.commerce-confirm-dialog__content { display:grid; gap:1rem; padding:1.5rem; }
.commerce-confirm-dialog__icon { display:grid; width:2.75rem; height:2.75rem; place-items:center; border-radius:50%; background:#fee2e2; color:#991b1b; font-size:1.25rem; font-weight:900; }
.commerce-confirm-dialog h2 { margin:0; color:#0d2f4f; font-size:1.3rem; font-weight:900; }
.commerce-confirm-dialog p { margin:0; color:#425a70; line-height:1.5; overflow-wrap:anywhere; }
.commerce-confirm-dialog p.commerce-confirm-dialog__countdown { border-radius:.75rem; background:#fff5de; padding:.7rem .85rem; color:#75500d; font-size:.85rem; font-weight:800; }
.commerce-confirm-dialog__actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:.65rem; padding-top:.35rem; }
.commerce-confirm-dialog__actions button { min-height:2.75rem; border-radius:.7rem; padding:.6rem 1rem; font:inherit; font-size:.83rem; font-weight:800; cursor:pointer; }
.commerce-confirm-dialog__cancel { border:1px solid #b9c8d7; background:#fff; color:#0d2f4f; }
.commerce-confirm-dialog__accept { border:1px solid #a42c39; background:#a42c39; color:#fff; }
.commerce-confirm-dialog__accept:disabled { border-color:#c9d2da; background:#e5eaf0; color:#66798a; cursor:not-allowed; }
.commerce-confirm-dialog__actions button:focus-visible { outline:3px solid #168b57; outline-offset:2px; }
.commerce-cart-line__subtotal { min-width: 9rem; text-align: right; }
.commerce-cart-line__subtotal span { display: block; color: #718096; font-size: .72rem; font-weight: 800; }
.commerce-cart-line__subtotal strong { color: #0d2f4f; }
.commerce-status { display: inline-flex; margin-top: .45rem; border-radius: 999px; padding: .25rem .6rem; font-size: .68rem; font-weight: 900; }
.commerce-status--available { background: #dff5e9; color: #11633f; }
.commerce-status--unavailable { background: #fae3e3; color: #8b2932; }
.commerce-summary { padding: 1.3rem; }
.commerce-summary dl { margin: 1rem 0; }
.commerce-summary dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; color: #30475f; }
.commerce-summary__total { border-top: 1px solid #dbe5ef; color: #0d2f4f !important; font-size: 1.08rem; font-weight: 900; }
.commerce-empty { padding: 2.5rem; text-align: center; }
.commerce-empty .commerce-button { margin-top: 1rem; }
.commerce-alert { margin-bottom: 1rem; border-color: #e4ad5d; background: #fff9ec; padding: 1rem 1.2rem; color: #714913; font-size: .84rem; font-weight: 700; }

@media (min-width: 72rem) {
  .commerce-cart-layout { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
  .commerce-summary { position: sticky; top: 6.5rem; }
}

@media (max-width: 48rem) {
  .commerce-cart-line { grid-template-columns: 1fr; }
  .commerce-cart-line__subtotal { text-align: left; }
}
