/* ICECO2 - Otimizações Mobile e 4G */

/* Performance: Reduzir animações em conexões lentas */
@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;
  }
}

/* Mobile: Melhorar legibilidade e touch targets */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }

  h1 {
    font-size: 2rem !important;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.75rem !important;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.5rem !important;
    line-height: 1.4;
  }

  /* Seletor mais específico para evitar quebrar ícones ou botões pequenos de UI */
  button.btn,
  a.btn,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
    min-width: 44px;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  video {
    max-height: 60vh;
    object-fit: contain;
  }

  .grid {
    gap: 1rem;
  }
}

/* Performance: Otimizar imagens e vídeos */
img,
video {
  content-visibility: auto;
  contain-intrinsic-size: 300px;
}

/* Mobile: Melhorar contraste de texto */
@media (max-width: 768px) {
  .text-gray-300 {
    color: #e5e7eb !important;
  }

  .text-gray-400 {
    color: #d1d5db !important;
  }
}

/* Performance: Reduzir blur em mobile */
@media (max-width: 768px) {
  .blur-3xl {
    filter: blur(40px) !important;
  }

  .blur-2xl {
    filter: blur(30px) !important;
  }

  .backdrop-blur-xl {
    backdrop-filter: blur(8px) !important;
  }
}

/* Mobile: Otimizar navbar */
@media (max-width: 768px) {
  header {
    height: auto !important;
  }

  header .container>div {
    height: 70px;
  }

  header img {
    height: 2.5rem !important;
  }

  header h1 {
    font-size: 1.25rem !important;
    display: block !important;
  }

  /* Force title visible */
  header p {
    font-size: 0.625rem !important;
    display: block !important;
  }

  /* Ensure logo and text are visible */
  header a.flex {
    display: flex !important;
    align-items: center;
  }

  header span {
    display: inline-block !important;
  }
}

/* Mobile: Melhorar formulários */
@media (max-width: 768px) {

  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Performance: Otimizar gradientes em mobile */
@media (max-width: 768px) {

  .bg-gradient-to-r,
  .bg-gradient-to-b,
  .bg-gradient-to-t {
    background-image: none !important;
    background-color: #0A1F3F !important;
  }

  header[class*="bg-gradient"] {
    background-image: linear-gradient(to right, rgba(30, 41, 59, 0.95), rgba(30, 58, 138, 0.95)) !important;
  }
}

/* Mobile: Melhorar botões WhatsApp */
@media (max-width: 768px) {
  .fixed.bottom-6.right-6 {
    bottom: 1rem !important;
    right: 1rem !important;
    z-index: 9999 !important;
  }
}

/* Performance: Reduzir sombras em mobile */
@media (max-width: 768px) {
  .shadow-2xl {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
  }

  .shadow-xl {
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2) !important;
  }
}

/* Mobile: Melhorar galeria de vídeos */
@media (max-width: 768px) {
  .aspect-video {
    aspect-ratio: 16 / 9;
  }

  .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: Melhorar FAQ */
@media (max-width: 768px) {
  [data-radix-accordion-content] {
    font-size: 0.95rem;
    line-height: 1.6;
  }
}

/* Mobile: Melhorar tabela comparativa */
@media (max-width: 768px) {
  table {
    font-size: 0.875rem;
  }

  td,
  th {
    padding: 0.75rem 0.5rem !important;
  }

  /* Scroll hint container styles */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
  }
}

/* Mobile: Melhorar espaçamento de seções */
@media (max-width: 768px) {
  .py-24 {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }

  .py-20 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  .mb-16 {
    margin-bottom: 3rem !important;
  }

  .mb-12 {
    margin-bottom: 2rem !important;
  }
}

/* Performance: Otimizar scroll */
html {
  scroll-padding-top: 80px;
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 70px;
  }
}

/* Mobile: Melhorar cards */
@media (max-width: 768px) {
  .rounded-2xl {
    border-radius: 1rem !important;
  }

  .rounded-xl {
    border-radius: 0.75rem !important;
  }
}

/* Mobile: Melhorar hero section */
@media (max-width: 768px) {
  .hero-section {
    min-height: 80vh !important;
  }

  .hero-section h1 {
    font-size: 2rem !important;
  }

  .hero-section p {
    font-size: 1rem !important;
  }
}

/* Mobile: Melhorar footer */
@media (max-width: 768px) {
  footer .grid-cols-4 {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  footer .md\:col-span-2 {
    grid-column: span 1 !important;
  }
}

/* Performance: Otimizar renderização de texto */
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile: Melhorar acessibilidade touch */
@media (max-width: 768px) and (hover: none) {
  .hover\:scale-105:hover {
    transform: scale(1) !important;
  }

  .hover\:bg-cyan-500\/40:hover {
    background-color: rgba(6, 182, 212, 0.2) !important;
  }
}

/* Mobile: Melhorar Before/After Gallery */
@media (max-width: 768px) {
  .before-after-slider {
    height: 300px !important;
  }
}

/* Performance: Reduzir motion em conexões lentas */
@media (prefers-reduced-data: reduce) {
  video[autoplay] {
    display: none;
  }

  .animate-gradient-text {
    animation: none;
  }

  .animate-ping {
    animation: none;
  }
}

/* Logo ICECO2 com subscrito */
sub {
  vertical-align: sub;
  font-size: 0.75em;
}

/* Scroll Hint Animation */
.scroll-hint-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px;
  border-radius: 50%;
  pointer-events: none;
  animation: swipe-hint 2s infinite;
  z-index: 10;
}

@keyframes swipe-hint {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(10px);
  }

  20% {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  80% {
    opacity: 1;
    transform: translateY(-50%) translateX(-20px);
  }

  100% {
    opacity: 0;
    transform: translateY(-50%) translateX(-20px);
  }
}