/* ===================================================
   BASE MOBILE-FIRST — RESET + SAFE AREAS + CSS VARS
   Carregado ANTES de style.css e admin.css
   =================================================== */

:root {
  /* Safe area insets (iOS notch/home indicator) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  /* Touch targets — Apple HIG = 44px */
  --touch-min: 44px;
  --touch-comfortable: 56px;

  /* Espacamentos fluidos */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Tipografia fluida */
  --fs-xs: clamp(11px, 2.5vw, 12px);
  --fs-sm: clamp(13px, 3vw, 14px);
  --fs-base: clamp(14px, 3.5vw, 16px);
  --fs-md: clamp(16px, 4vw, 18px);
  --fs-lg: clamp(18px, 5vw, 22px);
  --fs-xl: clamp(22px, 6vw, 28px);
  --fs-xxl: clamp(28px, 8vw, 40px);

  /* Heights */
  --header-h: 56px;
  --bottom-nav-h: 64px;
  --footer-h: 80px;

  /* Z-indexes */
  --z-modal: 1000;
  --z-drawer: 900;
  --z-bottom-nav: 800;
  --z-header: 700;
  --z-overlay: 600;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Oswald', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--fs-base);
  background: #fff;
  color: #000;
}

/* iOS: input font-size < 16px causes zoom on focus */
input, textarea, select {
  font-size: max(16px, var(--fs-base)) !important;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

/* Buttons: touch target min 44px */
button, .btn, [role="button"] {
  min-height: var(--touch-min);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

a, [onclick], [data-action] {
  touch-action: manipulation;
}

html {
  scroll-behavior: smooth;
}

/* Fix iOS Safari: 100vh problematico */
.fullscreen {
  height: 100vh;
  height: 100dvh;
  height: -webkit-fill-available;
}

/* Skeleton loader */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0%, #fafafa 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes slideRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Hide native scrollbar on touch devices */
@media (hover: none) and (pointer: coarse) {
  ::-webkit-scrollbar { display: none; }
  * { scrollbar-width: none; }
}

/* Utility: hide on mobile / desktop */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
  .hide-desktop { display: none !important; }
}

/* Body lock when modal/drawer open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}
