/* ===================== */
/* 🎨 Variáveis Globais  */
/* ===================== */
:root {
  --c-primary: #0066cc;
  --c-secondary: #0080ff;
  --c-accent: #00aaff;
  --c-success: #00ff88;
  --c-success-dark: #00cc66;
  --c-danger: #ff4444;
  --c-light: #ffffff;
  --c-muted: #888;
  --c-bg-dark: #0a0a0f;
  --c-bg-darker: #0f1419;

  --gradient-primary: linear-gradient(45deg, var(--c-primary), var(--c-secondary));
  --gradient-accent: linear-gradient(45deg, var(--c-primary), var(--c-accent));
  --gradient-success: linear-gradient(45deg, var(--c-success), var(--c-success-dark));

  --shadow-sm: 0 4px 15px rgba(0, 102, 204, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 102, 204, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(0, 170, 255, 0.6);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 25px;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 102, 204, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 170, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(0, 128, 255, 0.08) 0%, transparent 50%),
    linear-gradient(135deg, var(--c-bg-dark) 0%, var(--c-bg-darker) 25%, #1a1a2e 50%, #0d1421 75%, var(--c-bg-dark) 100%);
  background-attachment: fixed;
  color: var(--c-light);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ===================== */
/* Header                */
/* ===================== */
.header {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 102, 204, 0.3);
  z-index: 100;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===================== */
/* Botões                */
/* ===================== */
button {
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.cart-btn,
.add-btn {
  background: var(--gradient-primary);
  border-radius: var(--radius-pill);
  color: var(--c-light);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.cart-btn {
  position: relative;
  padding: 10px 16px;
  font-size: 14px;
}

.add-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 16px;
  box-shadow: var(--shadow-md);
}

.checkout-btn {
  width: 100%;
  background: var(--gradient-success);
  padding: 16px;
  border-radius: var(--radius-md);
  color: #000;
  font-weight: 700;
  font-size: 16px;
  margin-top: 16px;
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

button:active {
  transform: scale(0.96);
}

.close-btn {
  background: none;
  color: var(--c-muted);
  font-size: 24px;
  padding: 4px;
}

/* ===================== */
/* Badges e Notificações */
/* ===================== */
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--c-danger);
  color: var(--c-light);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-success);
  color: #000;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
  z-index: 300;
  animation: slideUp 0.3s ease;
}

/* ===================== */
/* Hero                  */
/* ===================== */
.hero {
  text-align: center;
  padding: 40px 20px 30px;
  background: 
    linear-gradient(135deg, rgba(0, 102, 204, 0.12), rgba(0, 128, 255, 0.08) 50%, rgba(0, 170, 255, 0.06) 100%),
    radial-gradient(ellipse at center, rgba(0, 102, 204, 0.05) 0%, transparent 70%);
  border-bottom: 1px solid rgba(0, 102, 204, 0.2);
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 30% 20%, rgba(0, 170, 255, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(0, 102, 204, 0.04) 0%, transparent 40%);
  pointer-events: none;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 16px;
  color: #b8d4ff;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===================== */
/* Categorias            */
/* ===================== */
.categories {
  padding: 20px 16px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.category-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.category-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 102, 204, 0.3);
  border-radius: var(--radius-pill);
  color: #b8d4ff;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.category-tab:hover {
  background: rgba(0, 102, 204, 0.1);
  border-color: rgba(0, 102, 204, 0.5);
  color: var(--c-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
}

.category-tab.active {
  background: var(--gradient-primary);
  border-color: var(--c-primary);
  color: var(--c-light);
  box-shadow: var(--shadow-sm);
}

.category-tab.active:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===================== */
/* Produtos              */
/* ===================== */
.products {
  padding: 20px 16px 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.product {
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    radial-gradient(circle at top right, rgba(0, 170, 255, 0.08), transparent 50%);
  border: 1px solid rgba(0, 102, 204, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(15px) saturate(1.2);
  transition: all 0.3s ease;
  overflow: hidden;
  /* glow fixo azulado */
  box-shadow: var(--shadow-lg), 0 0 25px rgba(0, 170, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.product:hover {
  transform: translateY(-2px); /* apenas leve destaque no hover */
}



.product-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.product-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-accent);
  margin-bottom: 4px;
}

.product-banner {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent) 50%, var(--c-secondary));
  border-radius: var(--radius-sm);
  margin: 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.product-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(0, 170, 255, 0.3), transparent 50%);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* mostra a imagem inteira */
  border-radius: var(--radius-sm);
  transition: transform 0.3s ease, opacity 0.3s ease;
  /* background: #000;  <-- removido para não ficar preto no meio */
}


.product-image.lazy {
  opacity: 0;
}

.product-image.loaded {
  opacity: 1;
}

.product:hover .product-image {
  transform: scale(1.02);
}

.product-icon-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
}

.product-icon {
  font-size: 48px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.product-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--c-success);
  text-align: right;
}

.product-price small {
  font-size: 14px;
  color: var(--c-muted);
  display: block;
}

.features {
  margin-bottom: 20px;
}

.feature {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: #e0e0e0;
}

.feature-icon {
  width: 16px;
  height: 16px;
  margin-right: 10px;
  color: var(--c-accent);
}

/* ===================== */
/* Carrinho              */
/* ===================== */
.cart-modal {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 102, 204, 0.1), rgba(0, 0, 0, 0.9) 70%);
  backdrop-filter: blur(15px) saturate(1.1);
  z-index: 200;
  display: none;
  align-items: flex-end;
}

.cart-content {
  background: 
    linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(10, 10, 10, 0.98)),
    radial-gradient(circle at top, rgba(0, 102, 204, 0.1), transparent 50%);
  backdrop-filter: blur(20px) saturate(1.3);
  border-radius: 20px 20px 0 0;
  padding: 24px;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  border-top: 3px solid rgba(0, 102, 204, 0.8);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cart-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-accent);
}

.cart-item {
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    radial-gradient(circle at left, rgba(0, 102, 204, 0.06), transparent 50%);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-left: 4px solid rgba(0, 102, 204, 0.8);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cart-item-name {
  font-weight: 600;
  color: var(--c-accent);
}

.cart-item-price {
  color: var(--c-success);
  font-weight: 700;
  font-size: 16px;
}

.remove-item-btn {
  background: none;
  border: none;
  color: var(--c-danger);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.remove-item-btn:hover {
  background: rgba(255, 68, 68, 0.1);
  transform: scale(1.1);
}

.empty-cart {
  text-align: center;
  color: var(--c-muted);
  padding: 40px 20px;
}

/* ===================== */
/* Otimizações           */
/* ===================== */
.lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy.loaded {
  opacity: 1;
}

/* Melhora a performance de animações */
.product,
.category-tab,
.cart-btn,
.add-btn,
.checkout-btn {
  will-change: transform;
}

/* Otimização para scroll suave */
html {
  scroll-behavior: smooth;
}

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

/* ===================== */
/* Footer                */
/* ===================== */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: #666;
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================== */
/* Responsivo            */
/* ===================== */
@media (max-width: 360px) {
  .category-tabs {
    gap: 6px;
  }
  .category-tab {
    padding: 10px 16px;
    font-size: 13px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .products {
    padding: 20px 12px 40px;
  }
  .product {
    padding: 20px;
  }
}

/* ===================== */
/* Animações             */
/* ===================== */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}


/* ===================== */
/* 📱 Mobile Fixes */

/* =======================================
   📱 Mobile Overrides — drop this file AFTER your main styles.css
   Purpose: fix layout and touch issues on phones
   ======================================= */

/* 1) Safer mobile background (avoid repaint jank) */
@media (max-width: 1024px) {
  body {
    background-attachment: scroll; /* overrides fixed */
  }
}

/* 2) Responsive product grid */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 20px 16px 40px;
}

@media (max-width: 900px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .products {
    grid-template-columns: 1fr;
  }
}

/* 3) Flexible hero typography and banner sizes */
.hero h1 {
  font-size: clamp(22px, 6vw, 36px);
}

.hero p {
  font-size: clamp(14px, 3.8vw, 16px);
  max-width: 42ch;
}

.product-banner {
  height: clamp(140px, 45vw, 220px);
}

/* 4) Touch targets and safe-area insets */
button,
.category-tab {
  min-height: 44px;
}

.header {
  padding-top: calc(12px + env(safe-area-inset-top));
}

.notification {
  bottom: calc(20px + env(safe-area-inset-bottom));
}

.cart-content {
  max-height: min(85vh, 700px);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* 5) Reduce heavy effects on low-width / touch to improve perf */
@media (hover: none) and (pointer: coarse) {
  .product:hover,
  .category-tab:hover {
    transform: none;
    box-shadow: none;
  }
}

@media (max-width: 560px) {
  .product {
    box-shadow: var(--shadow-sm);
  }
  .cart-content {
    backdrop-filter: blur(12px) saturate(1.1);
  }
}

/* 6) Prevent header overlap on anchor jumps */
:target {
  scroll-margin-top: 72px;
}
