/* ==========================================================================
   MAKRO CHUÍ - EXPLORADOR INTERATIVO DE OFERTAS + "MINHA LISTA" PESSOAL
   Convive com o encarte gráfico oficial (mesma seção #encarte). Usa as
   mesmas variáveis, cores, tipografia e componentes visuais já definidos
   em css/style.css — nenhum framework novo, apenas CSS vanilla.
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   TRANSIÇÃO SUAVE ENTRE AS DUAS VISTAS DO ENCARTE
   -------------------------------------------------------------------------- */
@keyframes offersFadeIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.encarte-view.is-fading-in {
  animation: offersFadeIn 0.35s ease;
}

/* --------------------------------------------------------------------------
   CARTÃO DO EXPLORADOR
   -------------------------------------------------------------------------- */
.offers-explorer-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  max-width: 1080px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  text-align: left;
}

.offers-explorer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.offers-explorer-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--color-text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.offers-explorer-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 480px;
}

.offers-vigencia-line {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-primary-green);
  margin-top: 6px;
}

.btn-my-list {
  background: var(--color-dark-banner);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.btn-my-list:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   BUSCADOR
   -------------------------------------------------------------------------- */
.offers-search-wrap {
  position: relative;
  margin-bottom: 14px;
}

.offers-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--color-text-muted);
  pointer-events: none;
}

.offers-search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--color-text-dark);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease;
}

.offers-search-input:focus {
  border-color: var(--color-primary-green);
}

/* --------------------------------------------------------------------------
   FILTROS DE CATEGORIA — rolagem horizontal em telas estreitas
   -------------------------------------------------------------------------- */
.offers-categories-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 18px;
  scrollbar-width: thin;
}

.offers-categories-row::-webkit-scrollbar {
  height: 5px;
}

.offers-categories-row::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}

.offers-cat-chip {
  background: #f1f5f9;
  color: var(--color-text-dark);
  font-weight: 800;
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.offers-cat-chip:hover {
  border-color: var(--color-border-green);
}

.offers-cat-chip.is-active {
  background: var(--color-primary-green);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   GRADE DE PRODUTOS — responsiva (2 / 3 / 4 colunas)
   -------------------------------------------------------------------------- */
.offers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 380px) {
  .offers-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 700px) {
  .offers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .offers-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Acompanha o container mais largo da seção #encarte em telas grandes (ver
   .encarte-section .container em css/style.css) — o cartão deixa de ter um
   teto fixo de 1080px e a grade ganha mais colunas para preencher o espaço
   em vez de esticar 4 cartões finos. */
@media (min-width: 1240px) {
  .offers-explorer-card {
    max-width: 100%;
  }

  .offers-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1650px) {
  .offers-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.offer-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.offer-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.offer-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-primary-red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  z-index: 1;
  letter-spacing: 0.3px;
}

.offer-card-glutenfree-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--color-primary-green);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 900;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  z-index: 1;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.offers-glutenfree-intro {
  background: var(--color-light-mint);
  border: 1px solid var(--color-border-green);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.offers-glutenfree-intro-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--color-text-dark);
  margin: 0 0 6px;
}

.offers-glutenfree-intro-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.offer-card-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: var(--color-section-bg);
}

.offer-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.offer-card-cat {
  font-size: 10px;
  font-weight: 800;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.offer-card-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--color-text-dark);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.offer-card-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
  margin-bottom: 2px;
}

.offer-card-price-old {
  font-size: 11px;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.offer-card-discount {
  background: #fee2e2;
  color: var(--color-primary-red);
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.offer-card-price-now {
  font-size: 16px;
  font-weight: 900;
  color: var(--color-dark-banner);
}

.offer-card-price-uyu {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.offer-card-add-btn {
  margin-top: auto;
  background: var(--color-primary-green);
  color: #ffffff;
  font-weight: 800;
  font-size: 11.5px;
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s ease, transform 0.15s ease;
}

.offer-card-add-btn:hover {
  transform: translateY(-1px);
}

.offer-card-add-btn.is-added {
  background: #dcfce7;
  color: var(--color-primary-green);
  border: 1.5px solid var(--color-border-green);
}

.offer-card-brand {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.offer-card-action {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.offer-card-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0fdf4;
  border: 1.5px solid var(--color-border-green);
  border-radius: 10px;
  padding: 4px;
}

.offer-qty-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
  border: none;
  background: var(--color-primary-green);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.offer-qty-btn:hover {
  transform: translateY(-1px);
}

.offer-qty-value {
  font-size: 14px;
  font-weight: 900;
  color: var(--color-text-dark);
  min-width: 20px;
  text-align: center;
}

.offer-card-subtotal {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-dark-banner);
  text-align: center;
}

.offers-no-results {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 30px 10px;
}

.offers-demo-notice {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.5;
  border-top: 1px dashed var(--color-border);
  padding-top: 14px;
  margin-top: 6px;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   PAINEL "MINHA LISTA" — referência pessoal local (não é pedido/reserva)
   -------------------------------------------------------------------------- */
.offers-list-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 10010;
  display: flex;
  justify-content: flex-end;
  animation: offersOverlayFadeIn 0.25s ease;
}

.offers-list-overlay[hidden] {
  display: none;
}

@keyframes offersOverlayFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.offers-list-drawer {
  width: 380px;
  max-width: 92vw;
  height: 100%;
  background: #ffffff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  padding: 20px;
  animation: offersDrawerSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes offersDrawerSlideIn {
  0% { transform: translateX(100%); }
  100% { transform: translateX(0); }
}

.offers-list-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.offers-list-drawer-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--color-text-dark);
}

.offers-list-count-text {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-top: 2px;
}

.offers-list-close-btn {
  background: #f1f5f9;
  border: none;
  color: var(--color-text-dark);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.offers-list-close-btn:hover {
  background: #e2e8f0;
}

.offers-list-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.offers-list-item {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.offers-list-item-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.offers-list-item-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.offers-list-item-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offers-list-item-unit {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.offers-list-item-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.offers-list-item-stepper .offer-qty-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 15px;
}

.offers-list-item-subtotal {
  font-size: 13px;
  font-weight: 900;
  color: var(--color-dark-banner);
  white-space: nowrap;
}

.offers-list-item-remove {
  background: #fee2e2;
  color: var(--color-primary-red);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.offers-list-item-remove:hover {
  background: #fecaca;
}

/* Estado vazio */
.offers-list-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 20px 8px;
}

.offers-list-empty-icon {
  font-size: 40px;
  margin-bottom: 4px;
}

.offers-list-empty h4 {
  font-size: 16px;
  font-weight: 900;
  color: var(--color-text-dark);
}

.offers-list-empty p {
  font-size: 12.5px;
  color: var(--color-text-muted);
  max-width: 260px;
}

.offers-list-empty-note {
  font-size: 11px;
  font-style: italic;
  color: var(--color-text-muted);
  border-top: 1px dashed var(--color-border);
  padding-top: 10px;
  margin-top: 4px;
}

.offers-list-empty #btn-empty-explore {
  margin-top: 8px;
  width: auto;
  padding: 11px 24px;
}

/* Rodapé: total estimado + ações */
.offers-list-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
  margin-bottom: 10px;
}

.offers-list-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text-dark);
  margin-bottom: 4px;
}

.offers-list-total-row strong {
  font-size: 17px;
  color: var(--color-dark-banner);
}

.offers-list-disclaimer-small {
  font-size: 10.5px;
  color: var(--color-text-muted);
  line-height: 1.4;
  font-style: italic;
  margin-bottom: 12px;
}

.offers-currency-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.offers-currency-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-dark);
}

.offers-currency-select {
  flex: 1;
  max-width: 200px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--color-text-dark);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

#btn-calc-total {
  font-size: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.offers-calc-result {
  background: #f0fdf4;
  border: 1.5px solid var(--color-border-green);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.offers-calc-result[hidden] {
  display: none;
}

.offers-calc-line {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 4px;
}

.offers-calc-line-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.offers-calc-line-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--color-dark-banner);
  margin-bottom: 6px;
}

.offers-calc-line-equiv {
  font-size: 15px;
  font-weight: 900;
  color: var(--color-primary-green);
}

.offers-calc-disclaimer {
  font-size: 10.5px;
  color: var(--color-text-muted);
  line-height: 1.4;
  font-style: italic;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.offers-list-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offers-list-actions .btn-outline-full {
  font-size: 12px;
  padding: 10px 12px;
}

.btn-clear-list {
  background: #fee2e2;
  color: var(--color-primary-red);
  font-weight: 800;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  width: 100%;
  border: 1.5px solid #fecaca;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-clear-list:hover {
  background: #fecaca;
}

.offers-list-disclaimer {
  font-size: 10.5px;
  color: var(--color-text-muted);
  line-height: 1.5;
  font-style: italic;
  text-align: center;
  padding-top: 6px;
}

/* --------------------------------------------------------------------------
   MÓVIL
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .offers-explorer-card {
    padding: 16px;
    border-radius: 18px;
  }

  .offers-explorer-header {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-my-list {
    width: 100%;
    text-align: center;
  }

  .offer-card-img {
    height: 90px;
  }

  .offers-list-drawer {
    width: 100%;
    max-width: 100%;
  }

  .offers-list-item {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "img info"
      "sub sub";
    row-gap: 6px;
  }

  .offers-list-item-img { grid-area: img; }
  .offers-list-item-info { grid-area: info; }

  .offers-list-item-subtotal,
  .offers-list-item-remove {
    grid-area: sub;
  }

  .offers-list-item-subtotal {
    justify-self: start;
  }

  .offers-list-item-remove {
    justify-self: end;
    margin-left: auto;
  }

  .offers-currency-row {
    flex-direction: column;
    align-items: stretch;
  }

  .offers-currency-select {
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   SEÇÃO "SEM GLÚTEN" — vitrine independente (fora do #encarte), reaproveita
   as mesmas grades e cartões (.offers-grid / .offer-card) do explorador.
   -------------------------------------------------------------------------- */
.glutenfree-section {
  background-color: #ffffff;
  padding: 44px 0;
  text-align: center;
}

.glutenfree-grid {
  max-width: 1080px;
  margin: 0 auto;
  text-align: left;
}
