/**
 * Comercial Selenia — paleta Rainha / folheados (bege + dourado).
 * Reforço explícito: o shell não depende só de utilitários Tailwind (evita cache/CDN errado).
 */
:root {
  --comercial-gold: #c09530;
  --comercial-surface: #f8f5f0;
  --comercial-ink: #2d2d2d;
  /* Aliases mantidos por compat com nomes antigos (--box-*). */
  --box-gold: var(--comercial-gold);
  --box-surface: var(--comercial-surface);
  --box-ink: var(--comercial-ink);
  /* Padding responsivo de página: 16px no telemóvel → até 40px no desktop. */
  --comercial-page-x: clamp(1rem, 1.4vw + 0.6rem, 2.5rem);
  --comercial-page-y: clamp(1.25rem, 2vw + 0.5rem, 2.5rem);
}

html {
  background-color: var(--comercial-surface);
  color: var(--comercial-ink);
  margin: 0;
  overflow-x: hidden;
  padding: 0;
  width: 100%;
  /* Evita o "zoom-in" do iOS quando o font-size do utilizador é maior. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--comercial-surface) !important;
  color: var(--comercial-ink);
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
}

* {
  box-sizing: border-box;
}

img, video, canvas, svg, picture {
  max-width: 100%;
  height: auto;
}

.font-heading {
  font-family: 'Manrope', 'Inter', sans-serif;
}

/* Telas muito estreitas (≤ 480px): força >= 16px nos campos para o iOS NÃO fazer auto-zoom ao focar. */
@media (max-width: 480px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px;
  }
}

/* Foco visível e consistente para teclado. */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--comercial-gold);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Respeita preferência de menos movimento. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes fadeSlideIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  0% { opacity: 0; transform: scale(0.96) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-fade-slide {
  animation: fadeSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-modal {
  animation: modalIn 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.slicer-detail > summary {
  list-style: none;
}

.slicer-detail > summary::-webkit-details-marker {
  display: none;
}

.slicer-detail[open] .slicer-chevron {
  transform: rotate(180deg);
}

/* Dica visual de scroll em tabelas largas: degradê sutil no canto direito.
   Aplica-se a `.overflow-x-auto` que envolve `<table>` (padrão do Tailwind). */
.overflow-x-auto {
  scrollbar-width: thin;
  /* iOS: scroll por momentum dentro de containers. */
  -webkit-overflow-scrolling: touch;
}

.overflow-x-auto::-webkit-scrollbar {
  height: 8px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
  background-color: rgba(192, 149, 48, 0.45);
  border-radius: 999px;
}

/* Tabelas dentro de containers com overflow ficam mais cómodas no mobile com padding mínimo. */
@media (max-width: 640px) {
  .overflow-x-auto > table {
    font-size: 0.85rem;
  }
}
