/* MaverickMade Product Finder — Component Classes */
/* Always import tokens.css first. Never hardcode values here. */

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

html, body {
  height: 100%;
  background: var(--surface-primary);
  color: var(--foreground-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

/* ─── App Shell ─────────────────────────────────────────── */
.app {
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--surface-primary);
}

/* ─── Screen ────────────────────────────────────────────── */
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen--hero {
  background-size: cover;
  background-position: center;
}

/* ─── Hero Overlay ──────────────────────────────────────── */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-gradient);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100dvh;
  padding: var(--space-15) var(--space-8);
  gap: var(--space-4);
}

/* ─── Typography ────────────────────────────────────────── */
.text-logo {
  font-family: var(--font-serif);
  font-size: var(--text-logo);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  color: rgba(255, 255, 255, 0.87);
}

.text-h1 {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: rgba(255, 255, 255, 0.95);
}

.text-h1--dark {
  color: var(--foreground-primary);
}

.text-h2 {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--foreground-primary);
}

.text-subtitle {
  font-size: var(--text-body);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.73);
}

.text-subtitle--dark {
  color: var(--foreground-secondary);
}

.text-caption {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-wide);
  color: rgba(255, 255, 255, 0.53);
}

.text-caption--dark {
  color: var(--foreground-muted);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--text-button);
  font-weight: var(--weight-semibold);
  padding: 18px var(--space-8);
  border-radius: var(--radius-pill);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent-primary);
  color: var(--foreground-on-accent);
  box-shadow: var(--shadow-accent);
}

.btn--primary:hover { opacity: 0.92; }

.btn--ghost {
  background: transparent;
  color: var(--foreground-secondary);
  border: 1.5px solid var(--border-subtle);
}

/* ─── Option Cards (style/room picker) ─────────────────── */
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-6);
}

.option-card {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.option-card:active { transform: scale(0.97); }

.option-card.selected {
  border-color: var(--accent-primary);
}

.option-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.option-card__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(0deg, rgba(26,26,26,0.75) 0%, transparent 100%);
  font-family: var(--font-serif);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: #FFFFFF;
}

/* ─── Product Cards ─────────────────────────────────────── */
.product-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
}

.product-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.product-card__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-card__name {
  font-family: var(--font-serif);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--foreground-primary);
}

.product-card__desc {
  font-size: var(--text-body-sm);
  color: var(--foreground-secondary);
  line-height: var(--leading-relaxed);
}

.product-card__price {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--accent-primary);
  margin-top: var(--space-1);
}

/* ─── Screen Header ─────────────────────────────────────── */
.screen-header {
  padding: var(--space-12) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  color: var(--foreground-muted);
  padding: 0;
  margin-bottom: var(--space-4);
}

/* ─── Progress Bar ──────────────────────────────────────── */
.progress-bar {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6) 0;
}

.progress-bar__dot {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-secondary);
  transition: background var(--transition-normal);
}

.progress-bar__dot.active {
  background: var(--accent-primary);
}

/* ─── Form ──────────────────────────────────────────────── */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form__label {
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: var(--foreground-secondary);
}

.form__input,
.form__textarea {
  width: 100%;
  padding: var(--space-4);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--foreground-primary);
  transition: border-color var(--transition-fast);
  outline: none;
}

.form__input:focus,
.form__textarea:focus {
  border-color: var(--accent-primary);
}

.form__textarea {
  resize: none;
  min-height: 120px;
  line-height: var(--leading-relaxed);
}

/* ─── Bottom Action Bar ─────────────────────────────────── */
.action-bar {
  padding: var(--space-6);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  margin-top: auto;
}

/* ─── Safe-area hero (iPhone notch/Dynamic Island) ──────── */
.hero-content {
  padding-top: calc(var(--space-15) + env(safe-area-inset-top, 0px));
}

/* ─── Scherm animaties ──────────────────────────────────── */
@keyframes screenEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen--entering {
  animation: screenEnter var(--transition-normal) ease forwards;
}

/* ─── Skeleton laadstate (productfoto's) ────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.product-card__image {
  background: linear-gradient(
    90deg,
    var(--surface-secondary) 25%,
    #e8e0d8 50%,
    var(--surface-secondary) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

.product-card__image.loaded {
  background: none;
  animation: none;
}
