/* Custom styles beyond Tailwind for Supermercados Tropical */

:root {
  --primary: #ED3237;
  --primary-dark: #c41e24;
  --secondary: #3E4095;
  --secondary-dark: #000065;
  --accent: #FFF212;
  --accent-soft: #fff8b0;
  --bg: #FFFFFF;
  --bg-alt: #F7F8FC;
  --text: #1F2937;
  --text-muted: #6B7280;
  --glass: rgba(255, 255, 255, 0.75);
  --shadow: 0 25px 50px -12px rgb(0 0 0 / 0.12);
  --radius: 1.5rem;
}

.dark {
  --bg: #0B1220;
  --bg-alt: #111827;
  --text: #F3F4F6;
  --text-muted: #9CA3AF;
  --glass: rgba(15, 23, 42, 0.8);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* Loading screen */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #000065 0%, #3E4095 50%, #ED3237 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  width: 180px;
  height: 180px;
  animation: pulse-logo 1.6s ease-in-out infinite;
}

@keyframes pulse-logo {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

/* Scroll progress */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #ED3237, #FFF212, #3E4095);
  z-index: 100;
  width: 0%;
  transition: width 0.1s linear;
}

/* Navbar */
.navbar {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.navbar.scrolled .nav-link {
  color: var(--text);
}

.navbar.scrolled .nav-logo {
  /* keep original */
}

/* Floating decorative elements */
.floating {
  animation: float 7s ease-in-out infinite;
}

.floating-delay-1 { animation-delay: 1.2s; }
.floating-delay-2 { animation-delay: 2.4s; }
.floating-delay-3 { animation-delay: 3.6s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(4deg); }
}

/* Glass cards */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.dark .glass-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Card hover glow */
.card-glow {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-glow:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(237, 50, 55, 0.25);
}

/* Tilt cards */
.tilt-card {
  transition: transform 0.2s ease-out;
  transform-style: preserve-3d;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #ED3237 0%, #c41e24 100%);
  color: white;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(237, 50, 55, 0.45);
}

.btn-accent {
  background: #FFF212;
  color: #000065;
  font-weight: 700;
  transition: all 0.3s ease;
}

.btn-accent:hover {
  background: #ffe600;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(255, 242, 18, 0.5);
}

.btn-outline {
  border: 2px solid currentColor;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: currentColor;
  color: white;
}

/* Section reveals (initial state) */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Stats numbers */
.stat-number {
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #ED3237, #3E4095);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dark .stat-number {
  background: linear-gradient(135deg, #FFF212, #ED3237);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Form inputs */
.form-input {
  transition: all 0.25s ease;
  border: 1.5px solid #E5E7EB;
}

.form-input:focus {
  border-color: #ED3237;
  box-shadow: 0 0 0 4px rgba(237, 50, 55, 0.12);
  outline: none;
}

.dark .form-input {
  background: #1F2937;
  border-color: #374151;
  color: #F3F4F6;
}

.dark .form-input:focus {
  border-color: #ED3237;
}

/* Mobile menu */
.mobile-menu {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Back to top */
#back-to-top {
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(#ED3237, #3E4095);
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-track {
  background: #1F2937;
}

/* Hero gradient animation */
.hero-gradient {
  background: linear-gradient(135deg, #000065 0%, #3E4095 40%, #ED3237 100%);
  background-size: 200% 200%;
  animation: gradient-shift 12s ease infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Soft pattern overlay */
.pattern-overlay {
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 242, 18, 0.08) 0%, transparent 40%),
                    radial-gradient(circle at 80% 70%, rgba(237, 50, 55, 0.1) 0%, transparent 35%);
}

/* Department icons circle */
.icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.card-glow:hover .icon-circle {
  transform: scale(1.1);
}

/* Store card left accent */
.store-card {
  border-left: 4px solid #ED3237;
  transition: all 0.3s ease;
}

.store-card:hover {
  border-left-color: #FFF212;
  background: linear-gradient(90deg, rgba(237, 50, 55, 0.04), transparent);
}

/* Selection */
::selection {
  background: rgba(237, 50, 55, 0.2);
  color: #000;
}

/* Focus visible for a11y */
:focus-visible {
  outline: 3px solid #ED3237;
  outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}


/* Additional complementary styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ED3237;
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(237, 50, 55, 0.35);
}
.btn-primary:hover {
  background-color: #c41e24;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(237, 50, 55, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: #3E4095;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: 2px solid #3E4095;
  transition: all 0.3s ease;
}
.dark .btn-secondary {
  color: #FFF212;
  border-color: #FFF212;
}
.btn-secondary:hover {
  background-color: #3E4095;
  color: white;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.navbar .nav-link {
  transition: color 0.2s;
}
.navbar.scrolled .nav-link {
  color: var(--text);
}
.navbar.scrolled .navbar-scrolled-text {
  color: var(--text);
}
.navbar:not(.scrolled) .navbar-scrolled-text {
  color: white;
}

.card-glow {
  transition: all 0.35s ease;
}
.card-glow:hover {
  box-shadow: 0 20px 40px -10px rgba(237, 50, 55, 0.15);
}

.tilt-card {
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
}


/* Full viewport sections - uniform behavior */
section.min-h-screen {
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport for mobile browsers */
}

/* Optional smooth section feel */
html {
  scroll-behavior: smooth;
}

/* Ensure content is vertically centered properly inside full-height sections */
section.min-h-screen > .max-w-7xl,
section.min-h-screen > div.max-w-7xl {
  width: 100%;
}


/* ========== Full Viewport Sections ========== */
html {
  /* scroll-snap removed for smooth experience */ /* proximity is softer than mandatory for better UX */
}

section.min-h-screen,
section[class*="min-h-screen"] {
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport for mobile browsers */
  
  
}

/* Ensure content is vertically centered when short, but allows growth */
@media (min-width: 768px) {
  section.min-h-screen .max-w-7xl {
    margin-top: auto;
    margin-bottom: auto;
  }
}

/* Prevent awkward empty space on very tall content */
@media (max-height: 700px) {
  section.min-h-screen {
    min-height: auto;
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

/* Better mobile full height */
@supports (height: 100dvh) {
  .min-h-screen {
    min-height: 100dvh;
  }
}

/* Full viewport sections for uniform scroll experience */
section[id] {
  scroll-margin-top: 80px; /* account for sticky nav */
}
.min-h-screen {
  min-height: 100vh;
  min-height: 100dvh; /* modern dynamic viewport */
}
@media (max-width: 768px) {
  .min-h-screen {
    min-height: auto; /* allow natural flow on small screens if content overflows, but keep attempt */
    min-height: 100dvh;
  }
}

/* Enhanced card hover for stats and others */
.reveal.bg-white:hover, .reveal.bg-gray-800:hover {
  box-shadow: 0 25px 50px -12px rgba(237, 50, 55, 0.15);
}
/* Floating WA soft pulse */
@keyframes soft-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
}
.fixed.bottom-6 {
  animation: soft-pulse 2.5s infinite;
}
/* Better section spacing */
section {
  scroll-margin-top: 5rem;
}


/* ===== Extra polish for surprise ===== */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.btn-primary:hover::after {
  transform: translateX(100%);
}

/* Soft glow on brand elements */
.glow-primary {
  box-shadow: 0 0 40px rgba(237, 50, 55, 0.15);
}

/* Better floating WA */
@keyframes soft-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
}
.wa-float {
  animation: soft-pulse 2.5s infinite;
}

/* Section divider accent */
.section-accent::before {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #ED3237, #FFF212);
  border-radius: 2px;
  margin: 0 auto 1.5rem;
}


/* Stats cards always readable */
#stats .reveal {
  background: #ffffff !important;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}
.dark #stats .reveal {
  background: #1e293b !important;
  color: #f3f4f6;
  border-color: #334155;
}
#stats .reveal .text-primary { color: #ED3237 !important; }
#stats .reveal .text-secondary { color: #3E4095 !important; }
.dark #stats .reveal .text-secondary { color: #818cf8 !important; }

/* Social brand colors */
.fa-instagram { color: #E4405F; }
.fa-facebook-f { color: #1877F2; }
.fa-whatsapp { color: #25D366; }

/* Full viewport without lag */
section.min-h-screen {
  min-height: 100vh;
  min-height: 100dvh;
}
#navbar { z-index: 50; }
#stats .reveal {
  background: #ffffff !important;
  box-shadow: 0 15px 35px -8px rgba(0,0,0,0.2) !important;
}


/* ===== Full viewport sections (no lag) ===== */
section.min-h-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Respect sticky navbar */
body {
  padding-top: 0;
}
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}
section.min-h-screen:not(#hero) {
  padding-top: 6rem;
  padding-bottom: 4rem;
}
#hero.min-h-screen {
  padding-top: 0;
}

/* ===== FULL VIEWPORT SECTIONS - NO LAG ===== */
section.min-h-screen {
  min-height: 100vh;
  min-height: 100dvh; /* works on mobile browsers */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Navbar always on top */
#navbar {
  z-index: 50;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

/* Stats cards always high contrast */
#stats .reveal {
  background: #ffffff !important;
}
.dark #stats .reveal {
  background: #1e293b !important;
  border-color: #334155 !important;
}
