/* ==============================
   TRIBO — Generator & Merch Preview CSS
   ============================== */

/* ── Body ─────────────────────────────────────────────────── */
.gen-body {
  background: var(--bg);
}

/* ── Main layout ──────────────────────────────────────────── */
.gen-main {
  padding-top: 80px; /* clear fixed nav */
  min-height: 100vh;
  position: relative;
}

.gen-section {
  padding: 4rem 1.5rem;
  transition: opacity 0.3s ease;
}

.gen-section--hidden {
  display: none;
}

.gen-container {
  max-width: 680px;
  margin: 0 auto;
}

.gen-container--wide {
  max-width: 960px;
  margin: 0 auto;
}

/* ── Typography ───────────────────────────────────────────── */
.gen-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.gen-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.gen-sub {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg-light);
  margin-bottom: 2rem;
}

/* ── Form ─────────────────────────────────────────────────── */
.gen-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gen-textarea {
  width: 100%;
  padding: 1.25rem 1.5rem;
  border: 2px solid rgba(26, 61, 46, 0.18);
  border-radius: 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--white);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.gen-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 98, 42, 0.1);
}

.gen-textarea--error {
  border-color: #e84242 !important;
  box-shadow: 0 0 0 4px rgba(232, 66, 66, 0.12) !important;
}

.gen-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.char-count {
  font-size: 0.78rem;
  color: var(--fg-light);
  opacity: 0.6;
}

/* ── Buttons ──────────────────────────────────────────────── */
.gen-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 0.85rem 2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.gen-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.gen-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.gen-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1.5px solid rgba(26, 61, 46, 0.2);
  border-radius: 100px;
  padding: 0.65rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-light);
  cursor: pointer;
  margin-top: 1.5rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.gen-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.gen-btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green);
  color: var(--bg);
  border: none;
  border-radius: 100px;
  padding: 0.85rem 2rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.gen-btn-share:hover { background: #142e22; transform: translateY(-1px); }

/* ── Error ────────────────────────────────────────────────── */
.gen-error {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(232, 66, 66, 0.08);
  border: 1px solid rgba(232, 66, 66, 0.2);
  border-radius: 10px;
  color: #c53030;
  font-size: 0.88rem;
}

/* ── Loading overlay ──────────────────────────────────────── */
.gen-loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.gen-loading-inner {
  text-align: center;
}

.gen-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(232, 98, 42, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.gen-loading-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg);
  margin-bottom: 0.4rem;
}

.gen-loading-sub {
  font-size: 0.85rem;
  color: var(--fg-light);
}

/* ── Logo grid ────────────────────────────────────────────── */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.logo-card {
  background: var(--white);
  border: 2px solid rgba(26, 61, 46, 0.1);
  border-radius: 20px;
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.logo-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(232, 98, 42, 0.12);
  transform: translateY(-2px);
}

.logo-card--selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(232, 98, 42, 0.15), 0 8px 30px rgba(232, 98, 42, 0.15);
}

.logo-card-svg {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--off-white);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  padding: 1rem;
}

.logo-card-svg svg {
  width: 100%;
  height: 100%;
  max-width: 120px;
  max-height: 120px;
}

.logo-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.logo-card-style {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fg-light);
}

/* ── Product tabs ─────────────────────────────────────────── */
.product-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.product-tab {
  background: var(--off-white);
  border: 1.5px solid rgba(26, 61, 46, 0.12);
  border-radius: 100px;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-tab:hover { border-color: var(--accent); color: var(--accent); }
.product-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}

/* ── Mockup stage ─────────────────────────────────────────── */
.mockup-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 340px;
  margin-bottom: 2.5rem;
}

.mockup-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: fadeIn 0.3s ease;
}

.mockup-wrap--hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.mockup-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-light);
  opacity: 0.6;
}

/* ── CAP mockup ───────────────────────────────────────────── */
.merch-cap {
  position: relative;
  width: 300px;
}

.merch-cap-body {
  position: relative;
  width: 240px;
  height: 120px;
  margin: 0 auto;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: #111;
  overflow: visible;
  box-shadow: 0 24px 70px rgba(0,0,0,0.4), 0 4px 14px rgba(0,0,0,0.25);
}

.merch-cap-panel {
  position: absolute;
  top: 0;
  height: 100%;
  border-right: 1px solid rgba(255,255,255,0.05);
  border-radius: inherit;
  overflow: hidden;
}

.merch-cap-body .p1 { left: 0; width: 25%; background: #111; }
.merch-cap-body .p2 { left: 25%; width: 25%; background: #1c1c1c; }
.merch-cap-body .p3 { left: 50%; width: 25%; background: #151515; }
.merch-cap-body .p4 { left: 75%; width: 25%; background: #0d0d0d; }

.merch-cap-visor {
  position: absolute;
  bottom: -22px;
  left: -24px;
  right: -24px;
  height: 44px;
  background: #0a0a0a;
  border-radius: 0 0 60% 60% / 0 0 100% 100%;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  z-index: 2;
}

.merch-cap-button {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2a2a2a;
  z-index: 3;
}

/* Logo slot — centered on the cap front panel */
.merch-cap-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 72px;
  height: 72px;
  z-index: 4;
  /* Blend with the fabric: multiply darkens over black panels */
  mix-blend-mode: screen;
  display: flex;
  align-items: center;
  justify-content: center;
}

.merch-cap-logo svg {
  width: 100%;
  height: 100%;
}

/* ── TEE mockup ───────────────────────────────────────────── */
.merch-tee {
  position: relative;
  width: 260px;
}

.merch-tee-body {
  position: relative;
  width: 180px;
  height: 220px;
  background: #111;
  border-radius: 4px 4px 8px 8px;
  margin: 30px auto 0;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
}

/* Subtle fabric texture via gradient */
.merch-tee-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

.merch-tee-collar {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 28px;
  background: #111;
  border-radius: 0 0 50% 50%;
  border-top: 2px solid #1c1c1c;
}

.merch-tee-sleeve {
  position: absolute;
  width: 62px;
  height: 90px;
  top: 0;
  background: #111;
  border-radius: 4px;
}

.merch-tee-sleeve--left {
  left: -58px;
  transform: rotate(-6deg);
  transform-origin: top right;
}

.merch-tee-sleeve--right {
  right: -58px;
  transform: rotate(6deg);
  transform-origin: top left;
}

/* Logo on chest left */
.merch-tee-logo {
  position: absolute;
  top: 28px;
  left: 20px;
  width: 52px;
  height: 52px;
  mix-blend-mode: screen;
  display: flex;
  align-items: center;
  justify-content: center;
}

.merch-tee-logo svg {
  width: 100%;
  height: 100%;
}

/* ── HOODIE mockup ────────────────────────────────────────── */
.merch-hoodie {
  position: relative;
  width: 280px;
}

.merch-hoodie-body {
  position: relative;
  width: 190px;
  height: 240px;
  background: #111;
  border-radius: 6px 6px 10px 10px;
  margin: 0 auto;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
}

.merch-hoodie-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

.merch-hoodie-hood {
  position: absolute;
  top: -44px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 80px;
  background: #111;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
}

.merch-hoodie-pocket {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 42px;
  border-top: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 0 0 6px 6px;
}

.merch-hoodie-sleeve {
  position: absolute;
  width: 68px;
  height: 100px;
  top: 10px;
  background: #111;
  border-radius: 4px;
}

.merch-hoodie-sleeve--left {
  left: -62px;
  transform: rotate(-5deg);
  transform-origin: top right;
}

.merch-hoodie-sleeve--right {
  right: -62px;
  transform: rotate(5deg);
  transform-origin: top left;
}

/* Logo chest center */
.merch-hoodie-logo {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  mix-blend-mode: screen;
  display: flex;
  align-items: center;
  justify-content: center;
}

.merch-hoodie-logo svg {
  width: 100%;
  height: 100%;
}

/* ── Preview actions ──────────────────────────────────────── */
.preview-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
}

.share-toast {
  position: absolute;
  top: -44px;
  left: 0;
  background: var(--green);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.share-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .logo-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }

  .logo-card {
    padding: 1rem;
  }

  .logo-card-svg {
    padding: 0.6rem;
  }

  .product-tabs {
    gap: 0.4rem;
  }

  .product-tab {
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
  }

  .merch-cap-body {
    width: 200px;
    height: 100px;
  }

  .merch-tee-body {
    width: 150px;
    height: 185px;
  }

  .merch-tee-sleeve {
    width: 52px;
    height: 75px;
  }

  .merch-tee-sleeve--left { left: -48px; }
  .merch-tee-sleeve--right { right: -48px; }

  .merch-hoodie-body {
    width: 160px;
    height: 200px;
  }

  .merch-hoodie-sleeve {
    width: 56px;
    height: 84px;
  }

  .merch-hoodie-sleeve--left { left: -50px; }
  .merch-hoodie-sleeve--right { right: -50px; }

  .gen-section {
    padding: 3rem 1.25rem;
  }

  .preview-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
