/* rfk_ecommerce — Base Styles
   Design tokens are in /theme.css (generated from StoreTheme model)
   All colors, fonts and spacing use CSS custom properties defined there */

/* Força cor primária preta em toda a loja */
:root {
  --color-primary: #000 !important;
  --color-secondary: #000 !important;
}

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

html {
  font-size: var(--font-size-base, 16px);
  overflow-x: clip; /* overflow-x:hidden quebra position:sticky no mobile */
}

body {
  font-family: var(--font-family, sans-serif);
  color: var(--color-text, #1e293b);
  background-color: var(--color-background, #fff);
  line-height: 1.5;
  overflow-x: clip; /* clip não quebra position:sticky */
}

/* Remove azul padrão do browser em todos os links */
a {
  color: inherit;
  text-decoration: none;
}

/* Hamburguer sempre preto */
.nav-toggle {
  color: #000;
}

.container {
  max-width: var(--container-max-width, 1280px);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Header ───────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.08);
  transition: box-shadow .25s, padding .25s;
}

.site-header.is-scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 70px;
}

.site-logo {
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.site-logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1;
  justify-content: center;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem .85rem;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-link:hover { background: rgba(0,0,0,.05); }

.nav-chevron { transition: transform .2s; }
.nav-item--dropdown:hover .nav-chevron { transform: rotate(180deg); }

/* Dropdown */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  padding: .5rem 0;
  z-index: 200;
}
.nav-item--dropdown:hover .nav-dropdown { display: block; }

.nav-dropdown__item {
  display: block;
  padding: .6rem 1.2rem;
  font-size: .875rem;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.nav-dropdown__item:hover { background: rgba(0,0,0,.04); }

/* Header actions */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.header-action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.header-action:hover { background: rgba(0,0,0,.06); }

.header-coins {
  font-size: .6875rem;
  font-weight: 700;
  background: #fbbf24;
  color: #1e293b;
  padding: .125rem .375rem;
  border-radius: 10px;
  margin-left: .25rem;
  line-height: 1;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--color-primary, #000);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Main content */
.site-main {
  min-height: 60vh;
}

/* Footer */
.site-footer {
  background: var(--color-footer-bg, #111);
  color: var(--color-footer-text, #aaa);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.site-footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-logo { height: 36px; width: auto; filter: brightness(0) invert(1); }
.footer-name { font-size: 1.1rem; font-weight: 700; color: #fff; }
.footer-desc { font-size: .85rem; margin-top: .5rem; max-width: 280px; }
.footer-copy  { font-size: .8rem; opacity: .6; }

/* Alert messages */
.messages {
  margin-bottom: 1rem;
  padding-top: 1rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius, 8px);
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
}

.alert--success { background: #f0fdf4; border-color: var(--color-success); color: #166534; }
.alert--error, .alert--danger { background: #fef2f2; border-color: var(--color-danger); color: #991b1b; }
.alert--warning { background: #fffbeb; border-color: var(--color-accent); color: #92400e; }
.alert--info { background: #f9fafb; border-color: #000; color: #1e293b; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--button-border-radius, 6px);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s ease;
}

.btn:hover { opacity: 0.85; }

.btn--primary {
  background: #000;
  border-color: #000;
  color: #fff;
}

.btn--secondary {
  background: #000;
  border-color: #000;
  color: #fff;
}

.btn--outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn--dark {
  background: var(--color-text, #1e293b);
  border-color: var(--color-text, #1e293b);
  color: #fff;
}
.btn--dark:hover { background: #000; border-color: #000; }

/* Form elements */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-background);
  color: var(--color-text);
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Backdrop do menu mobile */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity .3s;
}
.nav-backdrop.is-visible {
  display: block;
  opacity: 1;
}

/* Mobile */
@media (max-width: 768px) {
  /* Header fixo no mobile (sticky quebra com overflow-x no Safari) */
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
  }

  /* Espaço para compensar o header fixo */
  .site-main {
    padding-top: 70px;
  }

  /* Logo centralizada, hamburger esquerda, icons direita */
  .site-header__inner {
    position: relative;
    justify-content: space-between;
  }
  .site-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 140px);
  }

  .nav-toggle { display: flex; }

  .site-nav {
    display: flex;
    position: fixed;
    inset: 0;
    top: 70px;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: 0;
    overflow-y: auto;
    z-index: 999;
    border-top: 1px solid rgba(0,0,0,.08);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.4s;
    visibility: hidden;
  }
  .site-nav.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  /* Filetes pretos e links do nav sem herança de cor azul */
  .nav-link {
    font-size: 1rem;
    padding: .85rem .5rem;
    border-bottom: 1px solid rgba(0,0,0,.08);
    color: #000;
  }
  .nav-dropdown__item { color: #333; }
  .nav-dropdown { position: static; box-shadow: none; border: none; padding-left: 1rem; display: block; }
  .nav-chevron { display: none; }
}
