/* Alvarez Nutrition — catálogo (tema claro padrão + dark mode) */

:root {
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-soft: rgba(22, 163, 74, 0.14);
  --accent-on-badge: #ffffff;

  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-muted: #f4f4f5;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;

  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --text: #18181b;
  --muted: #52525b;

  --on-accent: #ffffff;
  --danger: #dc2626;

  --header-bg: rgba(255, 255, 255, 0.94);
  --header-border: #e4e4e7;
  --thumb-bg: #f4f4f5;
  --cart-foot-bg: #fafafa;
  --stat-bg: #f4f4f5;
  --overlay: rgba(0, 0, 0, 0.45);
  --modal-scrim: rgba(0, 0, 0, 0.4);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 10px 40px rgba(0, 0, 0, 0.08);

  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 72px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html[data-theme='dark'] {
  --accent: #22c55e;
  --accent-hover: #4ade80;
  --accent-soft: rgba(34, 197, 94, 0.18);
  --accent-on-badge: #052e16;

  --bg: #0c0c0e;
  --bg-subtle: #0f0f12;
  --bg-muted: #18181b;
  --bg-elevated: #141416;
  --bg-card: #18181b;

  --border: #27272a;
  --border-strong: #3f3f46;

  --text: #fafafa;
  --muted: #a1a1aa;

  --on-accent: #052e16;
  --danger: #f87171;

  --header-bg: rgba(12, 12, 14, 0.94);
  --header-border: #27272a;
  --thumb-bg: #09090b;
  --cart-foot-bg: #101012;
  --stat-bg: rgba(255, 255, 255, 0.04);
  --overlay: rgba(0, 0, 0, 0.6);
  --modal-scrim: rgba(0, 0, 0, 0.65);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

html[data-theme='dark'] {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1160px, 92vw);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding-block: 0.65rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.12rem;
  order: 1;
}

.brand:hover {
  text-decoration: none;
  color: var(--text);
  opacity: 0.92;
}

.brand-logo {
  height: 44px;
  width: auto;
  max-width: min(200px, 42vw);
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.15;
}

.brand-tagline {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  order: 3;
  flex-basis: 100%;
  align-items: center;
  gap: 0.2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.15rem;
  margin: 0 -2px;
}

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

.nav a {
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--text);
  background: var(--bg-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  order: 2;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  filter: none;
}

.btn-ghost {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
}

.btn-icon:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
}

.btn-icon[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-theme .icon-sun {
  display: none;
}

html[data-theme='dark'] .btn-theme .icon-moon {
  display: none;
}

html[data-theme='dark'] .btn-theme .icon-sun {
  display: block;
}

.btn-cart {
  position: relative;
  padding-inline: 0.95rem;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.7rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

@media (min-width: 880px) {
  .header-inner {
    flex-wrap: nowrap;
    padding-block: 0;
    min-height: var(--header-h);
    height: var(--header-h);
  }

  .nav {
    order: 0;
    flex-basis: auto;
    flex-grow: 1;
    justify-content: center;
    margin: 0;
    padding-bottom: 0;
  }

  .brand {
    order: 0;
  }

  .header-actions {
    order: 0;
    margin-left: 0;
  }
}

/* Hero */
.hero {
  padding: 3.25rem 0 2.25rem;
  position: relative;
  background: var(--bg);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 55% at 15% 20%, var(--accent-soft), transparent 55%);
  pointer-events: none;
  opacity: 0.85;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
  }
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4.5vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--text);
}

.hero p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 38ch;
}

.hero-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.hero-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-top: 1.2rem;
}

.stat {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: var(--stat-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.stat strong {
  display: block;
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 800;
}

.stat span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Toolbar */
.toolbar {
  padding: 1.75rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.toolbar-inner {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .toolbar-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .toolbar-inner {
    grid-template-columns: 1.35fr 0.95fr 0.95fr 0.8fr 0.8fr auto;
    align-items: end;
  }
}

.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input,
.select,
textarea.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.input:focus,
.select:focus,
textarea.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.section-title h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-title span {
  color: var(--muted);
  font-size: 0.88rem;
}

#produtos,
#categorias,
#contato {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* Products */
.products-grouped {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  padding-bottom: 3rem;
}

.cat-block-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cat-block-title span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: var(--accent-on-badge);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-thumb-wrap {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--thumb-bg);
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.45rem;
}

.card-cat {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--text);
}

.card-price {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--text);
}

.card-price small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.card-var {
  font-size: 0.8rem;
  color: var(--muted);
}

.card-actions {
  margin-top: auto;
  padding-top: 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.card-actions .btn {
  font-size: 0.8rem;
  padding: 0.52rem 0.6rem;
  border-radius: var(--radius-sm);
}

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

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Chips */
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 2.5rem;
}

.chip {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  padding: 0.42rem 0.88rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.is-active {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

/* Cart */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 90;
}

.cart-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card-hover);
}

.cart-panel.is-open {
  transform: translateX(0);
}

.cart-head {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cart-head h2 {
  margin: 0;
  font-size: 1.12rem;
  color: var(--text);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.cart-foot {
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--cart-foot-bg);
}

.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0.5rem;
  font-size: 0.95rem;
}

.cart-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.cart-line img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--thumb-bg);
}

.line-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.line-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.line-price {
  font-weight: 800;
  font-size: 0.92rem;
  margin-top: 0.25rem;
  color: var(--text);
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
}

.qty-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.qty-val {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 800;
  color: var(--text);
}

.line-remove {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-top: 0.35rem;
  text-decoration: underline;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.cart-total-row strong {
  font-size: 1.28rem;
}

.cart-actions {
  display: grid;
  gap: 0.5rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-scrim);
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: min(480px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-card-hover);
}

.modal h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  color: var(--text);
}

.modal p.desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.modal-close {
  float: right;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-close:hover {
  background: var(--bg-card);
}

.modal-price {
  font-size: 1.45rem;
  font-weight: 900;
  margin-bottom: 1rem;
  color: var(--text);
}

.var-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.var-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.var-opt {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.var-opt.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

html[data-theme='dark'] .var-opt.is-selected {
  color: var(--accent-hover);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

@media (max-width: 420px) {
  .modal-actions {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2.5rem;
  margin-top: 2rem;
  background: var(--bg-subtle);
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.footer-brand {
  font-weight: 900;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.footer-quote {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1rem;
  font-size: 1.02rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.footer-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-meta p {
  margin: 0 0 0.35rem;
}

.footer-meta strong {
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
