/* Estilos Customizados - Shopping da Macumba */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

:root {
  --background: #ffffff;
  --foreground: #000000;
  --primary: #CC0000;
  --primary-foreground: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* --------- Animações utilitárias --------- */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

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

@keyframes bounce-soft {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}

.animate-bounce {
  animation: bounce-soft 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-shimmer {
  background: linear-gradient(90deg, #f5f5f5 25%, #e5e5e5 50%, #f5f5f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* --------- Cartões de produto --------- */
.product-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* --------- Line clamp utilitário --------- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------- Carousel Horizontal (Slide) - NOVO --------- */
.carousel-wrapper {
  display: flex;
  width: 100%;
  position: relative;
  transition: transform 0.7s ease-in-out;
}

.carousel-slide-item {
  flex-shrink: 0;
  width: 100%;
  position: relative;
  display: block;
}

#banner-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  z-index: 0 !important;
}

#banner-carousel .carousel-wrapper {
  display: flex;
  width: 100%;
  transition: transform 0.7s ease-in-out;
}

#banner-carousel .carousel-slide-item {
  flex-shrink: 0;
  width: 100%;
  min-width: 100%;
  position: relative;
  display: block;
}

/* Carrosséis de categoria (Tabacaria e Imagens) */
.carousel-wrapper-tabacaria,
.carousel-wrapper-imagens {
  display: flex;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.carousel-slide-item-tabacaria,
.carousel-slide-item-imagens {
  flex-shrink: 0;
  width: 100%;
  position: relative;
}

#tabacaria-carousel,
#imagens-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
}

#banner-carousel {
  position: relative;
  z-index: 0 !important; /* Não sobrepor menus - header tem z-index 9999 */
  overflow: hidden;
  width: 100%;
  display: block;
  visibility: visible;
  opacity: 1;
}

.carousel-slide.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  z-index: 2;
  transform: translateX(0);
}

.carousel-slide.prev {
  transform: translateX(-100%);
  transition: transform 0.8s ease-in-out;
}

/* Banner responsivo com tamanhos específicos */
.banner-image {
  width: 100%;
  display: block;
  object-fit: cover;
  background-color: #f3f4f6;
}

/* Desktop: 1920x500px */
@media (min-width: 1024px) {
  .banner-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    object-position: center;
  }
  
  #banner-carousel {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
  }
}

/* Desktop Slim: 1020x300px */
@media (min-width: 768px) and (max-width: 1023px) {
  .banner-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center;
  }
  
  #banner-carousel {
    width: 100%;
    max-width: 1020px;
    margin: 0 auto;
  }
}

/* Mobile: 800x1000px */
@media (max-width: 767px) {
  .banner-image {
    width: 100%;
    height: 1000px;
    object-fit: cover;
    object-position: center;
  }
  
  #banner-carousel {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
  }
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --------- Tela de loading estilo app --------- */
.loading-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 30%, #2a0505 70%, #CC0000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.8s ease;
  overflow: hidden;
}

.loading-screen.hide {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  position: relative;
  animation: slideUp 0.8s ease-out;
}

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

.logo-container {
  position: relative;
  margin-bottom: 2rem;
  display: inline-block;
}

.logo-glow {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, #CC0000 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.6;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.85;
  }
}

.logo-image {
  position: relative;
  z-index: 2;
  width: 120px;
  height: auto;
  animation: logoFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 10px 30px rgba(204, 0, 0, 0.45));
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-8px) rotate(1deg); }
  66% { transform: translateY(-4px) rotate(-1deg); }
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top: 3px solid #CC0000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --------- Scrollbar oculta (para listas tipo app) --------- */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* --------- Ajustes mobile (visual de aplicativo) --------- */
@media (max-width: 768px) {
  body {
    background-color: #050505;
  }

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

  h1 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  h2 {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  button,
  .btn,
  [role="button"] {
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Deixar o header mais compacto no mobile */
  #main-header-content {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  #main-header img {
    max-height: 3.5rem;
  }

  /* Grids de produto em 2 colunas no mobile (estilo app) */
  .product-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .product-grid-2 .product-card {
    border-radius: 0.75rem;
  }

  /* Carousel mais baixo no mobile */
  .carousel-slide img {
    max-height: 220px;
  }

  /* Nunca exibir imagens dentro do menu lateral mobile (evita banner preso por cima) */
  #mobile-menu img {
    display: none;
  }
  
  /* Ajustes para página minha-conta */
  .min-h-screen {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  
  /* Garantir que inputs tenham tamanho mínimo para toque */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  textarea,
  select {
    min-height: 44px;
    font-size: 16px; /* Evita zoom automático no iOS */
  }
  
  /* Ajustes para cards de pedidos */
  .border.border-gray-200 {
    overflow: hidden;
  }
  
  /* Garantir que textos não quebrem layout */
  .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Ajustes para badges e status */
  .rounded-full {
    display: inline-block;
    white-space: nowrap;
  }
}
