/* ═══════════════════════════════════════════════
   BECO TECH — STYLE ENGINE v7.0
   Arquitetura: @layer | BEM | CSS Custom Props
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Montserrat:wght@800;900&display=swap');

/* ── CASCADE LAYERS — ordem de especificidade explícita ── */
@layer reset, base, layout, components, utilities;

/* ── DESIGN TOKENS ── */
:root {
  /* Cores */
  --bg:         #0a0a0a;
  --card-bg:    #111111;
  --red:        #E8003D;
  --red-glow:   rgba(232, 0, 61, 0.15);
  --blue:       #7b9cff;
  --blue-bg:    #0d0d1f;
  --amazon:     #FF9900;
  --text:       #FFFFFF;
  --muted:      #888888;
  --dim:        #aaaaaa;
  --border:     rgba(255, 255, 255, 0.05);
  --product-bg: #0d0d0d;

  /* Tipografia */
  --font-mono:    'JetBrains Mono', monospace;
  --font-display: 'Montserrat', sans-serif;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Gradientes de overlay reutilizáveis */
  --ov-left:   linear-gradient(to right,  rgba(17,17,17,.92) 28%, rgba(17,17,17,0) 68%);
  --ov-left-b: linear-gradient(to right,  rgba(13,13,31,.92) 28%, rgba(13,13,31,0) 68%);
  --ov-tb:     linear-gradient(180deg, rgba(17,17,17,.95) 0%, rgba(17,17,17,0) 42%, rgba(17,17,17,.92) 100%);
  --ov-hero:   rgba(10, 10, 10, 0.82);
}


/* ════════════════════════════════════════════
   RESET
   ════════════════════════════════════════════ */
@layer reset {
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

  img { display: block; max-width: 100%; }
  a   { text-decoration: none; }

  button, input, select, textarea {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    outline: none;
    font: inherit;
    color: inherit;
  }
}


/* ════════════════════════════════════════════
   BASE
   ════════════════════════════════════════════ */
@layer base {
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
  }
}


/* ════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════ */
@layer layout {

  /* Container */
  .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 5%;
  }

  /* ── Header ── */
  .hdr {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .hdr__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .hdr__logo {
    font-family: var(--font-display);
    font-weight: 900;
    color: var(--text);
    font-size: 1.4rem;
  }
  .hdr__logo span { color: var(--red); }

  .hdr__nav { display: flex; gap: 2rem; }
  .hdr__nav a {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
  }
  .hdr__nav a:is(.on, :hover) { color: var(--red); }

  /* ── Bento Grid ── */
  .bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 280px;
    gap: 1.2rem;
  }
  .bento-grid--auto { grid-auto-rows: minmax(320px, auto); }

  /* ── Footer ── */
  .ftr {
    text-align: center;
    padding: 2rem 5%;
    font-size: 0.6rem;
    color: var(--muted);
    letter-spacing: 2px;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
  }

  /* ── Mobile Hotbar ── */
  .hotbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.95);
    border-top: 1px solid var(--border);
    z-index: 2000;
    padding: 15px 0 calc(15px + env(safe-area-inset-bottom));
    justify-content: space-around;
    backdrop-filter: blur(15px);
  }
  .hotbar a {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
  }
  .hotbar a.on { color: var(--red); }
}


/* ════════════════════════════════════════════
   COMPONENTS
   ════════════════════════════════════════════ */
@layer components {

  /* ── Page Heading ── */
  .page-hd { margin-bottom: 3rem; }
  .page-hd__label {
    display: block;
    color: var(--red);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
  }
  .page-hd__title {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 3rem;
    line-height: 1;
  }
  .page-hd__sub {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    max-width: 600px;
    line-height: 1.7;
  }

  /* ── Section Header ── */
  .section-hd {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .section-hd h2 { font-family: var(--font-display); }
  .section-hd__label {
    font-size: 0.6rem;
    color: var(--muted);
    letter-spacing: 1px;
  }


  /* ════ CARD BASE ════ */
  .card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    overflow: hidden;
    position: relative;
    transition:
      border-color 0.4s var(--ease-out-expo),
      transform    0.4s var(--ease-out-expo),
      box-shadow   0.4s var(--ease-out-expo);
  }
  .card:hover {
    border-color: var(--red);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  }

  /* ── Card size modifiers ── */
  .card--large { grid-column: span 2; grid-row: span 2; }
  .card--tall  { grid-row: span 2; }
  .card--wide  { grid-column: span 2; }

  /* ── Card style modifiers ── */
  .card--featured {
    border-color: var(--red);
    box-shadow: inset 0 0 20px var(--red-glow);
  }
  .card--red-border  { border-color: var(--red); }
  .card--blue-border { border-color: rgba(123, 156, 255, 0.2); }

  /* ── Card Tag ── */
  .card__tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1rem;
  }
  .card__tag--red   { color: var(--red); }
  .card__tag--muted { color: var(--muted); border: 1px solid var(--muted); padding: 2px 6px; }
  .card__tag--blue  { color: var(--blue); border: 1px solid rgba(123,156,255,.4); padding: 2px 8px; background: var(--blue-bg); }
  .card__tag--badge { background: var(--red); color: #fff; padding: 2px 8px; }
  .card__tag--badge-sm {
    background: var(--red);
    color: #fff;
    padding: 3px 10px;
    font-size: 0.55rem;
    letter-spacing: 2px;
  }
  /* Tag posicionada absolutamente (cards com imagem no topo) */
  .card__tag--abs {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    margin: 0;
  }

  /* ── Card Body (conteúdo de produto) ── */
  .card__body { margin: 1rem 0; }
  .card__body > h3 { margin-bottom: 0.5rem; line-height: 1.3; }
  .card__body > p  { font-size: 0.8rem; color: var(--dim); line-height: 1.5; }


  /* ════ HERO CARD (bg-image com overlay escuro) ════ */
  .card--hero {
    background-image: var(--card-img, none);
    background-size: cover;
    background-position: center;
  }
  /* Overlay via ::before — sem div extra no HTML */
  .card--hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ov-hero);
  }
  .card--hero .card__content {
    position: relative;
    z-index: 1;
    margin-top: auto;
  }


  /* ════ PRODUCT CARD (bg-image lateral + gradiente) ════ */
  .card--product {
    background-image: var(--card-img, none);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right center;
    justify-content: space-between;
  }
  /* Overlay lateral via ::before */
  .card--product::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ov-left);
    pointer-events: none;
  }
  /* Variante: overlay topo-baixo (card tall de SSD) */
  .card--product-tb::before { background: var(--ov-tb); }
  /* Variante: overlay azul (tier Sniper) */
  .card--product-blue::before { background: var(--ov-left-b); }

  /* Filhos do product card sobem acima do overlay */
  .card--product > * { position: relative; z-index: 1; }


  /* ════ CARD COM MÍDIA NO TOPO ════ */
  .card--media-top {
    padding: 0;
    justify-content: flex-start;
  }
  .card__top-img {
    height: 38%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }
  .card__top-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.75;
  }
  /* Variante: imagem como background contain (sem elemento img) */
  .card__top-img--bg {
    background-color: var(--product-bg);
    background-image: var(--card-img, none);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .card__bottom {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .card__bottom--lg { padding: 1.5rem; }


  /* ════ CARD SPLIT (hero duas colunas) ════ */
  .card-split {
    display: grid !important;
    grid-template-columns: 58% 42%;
    padding: 0 !important;
  }
  .split-text {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
  }
  .split-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--product-bg);
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    padding: 2.5rem;
    overflow: hidden;
  }
  .split-img img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
  }


  /* ════ TIPOGRAFIA DE CARDS ════ */
  .card__title--hero {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 2.8vw, 2.8rem);
    line-height: 1.1;
    margin: 0.75rem 0 1rem;
  }
  .card__title--split {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 2.8vw, 3rem);
    line-height: 1.05;
    margin-bottom: 1rem;
  }
  .card__title--xl {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    line-height: 1.15;
  }
  .card__title--lg {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 1rem 0;
  }
  .card__title--md {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
  }
  .card__title--sm { font-size: 1.2rem; margin-bottom: 0.75rem; line-height: 1.3; }
  .card__title--xs { font-size: 1.1rem; margin-bottom: 0.75rem; line-height: 1.3; }
  .card__title--product { font-size: 1.2rem; margin-bottom: 0.5rem; line-height: 1.3; }
  .card__title--tall {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
  }

  .card__desc--hero { color: var(--dim); font-size: 1rem; margin-bottom: 1.5rem; max-width: 80%; line-height: 1.6; }
  .card__desc--md   { font-size: 0.85rem; color: #999; line-height: 1.5; margin-bottom: 1.5rem; }
  .card__desc--sm   { font-size: 0.8rem; color: #999; margin-bottom: 1rem; line-height: 1.5; }
  .card__desc--xs   { font-size: 0.8rem; color: #888; line-height: 1.5; }

  .card__meta {
    font-size: 0.6rem;
    color: #666;
    display: block;
    margin-bottom: 0.75rem;
  }

  .card__stat {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--red);
    display: block;
    margin: 0.5rem 0;
    line-height: 1.2;
  }
  .card__stat span { font-size: 0.85rem; font-weight: 700; }

  .card__specs {
    font-size: 0.6rem;
    color: #444;
    letter-spacing: 1px;
  }


  /* ════ BOTÕES ════ */
  .btn--red {
    display: block;
    width: 100%;
    background: var(--red);
    color: #fff;
    padding: 18px;
    text-align: center;
    font-weight: 900;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    letter-spacing: 1px;
    transition: opacity 0.2s;
  }
  .btn--red:hover { opacity: 0.88; }
  .btn--red--sm   { padding: 14px 28px; font-size: 0.75rem; width: auto; }

  .btn--outline {
    display: inline-block;
    background: transparent;
    color: var(--text);
    border: 2px solid rgba(255, 255, 255, 0.25);
    padding: 12px 24px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: border-color 0.3s, color 0.3s;
  }
  .btn--outline:hover { border-color: var(--red); color: var(--red); }

  .btn-amazon {
    display: block;
    width: 100%;
    background: var(--amazon);
    color: #000;
    text-align: center;
    padding: 14px;
    font-weight: 900;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    transition: opacity 0.2s;
  }
  .btn-amazon:hover { opacity: 0.9; }
  .btn-amazon--sm   { width: auto; padding: 14px 28px; }
  .btn-amazon--blue {
    background: transparent;
    color: var(--blue);
    border: 1px solid rgba(123, 156, 255, 0.4);
  }


  /* ════ BLOCOS DE CONTEÚDO ════ */

  /* Disclaimer de afiliados */
  .disclaimer {
    font-size: 0.7rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 3rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
  }

  /* Protocolo / Callout */
  .protocol {
    border-left: 4px solid var(--red);
    padding: 1.5rem 2rem;
    margin-bottom: 4rem;
  }
  .protocol__label {
    color: var(--red);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.75rem;
  }
  .protocol__title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    margin-bottom: 0.75rem;
  }
  .protocol__body {
    font-size: 0.85rem;
    color: var(--dim);
    max-width: 750px;
    line-height: 1.7;
  }
  .protocol__body strong { color: var(--text); }


  /* ════ FORMULÁRIO (Bunker) ════ */
  .bunker-hero {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
  }
  .bunker-hero__label {
    color: var(--red);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 2px;
  }
  .bunker-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
    margin: 1.5rem 0;
  }
  .bunker-hero__title em { font-style: normal; color: var(--red); }
  .bunker-hero__sub {
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.6;
  }

  .form-card {
    text-align: left;
    background: var(--card-bg);
    padding: 2.5rem;
    border: 1px solid var(--border);
  }
  .form-group  { margin-bottom: 1.5rem; }
  .form-group--last { margin-bottom: 2rem; }
  .form-label {
    display: block;
    font-size: 0.65rem;
    color: var(--red);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: 1px;
  }
  .field-wrap { position: relative; }
  .input-field {
    width: 100%;
    background: #000;
    border: 1px solid var(--border);
    padding: 18px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 16px;
    transition: border-color 0.3s;
  }
  .input-field:focus { border-color: var(--red); }
  /* :has() para estilizar o wrapper quando o campo está válido (CSS moderno) */
  .field-wrap:has(.input-field:valid:not(:placeholder-shown)) .input-field {
    border-color: rgba(0, 200, 80, 0.5);
  }
  .field-badge {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
  }
  .form-footer {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 1.5rem;
    text-align: center;
    line-height: 1.6;
  }
  .form-footer a { color: var(--muted); text-decoration: underline; }


  /* ════ CURSOR GLOW (desktop) ════ */
  #cursor-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(232,0,61,.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    will-change: left, top;
  }
}


/* ════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════ */
@layer utilities {
  .mt-auto { margin-top: auto; }
  .mb-1    { margin-bottom: 1rem; }
  .mb-2    { margin-bottom: 2rem; }
  .mb-3    { margin-bottom: 3rem; }
  .mb-4    { margin-bottom: 4rem; }

  .gap-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  @media (min-width: 769px) {
    .hide-desktop { display: none !important; }
  }
}


/* ════════════════════════════════════════════
   RESPONSIVIDADE
   ════════════════════════════════════════════ */
@media (max-width: 1000px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  body          { padding-bottom: 80px; }
  .hdr__nav     { display: none; }
  .hotbar       { display: flex; }
  .container    { padding: 3rem 5%; }
  #cursor-glow  { display: none; }

  .bento-grid { grid-template-columns: 1fr; grid-auto-rows: auto !important; }
  .card--large,
  .card--tall,
  .card--wide { grid-column: span 1 !important; grid-row: span 1; }

  /* Split: empilha no mobile, oculta imagem */
  .card-split            { display: flex !important; flex-direction: column; }
  .card-split .split-img { display: none; }

  /* Card media top: altura fixa no mobile */
  .card__top-img { height: 130px; }

  /* Product cards: imagem no topo em mobile */
  .card--product {
    background-position: center 1.5rem !important;
    background-size: auto 140px !important;
    padding-top: 165px !important;
    min-height: 310px;
  }
  .card--product::before {
    background: linear-gradient(
      to bottom,
      rgba(17,17,17,0)    0%,
      rgba(17,17,17,0)   44%,
      rgba(17,17,17,.97) 62%
    ) !important;
  }

  /* Botões: tap target mínimo 48px */
  .btn--outline {
    display: block;
    width: 100%;
    text-align: center;
    padding: 16px 24px;
  }
  .btn--red    { padding: 20px; }
  .btn-amazon  { padding: 18px; }
}
