/* ============================================
   Material Design 3 — Design System
   杭州蒂蓝信息技术有限公司
   ============================================ */

/* --- MD3 Color Tokens --- */
:root {
  --md-sys-color-primary: #6750A4;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #EADDFF;
  --md-sys-color-on-primary-container: #21005D;
  --md-sys-color-secondary: #625B71;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #E8DEF8;
  --md-sys-color-on-secondary-container: #1D192B;
  --md-sys-color-tertiary: #7D5260;
  --md-sys-color-on-tertiary: #FFFFFF;
  --md-sys-color-tertiary-container: #FFD8E4;
  --md-sys-color-on-tertiary-container: #31111D;
  --md-sys-color-error: #B3261E;
  --md-sys-color-on-error: #FFFFFF;
  --md-sys-color-error-container: #F9DEDC;
  --md-sys-color-on-error-container: #410E0B;
  --md-sys-color-background: #FFFBFE;
  --md-sys-color-on-background: #1C1B1F;
  --md-sys-color-surface: #FFFBFE;
  --md-sys-color-on-surface: #1C1B1F;
  --md-sys-color-surface-variant: #E7E0EC;
  --md-sys-color-on-surface-variant: #49454F;
  --md-sys-color-outline: #79747E;
  --md-sys-color-outline-variant: #CAC4D0;
  --md-sys-color-inverse-surface: #313033;
  --md-sys-color-inverse-on-surface: #F4EFF4;
  --md-sys-color-inverse-primary: #D0BCFF;

  /* Tonal Surface Elevations */
  --md-sys-color-surface1: #F6F0FA;
  --md-sys-color-surface2: #F1EAFA;
  --md-sys-color-surface3: #ECE4F9;
  --md-sys-color-surface4: #EAE2F8;
  --md-sys-color-surface5: #E7DFF7;

  /* Shape Tokens */
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 50%;

  /* Elevation Shadows */
  --md-sys-elevation-1: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
  --md-sys-elevation-2: 0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15);
  --md-sys-elevation-3: 0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3);
  --md-sys-elevation-4: 0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3);
  --md-sys-elevation-5: 0 8px 12px 6px rgba(0,0,0,0.15), 0 4px 4px rgba(0,0,0,0.3);

  /* Motion */
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-duration-short: 200ms;
  --md-sys-motion-duration-medium: 400ms;
  --md-sys-motion-duration-long: 600ms;

  /* Layout */
  --md-layout-max-width: 1200px;
  --md-layout-gutter: 24px;
}

/* --- MD3 Type Scale --- */
.md-display-large { font-size: 57px; line-height: 64px; font-weight: 400; letter-spacing: -0.25px; }
.md-display-medium { font-size: 45px; line-height: 52px; font-weight: 400; }
.md-display-small { font-size: 36px; line-height: 44px; font-weight: 400; }
.md-headline-large { font-size: 32px; line-height: 40px; font-weight: 400; }
.md-headline-medium { font-size: 28px; line-height: 36px; font-weight: 400; }
.md-headline-small { font-size: 24px; line-height: 32px; font-weight: 400; }
.md-title-large { font-size: 22px; line-height: 28px; font-weight: 500; }
.md-title-medium { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0.15px; }
.md-title-small { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; }
.md-body-large { font-size: 16px; line-height: 24px; font-weight: 400; letter-spacing: 0.5px; }
.md-body-medium { font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: 0.25px; }
.md-body-small { font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: 0.4px; }
.md-label-large { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; }
.md-label-medium { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.5px; }
.md-label-small { font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0.5px; }

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

img, svg { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

/* --- Layout --- */
.md-container {
  width: 100%;
  max-width: var(--md-layout-max-width);
  margin: 0 auto;
  padding: 0 var(--md-layout-gutter);
}

.md-grid {
  display: grid;
  gap: var(--md-layout-gutter);
}

.md-grid-2 { grid-template-columns: repeat(2, 1fr); }
.md-grid-3 { grid-template-columns: repeat(3, 1fr); }
.md-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Top App Bar --- */
.md-top-app-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--md-sys-color-surface);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-top-app-bar.scrolled {
  background-color: var(--md-sys-color-surface2);
  box-shadow: var(--md-sys-elevation-2);
}

.md-top-app-bar__logo {
  height: 36px;
  width: auto;
  flex-shrink: 0;
}

.md-top-app-bar__content {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: var(--md-layout-max-width);
  margin: 0 auto;
  padding: 0 8px;
  gap: 8px;
}

.md-top-app-bar__title {
  font-size: 22px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-left: 4px;
  white-space: nowrap;
}

.md-top-app-bar__spacer { flex: 1; }

.md-top-app-bar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.md-top-app-bar__nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--md-sys-color-on-surface-variant);
  overflow: hidden;
  transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-top-app-bar__nav-item:hover {
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface);
}

.md-top-app-bar__nav-item.active {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.md-top-app-bar__nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.md-top-app-bar__cart-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  font-size: 11px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.md-top-app-bar__cart-badge.show { display: flex; }

/* Hamburger Menu */
.md-top-app-bar__menu-btn {
  display: none;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
}

.md-top-app-bar__menu-btn svg { width: 24px; height: 24px; }

.md-top-app-bar__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface);
  margin-right: 4px;
  overflow: hidden;
  position: relative;
}

.md-top-app-bar__back svg { width: 24px; height: 24px; }

/* Body offset for fixed top app bar */
body { padding-top: 64px; }

/* --- Buttons --- */
.md-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 48px;
  height: 40px;
  padding: 0 24px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  transition: box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-btn--filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.md-btn--filled:hover {
  box-shadow: var(--md-sys-elevation-1);
}

.md-btn--filled:active { box-shadow: none; }

.md-btn--outlined {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
}

.md-btn--outlined:hover {
  background-color: rgba(103, 80, 164, 0.08);
}

.md-btn--tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.md-btn--tonal:hover {
  box-shadow: var(--md-sys-elevation-1);
}

.md-btn--text {
  background: transparent;
  color: var(--md-sys-color-primary);
  padding: 0 12px;
}

.md-btn--text:hover {
  background-color: rgba(103, 80, 164, 0.08);
}

.md-btn--large {
  height: 56px;
  padding: 0 32px;
  font-size: 16px;
  border-radius: var(--md-sys-shape-corner-extra-large);
}

.md-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.md-btn--fab {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: var(--md-sys-shape-corner-large);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: var(--md-sys-elevation-3);
}

.md-btn--fab:hover { box-shadow: var(--md-sys-elevation-4); }

.md-btn--extended-fab {
  height: 56px;
  padding: 0 20px;
  border-radius: var(--md-sys-shape-corner-large);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: var(--md-sys-elevation-3);
  gap: 12px;
  font-size: 16px;
}

.md-btn--extended-fab:hover { box-shadow: var(--md-sys-elevation-4); }

.md-btn:disabled, .md-btn[disabled] {
  background-color: rgba(28, 27, 31, 0.12);
  color: rgba(28, 27, 31, 0.38);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Ripple --- */
.md-ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.12;
  transform: scale(0);
  pointer-events: none;
  animation: md-ripple-expand 600ms var(--md-sys-motion-easing-standard) forwards;
}

@keyframes md-ripple-expand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* --- Cards --- */
.md-card {
  position: relative;
  border-radius: var(--md-sys-shape-corner-medium);
  overflow: hidden;
  transition: box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-card--filled {
  background-color: var(--md-sys-color-surface-variant);
}

.md-card--elevated {
  background-color: var(--md-sys-color-surface1);
  box-shadow: var(--md-sys-elevation-1);
}

.md-card--elevated:hover {
  box-shadow: var(--md-sys-elevation-2);
  transform: translateY(-2px);
}

.md-card--outlined {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.md-card--outlined:hover {
  border-color: var(--md-sys-color-outline);
}

.md-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--md-sys-color-surface3);
}

.md-card__media svg {
  width: 64px;
  height: 64px;
}

.md-card__content {
  padding: 16px;
}

.md-card__title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.15px;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 4px;
}

.md-card__subtitle {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  letter-spacing: 0.25px;
  margin-bottom: 12px;
  line-height: 1.43;
}

.md-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 16px;
}

.md-card__price {
  font-size: 22px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  letter-spacing: -0.5px;
}

.md-card__price small {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.7;
}

/* --- Chips --- */
.md-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-small);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface-variant);
  background: transparent;
  transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-chip:hover { background-color: rgba(28, 27, 31, 0.08); }

.md-chip--filled {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}

/* --- Badge --- */
.md-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-size: 12px;
  font-weight: 600;
}

/* --- Hero Section --- */
.md-hero {
  background-color: var(--md-sys-color-surface2);
  padding: 80px 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.md-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: var(--md-sys-color-primary-container);
  opacity: 0.3;
}

.md-hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--md-sys-color-tertiary-container);
  opacity: 0.2;
}

.md-hero__content {
  position: relative;
  z-index: 1;
}

.md-hero__title {
  font-size: 45px;
  line-height: 52px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
}

.md-hero__subtitle {
  font-size: 16px;
  line-height: 24px;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 600px;
  margin: 0 auto 32px;
  letter-spacing: 0.5px;
}

.md-hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Sections --- */
.md-section {
  padding: 64px 0;
}

.md-section__header {
  text-align: center;
  margin-bottom: 48px;
}

.md-section__title {
  font-size: 28px;
  line-height: 36px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 8px;
}

.md-section__subtitle {
  font-size: 14px;
  line-height: 20px;
  color: var(--md-sys-color-on-surface-variant);
  letter-spacing: 0.25px;
}

/* --- Product Grid --- */
.md-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

a.md-product-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.md-product-card {
  position: relative;
  border-radius: var(--md-sys-shape-corner-medium);
  background-color: var(--md-sys-color-surface1);
  box-shadow: var(--md-sys-elevation-1);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
              transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.md-product-card:hover {
  box-shadow: var(--md-sys-elevation-3);
  transform: translateY(-4px);
}

.md-product-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--md-sys-color-surface3);
  position: relative;
  min-height: 140px;
}

.md-product-card__icon {
  width: 72px;
  height: 72px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.md-product-card:hover .md-product-card__icon {
  transform: scale(1.08);
}

.md-product-card__media svg { width: 72px; height: 72px; }

.md-product-card__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 2px 10px;
  border-radius: var(--md-sys-shape-corner-small);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.md-product-card__sales-badge {
  position: absolute;
  bottom: 10px;
  right: 12px;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-corner-small);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 500;
}

.md-product-card__body {
  padding: 16px;
}

.md-product-card__name {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 4px;
  letter-spacing: 0.15px;
}

.md-product-card__desc {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.45;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.md-product-card__rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.md-product-card__stars {
  color: #F9A825;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1;
}

.md-product-card__rating-text {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.md-product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 16px;
}

.md-product-card__price {
  font-size: 22px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.md-product-card__price small {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.7;
}

.md-btn--sm {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: var(--md-sys-shape-corner-extra-large);
}

/* --- Feature Cards --- */
.md-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.md-feature-card {
  border-radius: var(--md-sys-shape-corner-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface);
  padding: 32px 24px;
  text-align: center;
  transition: border-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-feature-card:hover {
  border-color: var(--md-sys-color-outline);
  background-color: var(--md-sys-color-surface1);
}

.md-feature-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--md-sys-shape-corner-large);
  background-color: var(--md-sys-color-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.md-feature-card__icon svg {
  width: 28px;
  height: 28px;
  color: var(--md-sys-color-on-primary-container);
}

.md-feature-card__title {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 8px;
}

.md-feature-card__text {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.5;
}

/* --- Stepper --- */
.md-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  gap: 0;
}

.md-stepper__step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.md-stepper__circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  flex-shrink: 0;
  transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-stepper__step.active .md-stepper__circle {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.md-stepper__step.completed .md-stepper__circle {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.md-stepper__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
}

.md-stepper__step.active .md-stepper__label {
  color: var(--md-sys-color-on-surface);
}

.md-stepper__connector {
  width: 48px;
  height: 1px;
  background-color: var(--md-sys-color-outline-variant);
  margin: 0 8px;
  flex-shrink: 0;
}

.md-stepper__step.completed + .md-stepper__connector,
.md-stepper__connector.active {
  background-color: var(--md-sys-color-primary);
}

/* --- Form Fields --- */
.md-field {
  position: relative;
  margin-bottom: 24px;
}

.md-field__outlined {
  position: relative;
}

.md-field__outlined input,
.md-field__outlined textarea,
.md-field__outlined select {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-size: 16px;
  line-height: 24px;
  outline: none;
  transition: border-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-field__outlined textarea {
  min-height: 100px;
  resize: vertical;
}

.md-field__outlined input:focus,
.md-field__outlined textarea:focus,
.md-field__outlined select:focus {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  padding: 15px;
}

.md-field__outlined label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--md-sys-color-surface);
  padding: 0 4px;
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  pointer-events: none;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-field__outlined textarea ~ label {
  top: 16px;
  transform: none;
}

.md-field__outlined input:focus ~ label,
.md-field__outlined input:not(:placeholder-shown) ~ label,
.md-field__outlined textarea:focus ~ label,
.md-field__outlined textarea:not(:placeholder-shown) ~ label,
.md-field__outlined select:focus ~ label,
.md-field__outlined select:valid ~ label {
  top: 0;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--md-sys-color-primary);
}

.md-field__helper {
  margin-top: 4px;
  padding: 0 16px;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.md-field--error .md-field__outlined input,
.md-field--error .md-field__outlined textarea {
  border-color: var(--md-sys-color-error);
}

.md-field--error .md-field__outlined label {
  color: var(--md-sys-color-error);
}

.md-field--error .md-field__helper {
  color: var(--md-sys-color-error);
}

/* --- Radio / Payment Selection --- */
.md-radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.md-radio {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  cursor: pointer;
  transition: border-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  position: relative;
  overflow: hidden;
}

.md-radio:hover {
  background-color: var(--md-sys-color-surface1);
  border-color: var(--md-sys-color-outline);
}

.md-radio.selected {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  padding: 15px 19px;
  background-color: var(--md-sys-color-surface1);
}

.md-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--md-sys-color-on-surface-variant);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-radio input[type="radio"]:checked {
  border-color: var(--md-sys-color-primary);
}

.md-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--md-sys-color-primary);
}

.md-radio__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.md-radio__icon img, .md-radio__icon svg { width: 100%; height: 100%; }

.md-radio__label {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.md-radio__desc {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

/* --- Snackbar --- */
.md-snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background-color: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  padding: 14px 24px;
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-size: 14px;
  letter-spacing: 0.25px;
  box-shadow: var(--md-sys-elevation-3);
  z-index: 1000;
  transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
  white-space: nowrap;
  max-width: 90vw;
}

.md-snackbar.show {
  transform: translateX(-50%) translateY(0);
}

.md-snackbar__action {
  color: var(--md-sys-color-inverse-primary);
  font-weight: 500;
  margin-left: 16px;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 14px;
}

/* --- Progress Indicator --- */
.md-progress-linear {
  width: 100%;
  height: 4px;
  background-color: var(--md-sys-color-surface-variant);
  border-radius: 2px;
  overflow: hidden;
}

.md-progress-linear__bar {
  height: 100%;
  background-color: var(--md-sys-color-primary);
  border-radius: 2px;
  width: 0%;
  transition: width var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-standard);
}

.md-progress-linear--indeterminate .md-progress-linear__bar {
  width: 40%;
  animation: md-progress-indeterminate 1.8s var(--md-sys-motion-easing-standard) infinite;
}

@keyframes md-progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.md-progress-circular {
  display: inline-block;
  width: 48px;
  height: 48px;
  animation: md-progress-rotate 1.4s linear infinite;
}

.md-progress-circular circle {
  fill: none;
  stroke: var(--md-sys-color-primary);
  stroke-width: 4;
  stroke-dasharray: 125;
  stroke-dashoffset: 30;
  stroke-linecap: round;
  animation: md-progress-dash 1.4s ease-in-out infinite;
}

@keyframes md-progress-rotate {
  100% { transform: rotate(360deg); }
}

@keyframes md-progress-dash {
  0% { stroke-dashoffset: 125; }
  50% { stroke-dashoffset: 30; }
  100% { stroke-dashoffset: 125; }
}

/* --- Divider --- */
.md-divider {
  height: 1px;
  background: var(--md-sys-color-outline-variant);
  border: none;
  margin: 16px 0;
}

/* --- Breadcrumb --- */
.md-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
}

.md-breadcrumb a {
  color: var(--md-sys-color-primary);
}

.md-breadcrumb a:hover {
  text-decoration: underline;
}

.md-breadcrumb__sep {
  color: var(--md-sys-color-outline);
  font-size: 12px;
}

/* --- Quantity Selector --- */
.md-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  overflow: hidden;
}

.md-qty__btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-size: 20px;
  transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  position: relative;
  overflow: hidden;
}

.md-qty__btn:hover { background: var(--md-sys-color-surface-variant); }

.md-qty__val {
  width: 56px;
  height: 40px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--md-sys-color-outline);
  border-right: 1px solid var(--md-sys-color-outline);
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-size: 16px;
  font-weight: 500;
  outline: none;
}

/* --- Order Summary --- */
.md-order-summary {
  border-radius: var(--md-sys-shape-corner-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface);
  overflow: hidden;
}

.md-order-summary__header {
  padding: 16px 20px;
  background: var(--md-sys-color-surface2);
  font-size: 16px;
  font-weight: 500;
}

.md-order-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
}

.md-order-summary__row + .md-order-summary__row {
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.md-order-summary__total {
  background: var(--md-sys-color-surface1);
  font-weight: 600;
}

.md-order-summary__total .md-order-summary__value {
  color: var(--md-sys-color-primary);
  font-size: 20px;
  font-weight: 700;
}

/* --- Horizontal Scroll --- */
.md-hscroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}

.md-hscroll::-webkit-scrollbar { display: none; }

.md-hscroll > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* --- Footer --- */
.md-footer {
  background-color: var(--md-sys-color-surface2);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding: 48px 0 24px;
}

.md-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 32px;
}

.md-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.md-footer__brand img {
  height: 32px;
  width: auto;
}

.md-footer__desc {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.6;
}

.md-footer__col-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
}

.md-footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.md-footer__links a {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  transition: color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-footer__links a:hover {
  color: var(--md-sys-color-primary);
}

.md-footer__bottom {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.md-footer__copy {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

.md-footer__icp {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

.md-footer__icp a {
  color: var(--md-sys-color-primary);
}

/* --- Mobile Drawer --- */
.md-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              visibility var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.md-drawer-overlay.open { opacity: 1; visibility: visible; }

.md-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: var(--md-sys-color-surface);
  z-index: 201;
  transform: translateX(100%);
  transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
  padding: 24px 0;
  overflow-y: auto;
}

.md-drawer.open { transform: translateX(0); }

.md-drawer__header {
  padding: 8px 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.md-drawer__close {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
}

.md-drawer__nav {
  display: flex;
  flex-direction: column;
}

.md-drawer__nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  transition: background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  border-radius: 0 var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0;
  margin-right: 12px;
}

.md-drawer__nav-item:hover {
  background-color: var(--md-sys-color-surface-variant);
}

.md-drawer__nav-item.active {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.md-drawer__nav-item svg {
  width: 24px;
  height: 24px;
}

/* --- Product Detail --- */
.md-product-hero {
  background: var(--md-sys-color-surface3);
  padding: 48px 0;
}

.md-product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.md-product-detail__media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--md-sys-color-surface2);
  border-radius: var(--md-sys-shape-corner-large);
}

.md-product-detail__media svg { width: 180px; height: 180px; }

.md-product-detail__info {
  padding: 16px 0;
}

.md-product-detail__name {
  font-size: 32px;
  line-height: 40px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 8px;
}

.md-product-detail__price {
  font-size: 36px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin-bottom: 24px;
}

.md-product-detail__price small {
  font-size: 16px;
  font-weight: 400;
  opacity: 0.6;
}

.md-product-detail__desc {
  font-size: 16px;
  line-height: 24px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 32px;
}

.md-product-detail__specs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.md-product-detail__spec {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
}

.md-product-detail__spec svg {
  width: 20px;
  height: 20px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
}

.md-product-detail__media-icon {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.md-product-detail__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.md-product-detail__stars {
  color: #F9A825;
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 1;
}

.md-product-detail__rating-num {
  font-size: 16px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.md-product-detail__review-count {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
}

.md-product-detail__sales-info {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  padding-left: 12px;
  border-left: 1px solid var(--md-sys-color-outline-variant);
}

.md-product-detail__actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 32px;
}

/* --- Review Section --- */
.md-review-section {
  max-width: 800px;
}

.md-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.md-review-summary {
  display: flex;
  align-items: center;
}

.md-review-score {
  display: flex;
  align-items: center;
  gap: 12px;
}

.md-review-score__num {
  font-size: 36px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  line-height: 1;
}

.md-review-score__detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.md-review-score__stars {
  color: #F9A825;
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 1;
}

.md-review-score__count {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

.md-review-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.md-review-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.md-review-item:last-child {
  border-bottom: none;
}

.md-review-item__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.md-review-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.md-review-item__info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.md-review-item__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.md-review-item__time {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.md-review-item__stars {
  color: #F9A825;
  font-size: 14px;
  letter-spacing: 1px;
  line-height: 1;
  flex-shrink: 0;
}

.md-review-item__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--md-sys-color-on-surface);
  padding-left: 48px;
}

/* --- Payment Page --- */
.md-pay-wrapper {
  max-width: 480px;
  margin: 64px auto;
  text-align: center;
}

.md-pay-card {
  background: var(--md-sys-color-surface1);
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: var(--md-sys-elevation-2);
  padding: 48px 32px;
  margin-bottom: 24px;
}

.md-pay-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.md-pay-icon svg { width: 36px; height: 36px; color: var(--md-sys-color-on-primary-container); }

.md-pay-amount {
  font-size: 36px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin-bottom: 8px;
}

.md-pay-status {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 32px;
}

.md-pay-method {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface-variant);
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 32px;
}

.md-pay-method img, .md-pay-method svg { width: 24px; height: 24px; }

/* Success / Error states */
.md-result-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.md-result-icon--success {
  background: #D7F5DC;
}

.md-result-icon--success svg { color: #1B7A2B; width: 40px; height: 40px; }

.md-result-icon--error {
  background: var(--md-sys-color-error-container);
}

.md-result-icon--error svg { color: var(--md-sys-color-error); width: 40px; height: 40px; }

/* --- Responsive --- */
@media (max-width: 1200px) {
    .md-container { max-width: 960px; }
    .md-product-grid { grid-template-columns: repeat(3, 1fr); }
    .md-hero__title { font-size: 2.2rem; }
}

@media (max-width: 1024px) {
  .md-product-grid { grid-template-columns: repeat(3, 1fr); }
  .md-feature-grid { grid-template-columns: repeat(2, 1fr); }
  .md-footer__grid { grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
  .md-product-detail { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  :root {
    --md-layout-gutter: 16px;
  }

  .md-top-app-bar__nav { display: none; }
  .md-top-app-bar__menu-btn { display: flex; }
  .md-top-app-bar__title { font-size: 18px; }

  .md-hero { padding: 48px 0 40px; }
  .md-hero__title { font-size: 32px; line-height: 40px; }
  .md-hero__subtitle { font-size: 14px; }

  .md-section { padding: 40px 0; }
  .md-section__title { font-size: 24px; line-height: 32px; }

  .md-product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .md-product-card__media { padding: 24px 16px; min-height: 110px; }
  .md-product-card__icon { width: 56px; height: 56px; }
  .md-product-card__media svg { width: 56px; height: 56px; }
  .md-product-card__body { padding: 12px; }
  .md-product-card__footer { padding: 0 12px 12px; }
  .md-product-card__name { font-size: 14px; }
  .md-product-card__price { font-size: 18px; }
  .md-product-card__rating-text { font-size: 11px; }

  .md-review-item__text { padding-left: 0; margin-top: 8px; }

  .md-feature-grid { grid-template-columns: 1fr; }
  .md-footer__grid { grid-template-columns: 1fr; gap: 24px; }
  .md-footer__bottom { flex-direction: column; text-align: center; }

  .md-stepper__label { display: none; }
  .md-stepper__connector { width: 32px; }

  .md-product-detail__media { padding: 32px; }
  .md-product-detail__media svg { width: 120px; height: 120px; }
  .md-product-detail__name { font-size: 24px; line-height: 32px; }
  .md-product-detail__price { font-size: 28px; }
  .md-product-detail__actions { flex-direction: column; }
  .md-product-detail__actions .md-btn { width: 100%; }

  .md-pay-wrapper { margin: 32px auto; padding: 0 16px; }
  .md-pay-card { padding: 32px 20px; }
}

@media (max-width: 480px) {
  .md-product-grid { grid-template-columns: 1fr; }
  .md-hero__title { font-size: 28px; line-height: 36px; }
  .md-hero__actions { flex-direction: column; align-items: center; }
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
