/* CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #00b37e;
  --bg-dark: #09090a;
  --bg-card: #121214;
  --bg-card-hover: #202024;
  --text-primary: #e1e1e6;
  --text-secondary: #a4a5a9;
  --font-title: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Transition timings */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  font-family: var(--font-body);
  background: linear-gradient(
    180deg,
    rgb(211, 61, 29) 0%,
    rgb(231, 86, 15) 50%,
    rgb(250, 110, 0) 100%
  );
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* App Container (Desktop Background Layout) */
.app-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: transparent;
  position: relative;
}

.phone-frame {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition-slow);
}

.phone-notch {
  display: none;
}

/* Inner App Viewport */
#app-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* Screen Section System */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 60px 24px 40px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform var(--transition-slow), opacity var(--transition-slow);
  z-index: 10;
  overflow-y: auto;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.screen::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  z-index: 20;
}

.screen.inactive-left {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
}

/* Header Home Layout */
.app-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0 30px;
  min-height: 140px;
}

.logo {
  max-width: 80%;
  max-height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}

/* Header Back (Sub-pages) */
.app-header-back {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0 30px;
  width: 100%;
  position: relative;
  min-height: 140px;
}

.btn-back {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition-normal);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.08);
}

.btn-back:active {
  transform: translateY(-50%) scale(0.95);
}

.back-arrow {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-left: 2px solid var(--text-primary);
  border-bottom: 2px solid var(--text-primary);
  transform: rotate(45deg);
  margin-left: 3px;
}



/* Section Text Content */
.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 10px;
}

.screen-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #e1e1e6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.screen-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 30px;
  max-width: 90%;
}

/* Nav / Link Buttons Containers */
.links-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-top: auto;
  margin-bottom: auto;
}

/* Image Buttons Specific Styles */
.btn-link {
  background: none;
  border: none;
  padding: 0;
  width: 100%;
  cursor: pointer;
  display: block;
  text-decoration: none;
  border-radius: 16px;
  outline: none;
  transition: transform var(--transition-normal), filter var(--transition-fast), box-shadow var(--transition-normal);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.btn-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  pointer-events: none;
}

/* Button States and Hover Interactions */
.btn-link:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.btn-link:active {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.95);
}

.btn-link:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-color);
}

/* App Download Screen Details */
.app-download-screen {
  justify-content: center;
}

.app-promo-header {
  margin-bottom: 20px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.promo-img {
  max-width: 90%;
  height: auto;
}

.app-stores {
  flex-direction: row;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.btn-linkStore {
  flex: 1;
  max-width: 140px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  transition: transform var(--transition-normal), filter var(--transition-fast);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.btn-imgStore {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.btn-linkStore:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.btn-linkStore:active {
  transform: scale(0.96);
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Intro Screen Styles */
#screen-intro {
  transform: none;
  justify-content: center;
  align-items: center;
  background: linear-gradient(
    180deg,
    rgb(211, 61, 29) 0%,
    rgb(231, 86, 15) 50%,
    rgb(250, 110, 0) 100%
  );
  z-index: 100;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  pointer-events: none;
}

#screen-intro.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

#screen-intro.inactive {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
}

.logo-intro {
  max-width: 80%;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}

.intro-loader {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loader-bar {
  width: 100%;
  height: 100%;
  background: #ffffff;
  position: absolute;
  left: -100%;
  border-radius: 2px;
  animation: loadProgress 2s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes loadProgress {
  0% {
    left: -100%;
  }
  100% {
    left: 0;
  }
}

.animate-intro-logo {
  animation: introLogoFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes introLogoFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Mobile Responsiveness (Media Query) */
@media (max-width: 480px) {
  .app-container {
    background: none;
    height: 100%;
  }

  .phone-frame {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    aspect-ratio: auto;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .phone-notch {
    display: none; /* Hide device elements on real mobile viewports */
  }

  #app-viewport {
    border-radius: 0;
  }
  
  .screen {
    padding: 50px 20px 30px;
  }

  .logo {
    max-width: 100%;
    max-height: 140px;
  }
}

/* Desktop and Tablet Responsive Layout */
@media (min-width: 481px) {
  /* Center the screen content vertically */
  .screen {
    justify-content: center;
    padding: 60px 40px;
  }

  .app-header {
    min-height: auto;
    padding: 0 0 50px 0;
  }

  .app-header-back {
    max-width: 900px;
    margin: 0 auto;
    min-height: auto;
    padding: 0 0 50px 0;
    position: relative;
  }

  .screen-content {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
  }

  .logo {
    max-height: 120px;
    max-width: 350px;
  }

  /* 3x2 Grid for Home screen buttons */
  #home-navigation {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    align-items: stretch;
  }

  #home-navigation .btn-link {
    display: flex;
    height: 100%;
  }

  #home-navigation .btn-img {
    height: 100%;
    object-fit: fill;
  }

  #btn-whatsapp {
    grid-column: span 2;
  }

  #btn-app {
    grid-column: span 2;
  }

  #btn-location {
    grid-column: span 2;
  }

  #btn-offers {
    grid-column: 2 / span 2;
    grid-row: 2;
  }

  #btn-website {
    grid-column: 4 / span 2;
    grid-row: 2;
  }

  /* 2-column Grid for Subpages (WhatsApp / Locations) */
  .screen-content .links-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    align-items: end;
  }

  /* App Stores links side-by-side and centered */
  .app-download-screen .app-stores {
    display: flex;
    justify-content: center;
    gap: 24px;
    max-width: 400px;
    margin: 20px auto 0;
    width: 100%;
  }

  .app-promo-header {
    margin-bottom: 30px;
  }

  .promo-img {
    max-width: 400px;
  }
}
