:root {
  --bg: #f8f4ef;
  --fg: #2f2a26;
  --muted: #5a514a;
  --accent: #6b2f45;
  --accent-soft: #f2d6d0;
  --line: rgba(47, 42, 38, 0.08);
  --card: #fffdfa;
  --serif: "Playfair Display", "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--fg);
  line-height: 1.2;
  margin-top: 0;
}

p {
  margin-top: 0;
}

a {
  color: inherit;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 250, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.08em;
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.desktop-only {
  display: block;
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1rem;
}

.site-nav a {
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.site-nav a.active, .site-nav a:hover {
  background: rgba(107, 47, 69, 0.1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
}

/* Hero + sections */
.hero {
  padding: 4rem 1.5rem 3rem;
  background: linear-gradient(135deg, #f8efea, #f1d9d1 60%, #ecd2ca);
}

.hero__content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.badge {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 25px rgba(107, 47, 69, 0.25);
}

.btn.ghost {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn.full {
  width: 100%;
}

.btn:active {
  transform: translateY(1px);
}

.section {
  padding: 4rem 1.5rem;
}

.section__intro {
  max-width: 720px;
  margin: 0 auto 3rem;
  text-align: center;
}

.callout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.callout {
  background: var(--card);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s ease;
}

.callout span {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.callout:hover {
  transform: translateY(-4px);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.gallery__grid article {
  background: var(--card);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  text-align: center;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline li {
  background: var(--card);
  border-radius: 22px;
  padding: 1.5rem;
  border: 1px solid var(--line);
}

.timeline span {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}

/* Catalog */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  gap: 0.35rem;
  text-align: left;
}

select, input, textarea {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fff;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.flower-card {
  background: var(--card);
  padding: 1.25rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 20px 35px rgba(44, 29, 21, 0.05);
}

.flower-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
}

.flower-card__meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.link-card {
  text-decoration: none;
  color: inherit;
}

.catalog-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* PDP */
.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 2rem;
  padding: 4rem 1.5rem;
}

.pdp__media figure {
  margin: 0 0 1.5rem;
  background: var(--card);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid var(--line);
}

.pdp__media figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.pdp__price {
  font-size: 1.3rem;
  font-weight: 600;
}

.pdp__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.pdp__meta {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Story */
.story {
  padding: 4rem 1.5rem;
  width: 100%;
  margin: 0 auto;
}

.story__hero {
  text-align: center;
  margin-bottom: 3rem;
}

.story__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.story-card {
  box-shadow: 0 20px 35px rgba(44, 29, 21, 0.05);
}

/* Contact */
.contact {
  background: linear-gradient(135deg, #f7ece4, #f1d8d0);
}

.contact-form {
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.form-status {
  font-size: 0.95rem;
  color: var(--accent);
}

/* Footer */
.site-footer {
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-left: 1rem;
}

/* Atelier */
body.page-atelier {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.atelier-app {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 2rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.canvas-panel {
  background: var(--card);
  border-radius: 32px;
  padding: 2rem;
  border: 1px solid var(--line);
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  width: 100%;
  justify-self: center;
}

.fullscreen-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  border: none;
  background: rgba(47, 42, 38, 0.1);
  color: var(--accent);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
}

.mannequin-shell {
  border-radius: 28px;
  border: 1px dashed rgba(47, 42, 38, 0.2);
  padding: 1rem;
  background: #fff;
  flex: 1;
  display: flex;
}

.mannequin {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1100 / 3600;
  max-height: calc(100vh - 240px);
  background: linear-gradient(180deg, #fefefe, #f5ebdf);
  touch-action: none;
}

.mannequin__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.mannequin__drops {
  position: absolute;
  inset: 0;
  touch-action: none;
}

.helper-text {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 1.5rem 0 1rem;
}


.control-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.flower-panel__controls {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.flower-panel__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.flower-panel__buttons .btn {
  flex: 1;
  min-width: 140px;
}

.flower-panel__customizer {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.flower-panel__customizer[hidden] {
  display: none;
}

.flower-panel__customizer .form-grid {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.span-cols {
  grid-column: 1 / -1;
}

.atelier-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.atelier-catalog__item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.75rem;
  text-align: center;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.atelier-catalog__item small {
  color: var(--muted);
  font-size: 0.8rem;
}

.atelier-catalog__item img {
  width: 100%;
  height: 110px;
  object-fit: contain;
}

.atelier-catalog__item.active {
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(107, 47, 69, 0.15);
}

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 1.75rem;
  border: 1px solid var(--line);
  box-shadow: 0 20px 35px rgba(44, 29, 21, 0.05);
  position: relative;
}

.card__header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.form-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.summary {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.summary ul {
  padding: 0;
  list-style: none;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: grid;
  gap: 0.35rem;
}

.cart__items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.cart-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
}

.cart-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.cart-item__meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.cart-item__meta strong {
  color: var(--fg);
  display: block;
}

.cart-item button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.stats {
  display: flex;
  gap: 2rem;
}

.stats__value {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--serif);
}

.stats__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.stats--inline {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.cart-stats {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-bottom: 1rem;
}

/* Placed flowers */
.placed-flower {
  position: absolute;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%) scale(1);
  cursor: grab;
  transition: box-shadow 0.2s ease;
  border-radius: 50%;
}

.placed-flower img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.placed-flower.selected {
  box-shadow: 0 0 0 3px rgba(107, 47, 69, 0.35);
  border-radius: 50%;
}

.placed-flower__actions {
  position: absolute;
  top: -14px;
  right: -14px;
  display: none;
  gap: 4px;
}

.placed-flower__actions button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 0.8rem;
}

.placed-flower__actions .remove {
  background: var(--accent);
}

.placed-flower.selected .placed-flower__actions {
  display: flex;
}

.mannequin-modal[hidden] {
  display: none;
}

.mannequin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 40;
  padding: 1.5rem;
}

.mannequin-modal__inner {
  background: var(--card);
  border-radius: 32px;
  padding: 1.5rem;
  width: min(90vw, 900px);
  height: min(95vh, 900px);
  display: flex;
  flex-direction: column;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  border: none;
  background: rgba(47, 42, 38, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
}

.modal-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 1rem;
}

#modalCanvas {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mannequin--modal {
  width: auto;
  height: 100%;
  max-height: 100%;
  aspect-ratio: 1100 / 3600;
  transform-origin: center;
  transition: transform 0.2s ease;
  will-change: transform;
  margin: 0 auto;
}

.modal-zoom {
  position: absolute;
  bottom: 2rem;
  right: 1.5rem;
  display: flex;
  gap: 0.5rem;
}

.modal-zoom button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.modal-zoom,
.modal-close {
  z-index: 5;
}


/* Mobile overlays for Atelier */
.sheet {
  position: relative;
}

.sheet__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
}

.fab-bar {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  padding: 0 1.5rem;
  justify-content: space-between;
  gap: 1rem;
  z-index: 15;
}

.fab {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 0.75rem 1rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.fab__icon {
  font-size: 1rem;
}

.fab__badge {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  font-size: 0.85rem;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 12;
}

.sheet-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1024px) {
  .flower-panel__buttons {
    flex-direction: column;
  }
}

.card.customizer.hidden-desktop {
  display: none;
}

.card.customizer.hidden-desktop.is-visible {
  display: block;
}

@media (max-width: 1024px) {
  .card.customizer.hidden-desktop {
    display: block;
  }
}

.customizer__preview {
  width: 160px;
  height: 160px;
  margin: 0 auto 1rem;
  position: relative;
}

.customizer__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 1024px) {
  .desktop-only {
    display: none;
  }

  .pdp {
    grid-template-columns: 1fr;
  }

  .site-header__inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .site-nav {
    width: 100%;
    flex-direction: column;
    display: none;
    margin: 1rem 0 0;
  }

  .site-nav.open {
    display: flex;
  }

  .callout-grid {
    grid-template-columns: 1fr;
  }

  .atelier-app {
    grid-template-columns: 1fr;
    padding-bottom: 6rem;
  }

  .control-panel {
    display: contents;
  }

  .sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-radius: 24px 24px 0 0;
    z-index: 20;
    max-height: 90vh;
    overflow-y: auto;
  }

  .sheet.active {
    transform: translateY(0);
  }

  .sheet__close {
    display: block;
  }

  .fab-bar {
    display: flex;
  }
}

.compact-mode .desktop-only {
  display: none;
}

.compact-mode .atelier-app {
  grid-template-columns: 1fr;
  padding-bottom: 6rem;
}

.compact-mode .control-panel {
  display: contents;
}

.compact-mode .canvas-panel {
  max-width: none;
}

.compact-mode .sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  border-radius: 24px 24px 0 0;
  z-index: 20;
  max-height: 90vh;
  overflow-y: auto;
}

.compact-mode .sheet.active {
  transform: translateY(0);
}

.compact-mode .sheet__close {
  display: block;
}

.compact-mode .fab-bar {
  display: flex;
}

@media (max-width: 720px) {
  .hero {
    padding: 3rem 1rem;
  }

  .section {
    padding: 3rem 1rem;
  }

  .gallery__grid {
    grid-template-columns: 1fr;
  }

  .placed-flower {
    width: 96px;
    height: 96px;
  }

  .atelier-catalog {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 220px);
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x proximity;
  }

  .atelier-catalog__item {
    scroll-snap-align: start;
  }
}
