* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f7f5f2;
  color: #2b2420;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 1.5rem 1.25rem 3rem;
}

/* !important is deliberate: this is a utility class meant to force-hide an
   element regardless of its own component styles (e.g. .primary-button sets
   display:block, same specificity as .hidden, declared later in this file -
   without !important the cascade would silently keep the element visible). */
.hidden {
  display: none !important;
}

h1 {
  font-size: 1.5rem;
  text-align: center;
  margin: 1rem 0 1.5rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.back-button {
  border: none;
  background: none;
  color: #8a6d5c;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.5rem 0;
}

.draft-banner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.draft-banner.hidden {
  display: none;
}

.draft-banner p {
  margin: 0;
  font-size: 0.95rem;
}

.draft-banner-actions {
  display: flex;
  gap: 0.6rem;
}

.draft-banner-actions .primary-button,
.draft-banner-actions .secondary-button {
  flex: 1;
  margin-top: 0;
  text-align: center;
}

/* Category screen */
.category-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  border: none;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  font-size: 1.2rem;
  font-weight: 600;
  color: #2b2420;
  cursor: pointer;
}

.category-emoji {
  font-size: 2.5rem;
}

/* Carousel screen: sticky type nav + one section per type, each holding its
   own auto-rotating mini carousel (see app.js renderTypeSections). */
.type-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin: 0 -1.25rem 1rem;
  padding: 0.75rem 1.25rem;
  background: #f7f5f2;
  border-bottom: 1px solid #ece5dc;
  scrollbar-width: none;
}

.type-nav::-webkit-scrollbar {
  display: none;
}

.type-nav.hidden {
  display: none;
}

.type-tab {
  flex: 0 0 auto;
  padding: 0.5rem 1.1rem;
  border: 1px solid #d8cfc5;
  border-radius: 999px;
  background: #fff;
  color: #6b5d52;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.type-section {
  margin-bottom: 2.25rem;
  /* Keeps the heading clear of the sticky nav after tab-click scrollIntoView. */
  scroll-margin-top: 4rem;
}

.type-section h2 {
  font-size: 1.2rem;
  text-align: center;
  margin: 0 0 1rem;
}

.mini-carousel-track {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.mini-carousel-track::-webkit-scrollbar {
  display: none;
}

.mini-carousel-card {
  position: relative;
  flex: 0 0 calc((100% - 1.2rem) / 3);
  scroll-snap-align: start;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  background: #fff;
  cursor: pointer;
}

.mini-carousel-card img {
  display: block;
  width: 100%;
  aspect-ratio: 390 / 844;
  object-fit: cover;
  background: #eee;
}

.mini-carousel-card-name {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.4rem 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background: rgba(43, 36, 32, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.mini-carousel-card.revealed .card-overlay {
  opacity: 1;
  pointer-events: auto;
}

.card-action {
  width: 100%;
  padding: 0.45rem 0.3rem;
  border: none;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.card-action-select {
  background: #8a6d5c;
  color: #fff;
}

.card-action-view {
  background: #fff;
  color: #2b2420;
}

/* Buttons */
.primary-button {
  display: block;
  width: 100%;
  padding: 0.9rem;
  margin-top: 1rem;
  border: none;
  border-radius: 999px;
  background: #8a6d5c;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.primary-button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* .primary-button is also used on the confirmation screen's <a> WhatsApp
   link, which needs the anchor defaults (underline, inline text) reset. */
.whatsapp-button {
  text-align: center;
  text-decoration: none;
  background: #25d366;
}

.secondary-button {
  padding: 0.7rem 1.1rem;
  border: 1px solid #8a6d5c;
  border-radius: 999px;
  background: none;
  color: #8a6d5c;
  font-size: 0.95rem;
  cursor: pointer;
}

/* Wizard screen - the live preview fills the whole screen behind a
   translucent, frosted-glass panel that floats over it, so the customer can
   see (through/around the panel) roughly what their guests will see while
   they're still editing, rather than a small preview pinned above a solid
   editing form. */
#screen-wizard {
  position: fixed;
  inset: 0;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}

.preview-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.wizard-back-button {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.wizard-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  max-height: 62vh;
  overflow: hidden;
  background: rgba(247, 245, 242, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
}

.wizard-steps {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.25rem 1.25rem 0.5rem;
}

.wizard-step {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.wizard-step.active {
  display: flex;
}

.wizard-step label {
  font-size: 0.85rem;
  color: #6b5d52;
  margin-top: 0.5rem;
}

.wizard-step input[type='text'],
.wizard-step input[type='date'],
.wizard-step input[type='time'] {
  padding: 0.65rem 0.85rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}

.wizard-step input[type='file'] {
  font-size: 0.85rem;
  color: #6b5d52;
}

.photo-upload-status {
  font-size: 0.8rem;
  color: #8a6d5c;
  margin: 0.25rem 0 0;
  min-height: 1em;
}

.photo-preview-wrap {
  position: relative;
  margin-top: 0.5rem;
  width: 140px;
}

.photo-preview-wrap.hidden {
  display: none;
}

.photo-preview {
  display: block;
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.photo-preview-remove {
  margin-top: 0.4rem;
  border: none;
  background: none;
  color: #b5432a;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

#music-preview-wrap {
  width: 100%;
  max-width: 320px;
}

#music-preview {
  display: block;
  width: 100%;
}

.collage-preview-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.collage-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
}

.collage-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.collage-preview-item button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #b5432a;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.schedule-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.schedule-row input[type='time'] {
  flex: 0 0 110px;
}

.schedule-row input[type='text'] {
  flex: 1;
}

.schedule-row button {
  border: none;
  background: none;
  color: #b5432a;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
}

.wizard-nav {
  flex: 0 0 auto;
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.wizard-nav .secondary-button {
  flex: 0 0 auto;
}

.wizard-nav .primary-button {
  flex: 1;
  margin-top: 0;
}

/* Confirmation screen */
#screen-confirmation {
  text-align: center;
  padding-top: 3rem;
}

.order-id-line {
  color: #6b5d52;
  font-size: 0.9rem;
}
