:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #eef2f7;
  --text: #172033;
  --text-muted: #5f6b7a;
  --border: #d9e1ec;
  --primary: #1d5cff;
  --primary-dark: #1748c8;
  --success-bg: #eaf7ee;
  --success-text: #1f7a3d;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 31, 56, 0.08);
  --container: 1780px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  z-index: 10;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-row,
.footer-row,
.section-head,
.product-footer,
.promo-box,
.hero-actions,
.brand-wrap,
.card-actions,
.cart-panel-header,
.cart-item,
.details-layout,
.checkout-topbar,
.checkout-actions,
.checkout-total,
.checkout-item {
  display: flex;
  align-items: center;
}

.header-row,
.footer-row,
.section-head,
.promo-box,
.cart-panel-header,
.checkout-total,
.checkout-topbar,
.checkout-item,
.product-footer {
  justify-content: space-between;
}

.header-row {
  min-height: 78px;
  gap: 1.5rem;
}

.brand-button {
  padding: 0;
  cursor: pointer;
}

.brand-wrap {
  gap: 0.75rem;
}

.logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1.8rem;
}

.brand-kicker,
.section-label,
.product-category,
.hero-card-label,
.range-note,
.step-label,
.info-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.brand-kicker,
.brand-name {
  display: block;
  text-align: left;
}

.brand-name,
.hero h1,
.section h2,
.product-card h3,
.hero-card h2,
.cart-panel h2,
.details-content h2,
.checkout-card h2,
.checkout-step h3,
.confirmation-card h2 {
  margin: 0;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
}

.brand-button:focus-visible,
.brand-button:hover {
  color: var(--text);
}

.cart-button,
.btn,
.icon-button,
.qty-btn {
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.cart-button:hover,
.cart-button:focus-visible {
  background: var(--primary-dark);
}

.cart-button .cart-icon {
  display: inline-flex;
  align-items: center;
  align-self: baseline;
}

.cart-button svg {
  width: 1.7rem;
  height: 1.7rem;
  fill: currentColor;
}

.hero {
  padding: 4rem 0 3rem;
}

.hero-grid,
.layout-grid,
.checkout-layout,
.checkout-grid,
.confirmation-info {
  display: grid;
  gap: 2rem;
}

.hero-grid {
  grid-template-columns: 1.55fr 0.9fr;
  align-items: center;
}

.checkout-layout {
  grid-template-columns: 1.5fr 0.9fr;
  align-items: start;
}

.checkout-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.confirmation-info {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.full-span {
  grid-column: 1 / -1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.08;
  max-width: 20ch;
}

.hero-text {
  max-width: 58ch;
  color: var(--text-muted);
  margin: 1rem 0 0;
}

.hero-actions,
.card-actions,
.checkout-actions {
  gap: 1rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.hero-card,
.filters,
.product-card,
.promo-box,
.details-layout,
.cart-panel,
.checkout-card,
.payment-method-box,
.confirmation-card,
.info-box,
.confirmation-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card,
.filters,
.product-card,
.details-layout,
.checkout-card,
.confirmation-card {
  padding: 1.5rem;
}

.payment-method-box,
.info-box,
.confirmation-note {
  padding: 1.1rem 1.2rem;
}

.feature-list {
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.section {
  padding: 1.25rem 0 4rem;
}

.layout-grid {
  grid-template-columns: 280px 1fr;
  align-items: start;
}

.catalog-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.form-group {
  margin-bottom: 1rem;
}

.checkout-form .form-group,
.payment-single-field {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

input[type="range"] {
  padding: 0;
}

.range-slider {
  position: relative;
  height: 2.25rem;
  margin-top: 0.7rem;
}

.range-slider input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: transparent;
  appearance: none;
  pointer-events: auto;
}

.range-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  margin-top: -5px;
}

.range-slider input[type="range"]::-moz-range-track {
  height: 8px;
  background: transparent;
}

.range-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.range-slider::before,
.range-slider::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 8px;
  border-radius: 999px;
}

.range-slider::before {
  left: 0;
  right: 0;
  background: var(--surface-muted);
}

.range-slider::after {
  left: calc(var(--min-percent, 0%) );
  right: calc(100% - var(--max-percent, 100%) );
  background: var(--primary);
}

.section-head {
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.sort-box {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #000;
}

.sort-box svg {
  width: 0.76rem;
  height: 1.08rem;
  fill: currentColor;
}

.sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0rem;
}

.filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
}

.filter-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.sort-icon svg + svg {
  margin-left: -0.18rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.product-image {
  min-height: 160px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.details-image {
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: transparent;
  color: var(--text-muted);
  min-height: auto;
}

img.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  width: auto;
  height: auto;
}

img.details-image {
  max-width: 40%;
  max-height: 100%;
  object-fit: contain;
  width: auto;
  height: auto;
}

.details-layout {
  gap: 2rem;
  align-items: stretch;
}

.details-image,
.details-content {
  flex: 1;
}

.details-content p {
  max-width: 65ch;
}

.product-desc {
  color: var(--text-muted);
}

.price {
  font-size: 1.35rem;
  font-weight: 700;
}

.btn,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.1rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--primary-dark);
}

.btn-secondary,
.icon-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  background: var(--surface-muted);
}

.full-width {
  width: 100%;
}

.muted {
  padding-top: 0;
}

.promo-box {
  padding: 1.5rem;
  gap: 2rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  min-width: min(420px, 100%);
}

.site-footer {
  padding: 1.5rem 0 2.5rem;
  color: var(--text-muted);
}

.cart-panel {
  position: fixed;
  top: 92px;
  right: 1rem;
  width: min(360px, calc(100% - 2rem));
  padding: 1.25rem;
  z-index: 30;
}

.cart-items,
.checkout-items {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0 1.25rem;
}

.cart-item,
.checkout-item {
  gap: 1rem;
  align-items: center;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.cart-item h3,
.cart-item p,
.empty-cart,
.cart-line-total,
.checkout-item h3,
.checkout-item p,
.confirmation-message,
.confirmation-note p {
  margin: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-info h3,
.checkout-item h3 {
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.cart-item-info p,
.checkout-item p,
.confirmation-message,
.confirmation-note {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.qty-btn:hover,
.qty-btn:focus-visible {
  background: var(--surface-muted);
}

.qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.cart-line-total {
  font-weight: 700;
  white-space: nowrap;
}

.cart-summary,
.checkout-total {
  display: grid;
  gap: 0.75rem;
}

.checkout-total {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.checkout-topbar {
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.checkout-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.checkout-step-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
}

.checkout-step-indicator.is-active {
  border-color: #bfd0ff;
  background: #eef3ff;
}

.step-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dbe6ff;
  color: var(--primary);
  font-weight: 700;
}

.checkout-step-indicator.is-active .step-number {
  background: var(--primary);
  color: #fff;
}

.checkout-step {
  display: none;
}

.checkout-step.is-active {
  display: block;
}

.checkout-step h3 {
  margin-bottom: 1rem;
}

.payment-fields {
  display: grid;
  gap: 1rem;
}

.confirmation-wrap {
  max-width: 860px;
}

.confirmation-card {
  text-align: left;
}

.confirmation-badge {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.confirmation-message {
  margin-top: 0.75rem;
  max-width: 60ch;
}

.info-box strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
}

.confirmation-note {
  background: #f8fafc;
}

.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 40;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 920px) {
  .header-row,
  .section-head,
  .promo-box,
  .footer-row,
  .details-layout,
  .checkout-topbar,
  .checkout-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-grid,
  .layout-grid,
  .catalog-content,
  .product-grid,
  .checkout-layout,
  .checkout-grid,
  .checkout-steps,
  .confirmation-info {
    grid-template-columns: 1fr;
  }

  .nav-list {
    flex-wrap: wrap;
  }

  .newsletter-form {
    min-width: 100%;
    width: 100%;
    flex-direction: column;
  }

  .cart-panel {
    top: auto;
    bottom: 1rem;
  }

  .cart-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .cart-item-controls,
  .cart-item-actions {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 2rem;
  }

  .container {
    width: min(var(--container), calc(100% - 1rem));
  }


  .hero-card,
  .filters,
  .product-card,
  .promo-box,
  .details-layout,
  .checkout-card,
  .payment-method-box,
  .confirmation-card,
  .info-box,
  .confirmation-note {
    padding: 1rem;
  }

  .vertical-mobile {
    align-items: flex-start;
    flex-direction: column;
  }

  .compact-actions {
    width: 100%;
  }

  .compact-actions .btn {
    flex: 1;
  }

  .cart-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
  }
}