/*
Theme Name: BFTD Afiliados 1.10.19 â€“ Card Estreito (Fresh)
Theme URI: https://blackfridaytododia.com.br/
Author: Luiz
Description: Tema completo para catÃ¡logo de ofertas com links de afiliado (Shopee, Amazon, Mercado Livre etc.), usando cards estreitos com imagem alta e filtros por loja/categoria.
Version: 1.10.19
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bftd-afiliados
*/

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b0b10;
  color: #f5f5f5;
}

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

a:hover {
  text-decoration: underline;
}

.site-header {
  background: #111320;
  border-bottom: 1px solid #22253a;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  gap: 16px;
  flex: 1;
}

.site-nav a {
  font-size: 0.9rem;
  opacity: 0.8;
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
  opacity: 1;
}

.site-search {
  margin-left: auto;
}

.site-search input[type="search"] {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #33374f;
  background: #0b0b10;
  color: #f5f5f5;
  min-width: 220px;
}

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hero {
  margin-bottom: 32px;
  padding: 24px;
  border-radius: 16px;
  background: radial-gradient(circle at top left, #2f80ed 0, #111320 45%, #0b0b10 100%);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.hero p {
  margin: 0;
  opacity: 0.9;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 8px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.2rem;
}

.section-title a {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Barra de filtros */

.offer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 16px;
  align-items: center;
  justify-content: center;
}

.offer-filters label {
  font-size: 0.8rem;
  opacity: 0.8;
}

.offer-filters select {
  background: #111320;
  border-radius: 999px;
  border: 1px solid #33374f;
  padding: 4px 10px;
  color: #f5f5f5;
  font-size: 0.8rem;
}

.offer-filters button {
  border-radius: 999px;
  border: 1px solid #33374f;
  background: #2f80ed;
  padding: 5px 14px;
  font-size: 0.8rem;
  cursor: pointer;
}

.offer-filters button:hover {
  filter: brightness(1.05);
}

/* === CARDS ESTREITOS + IMAGEM ALTA === */

.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 240px));
  justify-content: center;
  gap: 22px;

  align-items: stretch;
}

.offer-card {
  width: 100%;
  max-width: 240px;
  border-radius: 14px;
  overflow: hidden;
  background: #111320;
  border: 1px solid #22253a;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform .1s ease, box-shadow .1s ease;
}

.offer-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,.45);
}

/* Thumb padrão Shopee (quadrado 1:1) */
.offer-card-thumb{
  width: 100%;
  aspect-ratio: 1 / 1;   /* quadrado */
  overflow: hidden;
}

.offer-card-thumb-inner{
  position: relative;
  width: 100%;
  height: 100%;
}

.offer-card-thumb img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;     /* preenche o quadrado (padrão marketplace) */
  object-position: center;
  background: transparent;
}

/* Badge da loja */
.offer-store-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0b0b10;
  background: #ff7a00;
}

/* Badge de desconto */
.offer-discount-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #e63946;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

/* Corpo do card */
.offer-card-body {
  padding: 12px 14px 18px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.offer-title {
  font-size: 1rem;
  line-height: 1.35;
  height: 42px; /* 2 linhas */
  overflow: hidden;
  margin: 0;
}

.offer-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 4px;
}

.offer-price-current {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ff7a00;
}

.offer-price-old {
  font-size: 0.85rem;
  color: #aaa;
  text-decoration: line-through;
}

.offer-meta-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.offer-flag {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #33374f;
}

/* BotÃ£o */
.offer-card-footer {
  margin-top: auto;
  padding-top: 6px;
}

.offer-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 9px 12px;
  background: linear-gradient(135deg, #ff7a00, #ffb703);
  color: #0b0b10;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.offer-button:hover {
  filter: brightness(1.05);
}

/* Single oferta e rodapÃ© */

.offer-single {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr);
  gap: 28px;
}

.offer-single-img img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid #22253a;
}

.offer-single-meta {
  background: #111320;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #22253a;
}

.offer-single-meta h1 {
  margin-top: 0;
}

.offer-single-meta .offer-price-row {
  margin: 10px 0 12px;
}

.offer-single-meta .offer-button {
  margin: 10px 0 16px;
}

.offer-taxonomies {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 8px;
}

.site-footer {
  margin-top: 40px;
  padding: 20px 16px;
  text-align: left;
  font-size: 0.8rem;
  border-top: 1px solid #22253a;
  background: #0b0b10;
  opacity: 0.8;
}

/* Admin preview do thumbnail no metabox */
.bftd-thumb-preview {
  margin-bottom: 8px;
}
.bftd-thumb-preview img {
  max-width: 160px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #33374f;
}

/* Responsivo */

@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  .site-search {
    width: 100%;
  }
  .site-search input[type="search"] {
    width: 100%;
    min-width: 0;
  }
  .offer-single {
    grid-template-columns: 1fr;
  }
}

/* Header logo smaller */
.site-logo img {
  max-height: 40px;
  width: auto;
  display: block;
}

/* Home intro with logo, tagline and search */
.home-intro {
  text-align: left;
  padding: 32px 16px 24px;
}
.home-logo img {
  max-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
}
.home-tagline {
  font-size: 24px;
  color: #facc15;
  font-weight: 600;
  margin-bottom: 16px;
}
.home-search .search-form {
  max-width: 480px;
  margin: 0 auto;
}

/* Search form styling */
.search-form-inner {
  display: flex;
  gap: 8px;
}
.search-field {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 15px;
}
.search-field::placeholder {
  color: #6b7280;
}
.search-submit {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

/* Sticky filters bar */
.offer-filters-wrapper {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 8px 0;
  background: #020617;
}
.offers-section .offer-filters-wrapper {
  margin-bottom: 16px;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateY(10px);
  z-index: 50;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.site-header{padding:0!important;min-height:0!important;}

/* Fixed header similar style */
.site-header.site-header-fixed {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #020617;
  border-bottom: 1px solid #111827;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.header-logo img {
  max-height: 32px;
  width: auto;
  display: block;
}
.header-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #f9fafb;
  text-decoration: none;
}
.header-tagline {
  font-size: 14px;
  color: #e5e7eb;
  white-space: nowrap;
}
.header-search {
  flex: 1;
}
.header-search .search-form {
  max-width: none;
  margin: 0;
}
.site-nav {
  margin-left: 8px;
}

/* Ensure main has space below sticky header + filters */
.site-main {
  padding-top: 8px;
}

/* Adjust sticky filters to appear below header */
.offer-filters-wrapper {
  position: sticky;
  top: 64px;
  z-index: 30;
  padding: 8px 0;
  background: #020617;
}

/* Super header fixed at top */
.super-header.super-header-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #020617;
  border-bottom: 1px solid #111827;
}
.super-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.super-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.super-header-logo img {
  max-height: 40px;
  width: auto;
  display: block;
}
.super-header-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #f9fafb;
  text-decoration: none;
}
.super-header-tagline {
  font-size: 14px;
  color: #e5e7eb;
  white-space: nowrap;
}
.super-header-search {
  flex: 1;
}
.super-header-search .search-form {
  max-width: none;
  margin: 0;
}

/* Give space so content doesn't hide under fixed header */
.site-main {
  padding-top: 72px;
}

/* Filters bar sticky just under the header */
.offer-filters-wrapper {
  position: sticky;
  top: 72px;
  z-index: 30;
  padding: 8px 0;
  background: #020617;
}

/* Super header layout: big logo, tagline with emphasis, search below */
.super-header.super-header-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #020617;
  border-bottom: 1px solid #111827;
}
.super-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 14px;
  display: flex;
  align-items: flex-start;
}
.super-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}
.super-header-logo img {
  max-height: 72px;
  width: auto;
  display: block;
}
.super-header-logo-text {
  font-size: 24px;
  font-weight: 800;
  color: #f9fafb;
  text-decoration: none;
}
.super-header-tagline {
  font-size: 18px;
  font-weight: 600;
  color: #facc15;
}
.super-header-search {
  width: 100%;
  margin-top: 4px;
}
.super-header-search .search-form {
  max-width: 520px;
  margin: 0;
}
.super-header-search .search-form-inner {
  display: flex;
  gap: 8px;
}
.super-header-search .search-field {
  flex: 1;
  padding: 11px 14px;
  font-size: 15px;
}
.super-header-search .search-submit {
  padding: 11px 20px;
  font-size: 14px;
}

/* Increase top padding of main and filters to account for taller header */
.site-main {
  padding-top: 160px;
}
.offer-filters-wrapper {
  top: 160px;
}

/* Super header: logo + right column (tagline + search) */
.super-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.super-header-logo img {
  max-height: 130px;
  width: auto;
  display: block;
}
.super-header-logo-text {
  font-size: 24px;
  font-weight: 800;
  color: #f9fafb;
  text-decoration: none;
}
.super-header-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.super-header-tagline {
  font-size: 20px;
  font-weight: 700;
  color: #facc15;
  margin-bottom: 6px;
}
.super-header-search .search-form {
  max-width: 500px;
  margin: 0;
}
@media (max-width: 700px) {
  /* Header em duas linhas: 
     1Âª linha = logo Ã  esquerda + frase Ã  direita
     2Âª linha = barra de busca ocupando toda a largura */
  .super-header-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
  }

  .super-header-right {
    display: contents;
  }

  .super-header-logo {
    grid-column: 1;
    grid-row: 1;
  }

  .super-header-logo img {
    max-height: 80px;
    height: auto;
  }

  .super-header-tagline {
    grid-column: 2;
    grid-row: 1;
    font-size: 16px;
    line-height: 1.2;
    text-align: left;
  }

  .super-header-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .super-header-search .search-form {
    width: 100%;
    max-width: 100%;
  }
}
}


/* BotÃ£o de limpar filtros em vermelho */
.clear-filters {
  padding: 6px 14px;
  background: #d62d2d;
  border: 1px solid #a12222;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  margin-left: 8px;
}

.clear-filters:hover {
  background: #b52222;
}

/* Filtro de faixa de preÃ§o */
.price-range-filter {
  display: flex;
  align-items: center;
  gap: 4px;
}

.price-range-filter input[type="number"] {
  width: 90px;
}

.price-range-separator {
  font-size: 0.85rem;
  opacity: 0.8;
}


/* Badge loja branca */
.offer-badge,
.oferta-badge,
.badge-loja,
[class*="badge"] {
    color: #ffffff !important;
}


/* Ajuste (Shopee): thumb quadrado (1:1) */
.offer-card{
  width: 100%;
  max-width: 240px;
  overflow: hidden;
}

.offer-card-thumb{
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.offer-card-thumb-inner{
  position: relative;
  width: 100%;
  height: 100%;
}

.offer-card-thumb img{
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  background: transparent !important;
}




/* FIX â€” Filter bar aligned LEFT */
.offer-filters {
    justify-content: flex-start !important;
    text-align: left !important;
    margin-left: 0 !important;
    width: 100% !important;
}

.offer-filters select,
.offer-filters input,
.offer-filters button {
    margin-right: 8px !important;
}


/* Ajuste mobile: evitar que a barra de filtros esconda o menu de lojas ao rolar */
@media (max-width: 700px) {
  .offer-filters-wrapper {
    position: static;
    top: auto;
  }
}


/* Ajuste mobile 2: manter filtros fixos abaixo do header sem esconder nada */
@media (max-width: 700px) {
  .site-main {
    padding-top: 165px;
  }
  .offer-filters-wrapper {
    position: sticky;
    top: 165px;
  }
}

/* Desktop: reforÃ§a a barra de filtros acima dos cards */
@media (min-width: 701px) {
  .offer-filters-wrapper {
    position: sticky;
    top: 160px;
    z-index: 60;              /* acima dos cards, abaixo do header (50) se necessÃ¡rio */
    background: #020617;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.85);
  }
}