/* =====================================================================
   EME RACE - Motorsport Store
   Identidade visual: fundo claro, azul como cor principal, grafite para
   textos, detalhes esportivos discretos. Mobile-first.
   ===================================================================== */

:root {
  --er-blue: #1451ff;
  --er-blue-dark: #0d3bcc;
  --er-blue-light: #e8eeff;
  --er-accent: #ff3b30;
  --er-dark: #14171f;
  --er-gray-900: #1c212b;
  --er-gray-700: #4b5563;
  --er-gray-500: #7b8494;
  --er-gray-300: #e1e5eb;
  --er-gray-100: #f5f7fa;
  --er-white: #ffffff;
  --er-radius: 10px;
  --er-shadow: 0 2px 14px rgba(20, 23, 31, 0.06);
  --er-shadow-hover: 0 10px 28px rgba(20, 23, 31, 0.12);
  --er-font-heading: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --er-font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--er-font-body);
  color: var(--er-gray-900);
  background: var(--er-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .er-heading {
  font-family: var(--er-font-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--er-dark);
}

a { text-decoration: none; color: inherit; }

.er-text-blue { color: var(--er-blue); }
.er-bg-light { background: var(--er-gray-100); }

/* ---------------------------------------------------------------------
   Botões
   --------------------------------------------------------------------- */
.btn-primary,
.btn-er {
  background: var(--er-blue);
  border-color: var(--er-blue);
  font-weight: 600;
  border-radius: var(--er-radius);
}
.btn-primary:hover, .btn-primary:focus,
.btn-er:hover, .btn-er:focus {
  background: var(--er-blue-dark);
  border-color: var(--er-blue-dark);
}
.btn-outline-er {
  border: 1.5px solid var(--er-blue);
  color: var(--er-blue);
  font-weight: 600;
  border-radius: var(--er-radius);
  background: transparent;
}
.btn-outline-er:hover { background: var(--er-blue); color: #fff; }
.btn-accent { background: var(--er-accent); border-color: var(--er-accent); color: #fff; font-weight: 600; }

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
.er-topbar {
  background: var(--er-dark);
  color: #cfd6e4;
  font-size: 0.8rem;
  padding: 6px 0;
}
.er-topbar a { color: #cfd6e4; }
.er-topbar a:hover { color: #fff; }

.er-header {
  background: var(--er-white);
  border-bottom: 1px solid var(--er-gray-300);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.er-logo {
  font-family: var(--er-font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--er-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.er-logo span.er-race { color: var(--er-blue); }
.er-logo small {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--er-gray-500);
  text-transform: uppercase;
}

.er-logo-img { height: 38px; width: auto; display: block; }
.er-logo-img--sm { height: 30px; }
.er-logo-img--lg { height: 56px; }
.er-logo-badge {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  line-height: 0;
}

.er-nav .nav-link {
  font-weight: 600;
  color: var(--er-gray-900);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
}
.er-nav .nav-link:hover,
.er-nav .nav-link.active { color: var(--er-blue); }

.er-search-form { max-width: 420px; }
.er-search-form .form-control {
  border-radius: var(--er-radius) 0 0 var(--er-radius);
  border-color: var(--er-gray-300);
}
.er-search-form .btn {
  border-radius: 0 var(--er-radius) var(--er-radius) 0;
}

.er-icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--er-gray-900);
  background: var(--er-gray-100);
  font-size: 1.1rem;
}
.er-icon-btn:hover { background: var(--er-blue-light); color: var(--er-blue); }
.er-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--er-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------------------------------------------------------------------
   Hero / Banner
   --------------------------------------------------------------------- */
.er-hero {
  background: linear-gradient(120deg, var(--er-dark) 0%, #1d2540 55%, var(--er-blue-dark) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
}
.er-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 10px, transparent 10px 20px);
  pointer-events: none;
}
.er-hero .container { position: relative; z-index: 1; }
.er-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
}
.er-hero p { color: #d7ddf0; font-size: 1.05rem; }

/* ---------------------------------------------------------------------
   Seções
   --------------------------------------------------------------------- */
.er-section { padding: 3rem 0; }
.er-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.er-section-title h2 { font-size: 1.5rem; margin: 0; }
.er-section-title a { font-weight: 600; color: var(--er-blue); font-size: 0.9rem; }

/* ---------------------------------------------------------------------
   Cards de piloto / equipe
   --------------------------------------------------------------------- */
.er-card-piloto {
  background: var(--er-white);
  border: 1px solid var(--er-gray-300);
  border-radius: var(--er-radius);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
  height: 100%;
}
.er-card-piloto:hover { box-shadow: var(--er-shadow-hover); transform: translateY(-3px); }
.er-card-piloto .er-foto-wrap {
  aspect-ratio: 4/3;
  background: var(--er-gray-100);
  overflow: hidden;
  position: relative;
}
.er-card-piloto img { width: 100%; height: 100%; object-fit: cover; }
.er-card-piloto .er-numero {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--er-blue);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 2px 10px;
  border-radius: 20px;
}
.er-card-piloto .er-info { padding: 0.9rem 1rem; }
.er-card-piloto .er-nome { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.er-card-piloto .er-meta { font-size: 0.8rem; color: var(--er-gray-500); }

/* ---------------------------------------------------------------------
   Cards de produto
   --------------------------------------------------------------------- */
.er-card-produto {
  background: var(--er-white);
  border: 1px solid var(--er-gray-300);
  border-radius: var(--er-radius);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
  position: relative;
}
.er-card-produto:hover { box-shadow: var(--er-shadow-hover); transform: translateY(-3px); }
.er-card-produto .er-foto-wrap {
  aspect-ratio: 1/1;
  background: var(--er-gray-100);
  overflow: hidden;
}
.er-card-produto img { width: 100%; height: 100%; object-fit: cover; loading: lazy; }
.er-card-produto .er-body { padding: 0.9rem 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.er-card-produto .er-marca { font-size: 0.72rem; color: var(--er-gray-500); text-transform: uppercase; letter-spacing: 0.05em; }
.er-card-produto .er-nome {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--er-dark);
  margin: 2px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.er-card-produto .er-precos { margin-top: auto; }
.er-card-produto .er-preco-de { font-size: 0.78rem; color: var(--er-gray-500); text-decoration: line-through; }
.er-card-produto .er-preco-por { font-size: 1.1rem; font-weight: 800; color: var(--er-dark); }
.er-card-produto .er-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--er-gray-700);
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}
.er-fav-btn.ativo, .er-fav-btn:hover { color: var(--er-accent); }

.er-badge-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  color: #fff;
  z-index: 2;
}
.er-badge-lancamento { background: var(--er-blue); }
.er-badge-promocao { background: var(--er-accent); }
.er-badge-esgotado { background: var(--er-gray-700); }

/* ---------------------------------------------------------------------
   Categorias
   --------------------------------------------------------------------- */
.er-cat-card {
  background: var(--er-gray-100);
  border-radius: var(--er-radius);
  text-align: center;
  padding: 1.5rem 1rem;
  font-weight: 700;
  color: var(--er-dark);
  transition: background .2s ease, color .2s ease;
  height: 100%;
}
.er-cat-card:hover { background: var(--er-blue); color: #fff; }
.er-cat-card i, .er-cat-card svg { font-size: 1.8rem; margin-bottom: 0.5rem; display: block; }

/* ---------------------------------------------------------------------
   Página de piloto/equipe (vitrine)
   --------------------------------------------------------------------- */
.er-perfil-capa {
  height: 260px;
  background-size: cover;
  background-position: center;
  background-color: var(--er-dark);
  position: relative;
}
.er-perfil-capa::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(10,12,20,0.65));
}
.er-perfil-header {
  margin-top: -70px;
  position: relative;
  z-index: 2;
}
.er-perfil-avatar {
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 5px solid #fff;
  object-fit: cover;
  background: var(--er-gray-100);
  box-shadow: var(--er-shadow);
}
.er-perfil-numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--er-blue);
  color: #fff;
  font-weight: 800;
  border-radius: 8px;
  padding: 2px 12px;
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------------
   Produto - página de detalhe
   --------------------------------------------------------------------- */
.er-galeria-principal {
  aspect-ratio: 1/1;
  background: var(--er-gray-100);
  border-radius: var(--er-radius);
  overflow: hidden;
}
.er-galeria-principal img { width: 100%; height: 100%; object-fit: cover; }
.er-galeria-thumbs img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 6px; border: 2px solid transparent; cursor: pointer;
}
.er-galeria-thumbs img.ativo { border-color: var(--er-blue); }
.er-var-option {
  border: 1.5px solid var(--er-gray-300);
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  background: #fff;
}
.er-var-option.ativo { border-color: var(--er-blue); background: var(--er-blue-light); color: var(--er-blue); }
.er-var-option.indisponivel { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Carrinho / Checkout
   --------------------------------------------------------------------- */
.er-checkout-step {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--er-gray-500);
}
.er-checkout-step .num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--er-gray-300); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.er-checkout-step.ativo, .er-checkout-step.concluido { color: var(--er-dark); }
.er-checkout-step.ativo .num, .er-checkout-step.concluido .num { background: var(--er-blue); }

.er-resumo-box {
  background: var(--er-gray-100);
  border-radius: var(--er-radius);
  padding: 1.25rem;
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.er-footer {
  background: var(--er-dark);
  color: #b9c0d1;
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}
.er-footer h6 { color: #fff; font-weight: 700; margin-bottom: 1rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.er-footer a { color: #b9c0d1; }
.er-footer a:hover { color: #fff; }
.er-footer .er-logo { color: #fff; }
.er-footer .er-social {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 8px;
}
.er-footer .er-social:hover { background: var(--er-blue); }
.er-footer hr { border-color: rgba(255,255,255,0.1); }
.er-pagamentos i { font-size: 1.6rem; margin-right: 10px; color: #b9c0d1; }

/* ---------------------------------------------------------------------
   Utilitários / mobile
   --------------------------------------------------------------------- */
.er-mobile-cart-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--er-gray-300);
  padding: 10px 14px;
  z-index: 1040;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}

@media (max-width: 991.98px) {
  .er-section { padding: 2rem 0; }
  body { padding-bottom: 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--er-gray-100) 25%, var(--er-gray-300) 37%, var(--er-gray-100) 63%);
  background-size: 400% 100%;
  animation: er-skeleton 1.4s ease infinite;
}
@keyframes er-skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
