.commerce-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 46px;
}

[hidden] {
  display: none !important;
}

.commerce-hero,
.commerce-card {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(17, 22, 29, .94), rgba(10, 13, 18, .94));
  box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
}

.commerce-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.commerce-hero h1 {
  margin: 6px 0;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.08;
}

.commerce-hero p,
.commerce-muted {
  color: var(--muted);
  line-height: 1.55;
}

.commerce-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
  gap: 18px;
}

.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.commerce-card {
  padding: 20px;
}

.commerce-hero .commerce-card {
  padding: 14px 16px;
}

.auth-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.auth-card h2 {
  margin-bottom: 0;
}

.google-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255,255,255,.08);
  font-weight: 900;
  cursor: pointer;
}

.google-login span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  font-weight: 900;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: rgba(255,255,255,.12);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.section-title-row h2 {
  margin-top: 8px;
}

.commerce-card h2,
.commerce-card h3 {
  margin: 0 0 14px;
}

.commerce-list {
  display: grid;
  gap: 12px;
}

.commerce-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .04);
}

.commerce-item strong {
  display: block;
  margin-bottom: 5px;
}

.commerce-item-actions,
.commerce-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.commerce-item input,
.commerce-form input,
.commerce-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .07);
  outline: none;
}

.commerce-qty {
  max-width: 86px;
}

.commerce-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.commerce-total {
  font-size: 24px;
  font-weight: 900;
}

.commerce-form {
  display: grid;
  gap: 12px;
}

.commerce-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.commerce-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.commerce-pill {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(226, 31, 47, .42);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(226, 31, 47, .12);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.commerce-status {
  min-height: 22px;
  color: var(--soft);
}

.account-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, .045);
}

.account-menu button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: 9px 13px;
  color: var(--soft);
  background: rgba(255, 255, 255, .055);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.account-menu button.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, #f03545, var(--red-dark));
  box-shadow: 0 12px 28px rgba(226, 31, 47, .22);
}

.account-panel {
  display: none;
  width: 100%;
}

.account-panel.is-active {
  display: block;
}

.account-panel .commerce-card {
  width: 100%;
}

.account-panel .commerce-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

[data-account-panel="security"] .commerce-form {
  max-width: 560px;
}

.garage-photo-field {
  display: grid;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, .22);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, .04);
  color: var(--soft);
}

.garage-photo-field span {
  font-weight: 800;
}

.garage-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background:
    radial-gradient(circle at 80% 0%, rgba(226, 31, 47, .18), transparent 34%),
    rgba(255, 255, 255, .045);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .2);
}

.garage-history {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.garage-history strong {
  color: var(--soft);
  margin: 0;
}

.garage-history span {
  line-height: 1.35;
}

html[data-theme="light"] .commerce-hero,
html[data-theme="light"] .commerce-card,
html[data-theme="light"] .commerce-item,
html[data-theme="light"] .garage-card,
html[data-theme="light"] .account-menu {
  background: rgba(255, 252, 246, .94);
  border-color: rgba(118, 92, 55, .14);
  box-shadow: 0 16px 36px rgba(87, 62, 33, .08);
}

html[data-theme="light"] .google-login,
html[data-theme="light"] .commerce-form input,
html[data-theme="light"] .commerce-form select,
html[data-theme="light"] .garage-photo-field,
html[data-theme="light"] .account-menu button {
  color: #32291f;
  border-color: rgba(118, 92, 55, .16);
  background: rgba(255,255,255,.72);
}

html[data-theme="light"] .account-menu button.is-active {
  color: #fff;
  background: linear-gradient(180deg, #f03545, var(--red-dark));
}

html[data-theme="light"] .auth-divider::before,
html[data-theme="light"] .auth-divider::after,
html[data-theme="light"] .garage-history {
  border-color: rgba(118, 92, 55, .13);
  background: transparent;
}

html[data-theme="light"] .commerce-muted,
html[data-theme="light"] .garage-card-body p,
html[data-theme="light"] .garage-history {
  color: #6b5a43;
}

.garage-card-photo {
  min-height: 150px;
  background: linear-gradient(135deg, rgba(226, 31, 47, .24), rgba(255, 255, 255, .06));
}

.garage-card-photo img {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  display: block;
}

.garage-card-photo.is-empty {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .76);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.garage-card-body {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
}

.garage-card-body h3 {
  margin: 0;
  font-size: 24px;
}

.garage-card-body p {
  margin: 0;
  color: var(--muted);
}

.garage-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.commerce-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: 360px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(11, 14, 19, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .36);
}

.commerce-toast[hidden] {
  display: none;
}

.cart-badge {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 7px;
  background: rgba(226, 31, 47, .9);
  color: #fff;
  font-size: 12px;
}

.catalog-card-detail-button {
  width: 100%;
}

@media (max-width: 880px) {
  .commerce-hero,
  .commerce-grid,
  .commerce-form-grid {
    grid-template-columns: 1fr;
  }

  .commerce-shell {
    width: min(100% - 20px, 1180px);
    margin-top: 16px;
  }

  .commerce-hero {
    gap: 12px;
    padding: 14px;
  }

  .commerce-hero h1 {
    font-size: 22px;
  }

  .section-title-row {
    display: grid;
    gap: 8px;
  }

  .account-menu {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 6px;
    scrollbar-width: thin;
  }

  .account-menu button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 11px;
    font-size: 12px;
    white-space: nowrap;
  }

  .account-panel .commerce-form-grid {
    grid-template-columns: 1fr;
  }

  .garage-card {
    grid-template-columns: 1fr;
  }
}
