/* Shared optional sections (builder, steps, FAQ, phone action bar, reveal). Uses each template's colour tokens:
   --primary, --accent, --line, --muted, --surface (+ --text in garage / --ink in furniture). */

/* ---- WhatsApp request builder ---- */
.builder-card {
  display: grid; gap: 22px; padding: 22px; border-radius: var(--radius, 18px);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
    var(--surface);
}
.builder-head { display: grid; gap: 4px; justify-items: start; }
.tyre-art { width: min(64vw, 240px); height: auto; margin: 14px auto 0; justify-self: center; filter: drop-shadow(0 18px 30px rgba(0,0,0,.45)); }
.tyre-spin { transform-origin: 120px 120px; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.bf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bf { display: grid; gap: 6px; font-weight: 700; font-size: .9rem; }
.bf-wide { grid-column: 1 / -1; }
.bf span { color: var(--muted); }
.bf select, .bf input {
  width: 100%; min-height: 48px; padding: 0 12px; border-radius: 12px; font: inherit; font-weight: 700; font-size: 1rem;
  color: inherit; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line);
  appearance: none; -webkit-appearance: none;
}
.bf select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
  padding-inline-end: 30px;
}
[dir="rtl"] .bf select:not([dir="ltr"]) { background-position: 13px 52%, 18px 52%; }
.bf select:focus, .bf input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.bf-preview { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); }
.bf-preview span { display: block; font-size: .8rem; color: var(--muted); font-weight: 700; }
.bf-preview p { margin: 4px 0 0; white-space: pre-line; font-weight: 600; }
.builder-form .btn { margin-top: 14px; width: 100%; }

/* ---- Photo field (builder) ---- */
.bf-photo [hidden], .bf-step2 [hidden], .bf-step2[hidden] { display: none !important; }
.bf-photo-pick { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 10px 14px; border: 2px dashed currentColor; border-radius: 12px; cursor: pointer; text-align: center; opacity: .9; }
.bf-photo-pick .ic { width: 26px; height: 26px; color: var(--primary); }
.bf-photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bf-photo-ok { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.bf-photo-ok img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.bf-photo-ok b { flex: 1; color: #2BD46A; }
.bf-photo-ok button { font: inherit; font-size: .85rem; background: none; border: 1px solid var(--line); color: inherit; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.bf-step2 { margin-top: 14px; padding: 14px; border-radius: 12px; border: 2px solid var(--primary); display: grid; gap: 10px; animation: step2 .5s ease; }
.bf-step2 .btn { width: 100%; }
.bf-step2-alt { font-size: .85rem; color: var(--muted); }
@keyframes step2 { from { opacity: 0; transform: translateY(10px); } }

/* ---- Steps ---- */
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; counter-reset: s; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius, 18px); border: 1px solid var(--line); background: var(--surface); }
.step h3 { font-size: 1.1rem; }
.step p { margin: 4px 0 0; color: var(--muted); }
.step-n {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font-weight: 800; font-size: 1.1rem; color: var(--on-primary, #fff); background: var(--primary);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent);
}

/* ---- FAQ ---- */
.faq { margin-top: 24px; display: grid; gap: 10px; }
.faq-item { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; font-weight: 700; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-x { flex: none; width: 22px; height: 22px; border-radius: 50%; position: relative; background: color-mix(in srgb, var(--primary) 15%, transparent); }
.faq-x::before, .faq-x::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 10px; height: 2px; background: var(--primary); transform: translate(-50%, -50%); transition: transform .2s; }
.faq-x::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] .faq-x::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq-item p { margin: 0; padding: 0 18px 16px; color: var(--muted); }

/* ---- Phone action bar ---- */
.mbar {
  position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.mbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 14px; font-size: .78rem; font-weight: 700; }
.mbar a .ic { width: 22px; height: 22px; }
.mbar .mbar-wa { background: var(--wa, #25d366); color: #06210f; }
body:has(.mbar) .wa-float { display: none; }
body:has(.mbar) .foot { padding-bottom: 120px; }

/* ---- Reveal on scroll (added by JS only to elements below the fold) ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { flex-direction: column; }
}
@media (min-width: 900px) {
  .builder-card { grid-template-columns: 1fr 1.15fr; align-items: center; padding: 34px; gap: 36px; }
  .tyre-art { width: 260px; }
  .faq-wrap { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; align-items: start; }
  .faq-wrap .faq { margin-top: 0; }
  .mbar { display: none; }
  body:has(.mbar) .wa-float { display: grid; }
  body:has(.mbar) .foot { padding-bottom: 110px; }
}
