/* Product Request form — front-end.
   Reuses the theme's existing .rc-input / .rc-btn / .rc-btn--primary
   classes for text fields and the submit button; only the pieces that
   don't already exist (labels, file dropzone, thumbnail previews,
   success/error state) are defined here. Kept as its own file rather than
   merged into app.css so the feature stays a self-contained, liftable unit. */

.rc-pr-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 32rem;
}
.rc-pr-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.rc-pr-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rc-text);
}
.rc-pr-label span {
  color: var(--rc-primary);
}
.rc-pr-textarea {
  min-height: 8rem;
  resize: vertical;
  font-family: inherit;
}

/* Real file input is visually hidden (not display:none) so it stays
   keyboard-focusable and announced correctly — the visible surface is the
   label around it, styled as a dropzone below. */
.rc-pr-file {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.rc-pr-dropzone {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  border-radius: var(--rc-radius-sm);
  border: 1.5px dashed var(--rc-border);
  background: var(--rc-surface);
  color: var(--rc-muted);
  cursor: pointer;
  transition: border-color 180ms, background 180ms, color 180ms;
}
.rc-pr-dropzone:hover { border-color: var(--rc-primary); color: var(--rc-text); }
.rc-pr-dropzone:has(.rc-pr-file:focus-visible) {
  border-color: var(--rc-primary);
  outline: 2px solid var(--rc-primary);
  outline-offset: 2px;
}
.rc-pr-dropzone--active {
  border-color: var(--rc-primary);
  border-style: solid;
  background: color-mix(in srgb, var(--rc-primary) 8%, var(--rc-surface));
  color: var(--rc-text);
}
.rc-pr-dropzone__icon { flex-shrink: 0; color: var(--rc-primary); }
.rc-pr-dropzone__text { font-size: 0.8125rem; line-height: 1.4; }
.rc-pr-dropzone__text strong { color: var(--rc-text); font-weight: 600; }

.rc-pr-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.625rem;
}
.rc-pr-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--rc-border);
  background: var(--rc-surface);
  box-shadow: var(--rc-shadow-sm);
  transition: transform 150ms;
}
.rc-pr-thumb:hover { transform: translateY(-2px); }
.rc-pr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-pr-thumb__remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, transform 150ms;
}
.rc-pr-thumb__remove:hover { background: rgba(0, 0, 0, 0.8); transform: scale(1.1); }

.rc-pr-msg {
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  margin: 0;
}
.rc-pr-msg--error {
  background: color-mix(in srgb, #dc2626 12%, var(--rc-white));
  color: #b91c1c;
}
.rc-pr-msg--success {
  background: color-mix(in srgb, #16a34a 12%, var(--rc-white));
  color: #15803d;
}

.rc-pr-submit {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}
.rc-pr-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── CTA banner — [rc_product_request_cta] ─────────────────────────────────
   Every color here is a theme custom property so this renders correctly on
   every pre-built palette, including "Midnight" (dark) — --rc-surface,
   --rc-text, --rc-border, --rc-muted, --rc-primary all flip appropriately
   per [data-rc-variant] (see dist/css/app.css's :root + variant blocks). No
   hardcoded hex/rgb colors anywhere in this section. */
.rc-pr-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.rc-pr-cta__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rc-white);
  color: var(--rc-primary);
  border: 1px solid var(--rc-border);
}
.rc-pr-cta__body { flex: 1; min-width: 200px; }
.rc-pr-cta__heading {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--rc-text);
  margin: 0 0 0.125rem;
}
.rc-pr-cta__desc {
  font-size: 0.8125rem;
  color: var(--rc-muted);
  margin: 0;
}
.rc-pr-cta__btn { flex-shrink: 0; white-space: nowrap; }

/* ── Frosted-glass modal — matches the theme's shared .rc-backdrop values
   (dist/css/app.css) and reuses its themeable blur variable directly, so a
   site's actual configured blur intensity (Customizer → Performance) is
   respected here too rather than a value hardcoded independently of it. Kept
   as its own implementation (not the shared .rc-backdrop element) rather
   than wiring into the core rcApp() open-state — see the plan doc for why. */
.rc-pr-modal { position: fixed; inset: 0; z-index: 1200; }
.rc-pr-modal-enter { transition: opacity 260ms ease; }
.rc-pr-modal-enter-start, .rc-pr-modal-enter-end { opacity: 1; }
.rc-pr-modal-enter-start { opacity: 0; }
.rc-pr-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 40%, color-mix(in srgb, var(--rc-primary) 16%, transparent), transparent 70%),
    rgba(0, 0, 0, 0.45);
  backdrop-filter: var(--rc-backdrop-blur, blur(10px));
  -webkit-backdrop-filter: var(--rc-backdrop-blur, blur(10px));
  cursor: zoom-out;
}
.rc-pr-modal__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  overflow-y: auto;
}

/* Panel gets its own pop-in, independent of the backdrop's plain fade —
   a soft ease-out-expo scale+rise reads a lot less mechanical than a flat
   fade alone. Declared on the panel itself; Alpine applies these classes
   to any descendant carrying x-transition when the ancestor's x-show
   toggles, no extra JS needed. */
.rc-pr-panel-pop { transition: opacity 320ms cubic-bezier(0.16, 1, 0.3, 1), transform 320ms cubic-bezier(0.16, 1, 0.3, 1); }
.rc-pr-panel-pop-start { opacity: 0; transform: scale(0.94) translateY(10px); }
.rc-pr-panel-pop-end { opacity: 1; transform: scale(1) translateY(0); }

.rc-pr-modal__panel {
  position: relative;
  width: 100%;
  max-width: 30rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--rc-white);
  color: var(--rc-text);
  border-radius: var(--rc-radius-lg);
  box-shadow: var(--rc-shadow-lg), 0 30px 60px -24px color-mix(in srgb, var(--rc-primary) 35%, transparent);
  padding: 2.25rem 2rem 2rem;
}
.rc-pr-modal__panel::before {
  content: "";
  position: absolute;
  top: 0; left: 1.5rem; right: 1.5rem;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--rc-primary), var(--rc-accent, var(--rc-primary)));
  opacity: 0.85;
}

.rc-pr-modal__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}
.rc-pr-modal__icon {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--rc-primary), var(--rc-primary-dark, var(--rc-primary)));
  color: var(--rc-btn-text, #fff);
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--rc-primary) 55%, transparent);
  margin-bottom: 0.25rem;
}
.rc-pr-modal__icon::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--rc-primary) 30%, transparent);
  animation: rc-pr-icon-pulse 2.6s ease-out infinite;
}
@keyframes rc-pr-icon-pulse {
  0%   { transform: scale(0.85); opacity: 0.7; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
.rc-pr-modal__title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--rc-text);
  margin: 0;
}
.rc-pr-modal__subtitle {
  font-size: 0.875rem;
  color: var(--rc-muted);
  margin: 0;
  max-width: 26rem;
}
.rc-pr-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: var(--rc-surface);
  color: var(--rc-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, color 150ms, transform 200ms;
}
.rc-pr-modal__close:hover { background: var(--rc-border); color: var(--rc-text); transform: rotate(90deg); }

@media (max-width: 600px) {
  .rc-pr-cta { flex-direction: column; align-items: flex-start; text-align: left; }
  .rc-pr-cta__btn { width: 100%; text-align: center; }
  .rc-pr-modal__inner { padding: 0.75rem; }
  .rc-pr-modal__panel { padding: 1.75rem 1.5rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-pr-modal-enter,
  .rc-pr-panel-pop { transition: opacity 120ms linear !important; }
  .rc-pr-panel-pop-start, .rc-pr-panel-pop-end { transform: none !important; }
  .rc-pr-modal__icon::after { animation: none !important; }
}
