/* Material Design 3 inspired - Google style */
:root {
  --md-sys-color-primary: #6750a4;
  --md-sys-color-primary-container: #eaddff;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-on-primary-container: #21005d;
  --md-sys-color-secondary: #625b71;
  --md-sys-color-secondary-container: #e8def8;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-surface: #fef7ff;
  --md-sys-color-surface-container: #f3edf7;
  --md-sys-color-surface-container-high: #ece6f0;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-outline: #79747e;
  --md-sys-color-error: #b3261e;
  --md-sys-color-on-error: #ffffff;
  --md-sys-elevation-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
  --md-sys-elevation-2: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px 2px rgba(0,0,0,.15);
  --md-sys-elevation-3: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.3);
  --md-sys-elevation-4: 0 6px 10px 4px rgba(0,0,0,.15), 0 2px 3px rgba(0,0,0,.3);
  --md-sys-shape-corner-full: 9999px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-state-hover-opacity: .08;
  --md-sys-state-focus-opacity: .12;
  --md-sys-state-pressed-opacity: .12;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.mdc-layout {
  min-height: 100vh;
  padding-bottom: 100px;
}

/* Top app bar */
.mdc-top-app-bar {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.mdc-top-app-bar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  min-height: 64px;
}

.mdc-top-app-bar__title {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: .0125em;
}

/* Buttons */
.mdc-button {
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 10px 24px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer;
  transition: box-shadow .2s, background .2s;
}

.mdc-button--raised {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: var(--md-sys-elevation-1);
}

.mdc-button--raised:hover {
  box-shadow: var(--md-sys-elevation-2);
}

.mdc-button--raised:active {
  box-shadow: var(--md-sys-elevation-1);
}

.mdc-button--primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.mdc-icon-button {
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background .2s;
}

.mdc-icon-button:hover {
  background: rgba(0,0,0,.08);
}

/* Main content */
.mdc-main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Typography */
.mdc-typography--headline4 {
  font-size: 2.125rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 2.5rem;
  margin: 0 0 .5em;
}

.mdc-typography--headline6 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: .0125em;
  margin: 0 0 16px;
}

.mdc-typography--subtitle1 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .015em;
  margin: 0 0 4px;
}

.mdc-typography--subtitle2 {
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .01em;
  margin: 0 0 8px;
  color: var(--md-sys-color-on-surface-variant);
}

.mdc-typography--body1 {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: .03125em;
  line-height: 1.5rem;
  margin: 0 0 16px;
}

.mdc-typography--body2 {
  font-size: .875rem;
  font-weight: 400;
  letter-spacing: .01786em;
  line-height: 1.25rem;
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
}

/* Card */
.mdc-card {
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-medium);
  box-shadow: var(--md-sys-elevation-1);
  overflow: hidden;
}

.mdc-card__content {
  padding: 24px;
}

/* Product hero */
.product-hero {
  margin-bottom: 32px;
}

.product-card {
  position: relative;
}

.product-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-small);
  font-size: .875rem;
  font-weight: 700;
  z-index: 1;
}

.product-image-wrap {
  background: linear-gradient(135deg, var(--md-sys-color-secondary-container) 0%, var(--md-sys-color-primary-container) 100%);
  padding: 32px;
  text-align: center;
}

.product-image {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  background: radial-gradient(circle at 50% 50%, var(--md-sys-color-outline) 0%, transparent 70%);
  border-radius: 50%;
  opacity: .6;
}

.product-title {
  margin-top: 0;
}

.product-desc {
  color: var(--md-sys-color-on-surface-variant);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.price-old {
  font-size: 1rem;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: line-through;
}

.price-current {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

/* Timer */
.timer-block {
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-small);
  padding: 16px;
  margin-bottom: 24px;
}

.timer-label {
  margin-bottom: 8px;
}

.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.timer-unit {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  padding: 8px 12px;
  border-radius: var(--md-sys-shape-corner-small);
  min-width: 52px;
}

.timer-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.timer-suffix {
  font-size: .625rem;
  font-weight: 500;
  opacity: .9;
}

.timer-sep {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  padding: 0 2px;
}

.btn-buy {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
}

/* Features */
.section-title {
  padding-left: 4px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.feature-card {
  padding: 20px;
  text-align: center;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

/* FAB */
.mdc-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 20;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  min-width: 80px;
  height: 56px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-3);
  transition: box-shadow .2s, transform .2s;
}

.mdc-fab:hover {
  box-shadow: var(--md-sys-elevation-4);
}

.mdc-fab__icon {
  font-size: 1.5rem;
}

/* Chat panel */
.chat-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  max-height: 520px;
  height: calc(100vh - 80px);
  background: var(--md-sys-color-surface-container);
  box-shadow: var(--md-sys-elevation-4);
  border-radius: var(--md-sys-shape-corner-medium) var(--md-sys-shape-corner-medium) 0 0;
  display: flex;
  flex-direction: column;
  z-index: 30;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform .25s ease, visibility .25s;
}

.chat-panel.is-open {
  transform: translateY(0);
  visibility: visible;
}

.chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 16px 20px;
  border-bottom: 1px solid var(--md-sys-color-outline);
  flex-shrink: 0;
}

.chat-panel__header h2 {
  margin: 0;
}

.chat-close {
  color: var(--md-sys-color-on-surface-variant);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: .9375rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-msg--bot {
  align-self: flex-start;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-surface);
  border-bottom-left-radius: 4px;
}

.chat-msg--user {
  align-self: flex-end;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-bottom-right-radius: 4px;
}

.chat-msg--error {
  align-self: center;
  background: rgba(179, 38, 30, .12);
  color: var(--md-sys-color-error);
  font-size: .875rem;
}

.chat-msg--typing .chat-msg__text::after {
  content: '';
  animation: typing 1s steps(3) infinite;
}

@keyframes typing {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--md-sys-color-outline);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.chat-input::placeholder {
  color: var(--md-sys-color-on-surface-variant);
}

.chat-input:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}

.chat-send {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  flex-shrink: 0;
}

.chat-send:hover {
  background: var(--md-sys-color-primary);
  opacity: .9;
}

.chat-send:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.32);
  z-index: 25;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

.chat-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 600px) {
  .mdc-main-content {
    padding: 32px 24px;
  }
  .product-image {
    width: 240px;
    height: 240px;
  }
}
