/* ============================================================
   SABATIFOTOGRAFIA — components.css
   Reusable UI atoms & molecules
   ============================================================ */

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  outline: none;
}

.btn:focus-visible {
  box-shadow: var(--shadow-glow);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Primary / Accent */
.btn--accent {
  background: var(--accent);
  color: #0D0D0D;
}

.btn--accent:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.btn--accent:active { transform: scale(0.99); }

/* Secondary */
.btn--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}

.btn--secondary:hover {
  background: var(--text);
  color: var(--bg-primary);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(255,107,26,0.35);
  padding: 12px 24px;
}

.btn--ghost:hover {
  background: rgba(255,107,26,0.08);
  border-color: var(--accent);
}

/* Dark (used on gradient bg) */
.btn--dark {
  background: #0D0D0D;
  color: var(--accent);
  border: 1px solid rgba(13,13,13,0.2);
}

.btn--dark:hover {
  background: #1a1a1a;
}

/* Sizes */
.btn--sm {
  font-size: var(--text-xs);
  padding: 8px 16px;
}

.btn--lg {
  font-size: var(--text-base);
  padding: 16px 32px;
}

.btn--full { width: 100%; }

/* Loading state */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.is-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 600ms linear infinite;
}

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

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  line-height: 1;
}

.badge--orange { background: var(--accent);          color: #0D0D0D; }
.badge--yellow { background: var(--accent-yellow);   color: #0D0D0D; }
.badge--cyan   { background: var(--accent-cyan);     color: #0D0D0D; }
.badge--green  { background: var(--success);         color: #0D0D0D; }
.badge--red    { background: var(--error);           color: #fff; }

/* ── PRODUCT CARD ───────────────────────────────────────────── */
.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--dur-base) var(--ease-out);
}

.product-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.product-card.is-hidden {
  display: none;
}

.product-card__media {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-elevated);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.product-card:hover .product-card__media img {
  transform: scale(1.04);
}

.product-card__badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 1;
}

.product-card__body {
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card__category {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.product-card__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.product-card__specs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-5);
  flex: 1;
}

.product-card__spec {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.product-card__spec i {
  color: var(--accent);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.product-card__pricing {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

.product-card__price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}

.price-unit {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.product-card__price--week .price-value {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ── FORM ELEMENTS ──────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-label .req {
  color: var(--accent);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-sm);
  padding: 12px 16px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  outline: none;
  width: 100%;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,107,26,0.12);
}

.form-input.touched:invalid,
.form-select.touched:invalid,
.form-textarea.touched:invalid {
  border-color: var(--error);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A8A8A3' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-elevated);
  color: var(--text);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--error);
  display: none;
}

.form-input.touched:invalid ~ .form-error,
.form-select.touched:invalid ~ .form-error,
.form-textarea.touched:invalid ~ .form-error {
  display: block;
}

/* Checkbox */
.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-elevated);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--accent);
}

.form-checkbox-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.form-checkbox-label a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Form grid layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.form-grid .span-2 { grid-column: 1 / -1; }

/* Honeypot */
.form-honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* Form alert (success / error) */
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  line-height: 1.5;
  animation: alertSlideIn 350ms var(--ease-out) both;
}

@keyframes alertSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

.form-alert i { font-size: 1.125rem; flex-shrink: 0; margin-top: 1px; }

.form-alert--success {
  background: rgba(76,217,100,0.1);
  border: 1px solid rgba(76,217,100,0.3);
  color: var(--success);
}

.form-alert--error {
  background: rgba(255,68,68,0.1);
  border: 1px solid rgba(255,68,68,0.3);
  color: var(--error);
}

/* ── STAT PILL ──────────────────────────────────────────────── */
.stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.stat-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-pill i { color: var(--accent); }

/* ── FOCUS VISIBLE (accessibility) ─────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── MICROCOPY ──────────────────────────────────────────────── */
.microcopy {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.microcopy i { color: var(--accent); font-size: 0.875rem; }

/* ── SECTION DIVIDER ────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin-block: 0;
  border: none;
}

/* ── CTA BANNER (inline) ────────────────────────────────────── */
.cta-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-12);
  text-align: center;
}

.cta-banner__heading {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 300;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.cta-banner__heading em {
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
}

.cta-banner__body {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  margin-inline: auto;
}

.cta-banner__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ── RESPONSIVE FORM GRID ───────────────────────────────────── */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}
