/* ============================================================
   LACMOO — components.css
   Navbar, botões, cards de produto, drawer do carrinho,
   toast, badges e demais componentes reutilizáveis
   ============================================================ */

/* ----------------------------------------------------------
   NAVBAR
---------------------------------------------------------- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background-color: var(--color-bg-white);
  border-bottom: var(--border-thin) solid var(--color-border-light);
  z-index: var(--z-navbar);
  transition: box-shadow var(--transition-base), background-color var(--transition-base);
}

/* Navbar com sombra ao rolar */
.navbar.is-scrolled {
  box-shadow: var(--shadow-md);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-6);
}

/* Logo */
.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
}

.navbar__logo-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--color-text-dark);
  letter-spacing: -0.02em;
}

/* Menu desktop */
.navbar__menu {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
}

.navbar__link {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
}

.navbar__link:hover,
.navbar__link.is-active {
  color: var(--color-primary);
  background-color: var(--color-bg-main);
}

/* Ações da navbar */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Botão carrinho */
.btn-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: transparent;
  color: var(--color-text-primary);
  border: var(--border-base) solid var(--color-border);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
              color var(--transition-fast);
}

.btn-cart:hover {
  background-color: var(--color-bg-main);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-cart__icon {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.btn-cart__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding-inline: var(--space-1);
  background-color: var(--color-badge);
  color: var(--color-badge-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform var(--transition-spring);
}

.btn-cart__badge.is-bumped {
  transform: scale(1.4);
}

/* Badge oculto quando zerado — por atributo (JS) ou conteúdo inicial */
.btn-cart__badge[data-count="0"],
.btn-cart__badge:empty {
  display: none;
}

/* Hamburguer (mobile) */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.navbar__hamburger:hover {
  background-color: var(--color-bg-main);
}

.navbar__hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Hamburguer animado (estado aberto) */
.navbar__hamburger.is-open .navbar__hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar__hamburger.is-open .navbar__hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.navbar__hamburger.is-open .navbar__hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ----------------------------------------------------------
   BOTÕES
---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: var(--radius-full);
  border: var(--border-base) solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

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

/* Primário */
.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  color: var(--color-text-light);
}

/* Outline */
.btn--outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--outline:hover {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

/* Ghost */
.btn--ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}

.btn--ghost:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

/* Danger */
.btn--danger {
  background-color: transparent;
  color: var(--color-error);
  border-color: var(--color-error);
}

.btn--danger:hover {
  background-color: var(--color-error);
  color: white;
}

/* Tamanhos */
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* Largura total */
.btn--full {
  width: 100%;
}

/* ----------------------------------------------------------
   CARD DE PRODUTO
---------------------------------------------------------- */

.product-card {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: var(--border-thin) solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Imagem do produto */
.product-card__image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--color-bg-main);
  position: relative;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms ease, filter 700ms ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.product-card:hover .product-card__image {
  transform: scale(1.018);
  filter: saturate(1.04);
}

/* Badge (ex: "Novo", "Destaque") */
.product-card__badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background-color: var(--color-primary);
  color: var(--color-text-light);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Corpo do card */
.product-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-2);
}

.product-card__category {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.product-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text-dark);
  line-height: var(--leading-snug);
}

.product-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  flex: 1;
}

/* Rodapé do card: preço + botão */
.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-thin) solid var(--color-border-light);
  gap: var(--space-3);
}

.product-card--showcase .product-card__footer {
  display: none;
}

.product-card__price {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

/* Overlay de tributo (vídeo) exibido ao aplicar cupom especial */
.tribute-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.85);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:24px;
}
.tribute-wrap{width:100%;max-width:960px;position:relative;border-radius:8px;overflow:hidden;background:transparent}
.tribute-wrap iframe,.tribute-wrap video{width:100%;height:60vh;border:0;display:block}
.tribute-close{
  position:absolute;
  top:8px;
  right:8px;
  width:36px;
  height:36px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--color-bg-white);
  color:var(--color-text-dark);
  border:0;
  border-radius:50%;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  box-shadow:var(--shadow-sm);
}
.tribute-close:hover{transform:scale(1.05)}

.product-card__price-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.product-card__price-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
}

/* ----------------------------------------------------------
   DRAWER DO CARRINHO
---------------------------------------------------------- */

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--cart-width);
  max-width: 100vw;
  height: 100vh;
  background-color: var(--color-bg-white);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-xl);
}

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

/* Header do drawer */
.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: var(--border-thin) solid var(--color-border-light);
  flex-shrink: 0;
}

.cart-drawer__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-dark);
}

.cart-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.cart-drawer__close:hover {
  background-color: var(--color-bg-main);
  color: var(--color-text-primary);
}

.cart-drawer__close svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* Corpo do drawer (lista de itens) */
.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6);
}

/* Rodapé do drawer (cupom + total + botão) */
.cart-drawer__footer {
  padding: var(--space-5) var(--space-6);
  border-top: var(--border-thin) solid var(--color-border-light);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Estado vazio do carrinho */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  gap: var(--space-3);
  height: 100%;
}

.cart-empty__mascot {
  width: 100px;
  height: 100px;
  object-fit: contain;
  opacity: 0.6;
  pointer-events: none;
  margin-bottom: var(--space-2);
}

.cart-empty__text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
}

.cart-empty__sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* Item do carrinho */
.cart-item {
  display: flex;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: var(--border-thin) solid var(--color-border-light);
  animation: slideIn var(--transition-base) ease;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item__image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  background-color: var(--color-bg-main);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.cart-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cart-item__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-text-dark);
  line-height: var(--leading-snug);
}

.cart-item__price {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: var(--weight-bold);
}

/* Controles de quantidade */
.cart-item__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: var(--border-base) solid var(--color-border);
  background: none;
  color: var(--color-text-primary);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  line-height: 1;
}

.qty-btn:hover {
  background-color: var(--color-bg-main);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.qty-display {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  min-width: 24px;
  text-align: center;
}

.cart-item__remove {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.cart-item__remove:hover {
  color: var(--color-error);
}

.cart-item__remove svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* ----------------------------------------------------------
   CAMPO DE CUPOM
---------------------------------------------------------- */

.cart-coupon__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.cart-coupon__row {
  display: flex;
  gap: var(--space-2);
}

.cart-coupon__input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: var(--border-base) solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background-color: var(--color-bg-main);
  transition: border-color var(--transition-fast);
  text-transform: uppercase;
}

.cart-coupon__input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 132, 127, 0.15);
}

.cart-coupon__input::placeholder {
  text-transform: none;
  color: var(--color-text-muted);
}

.cart-coupon__feedback {
  font-size: var(--text-xs);
  margin-top: var(--space-2);
  min-height: 1.2em;
  font-weight: var(--weight-medium);
}

.cart-coupon__feedback--success {
  color: var(--color-success);
}

.cart-coupon__feedback--error {
  color: var(--color-error);
}

/* ----------------------------------------------------------
   RESUMO DO CARRINHO
---------------------------------------------------------- */

.cart-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.cart-summary__row--discount .cart-summary__discount {
  color: var(--color-success);
  font-weight: var(--weight-semibold);
}

.cart-summary__row--total {
  font-size: var(--text-lg);
  color: var(--color-text-dark);
  padding-top: var(--space-3);
  margin-top: var(--space-1);
  border-top: var(--border-base) solid var(--color-border);
}

/* ----------------------------------------------------------
   TOAST — Notificações temporárias
---------------------------------------------------------- */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background-color: var(--color-text-dark);
  color: var(--color-text-light);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn var(--transition-base);
  max-width: 320px;
}

.toast--success { border-left: 4px solid var(--color-success); }
.toast--error   { border-left: 4px solid var(--color-error); }
.toast--info    { border-left: 4px solid var(--color-primary); }

.toast.is-hiding {
  animation: toastOut var(--transition-base) forwards;
}

/* ----------------------------------------------------------
   SEÇÃO FOOTER (botão centralizado)
---------------------------------------------------------- */

.section-footer {
  display: flex;
  justify-content: center;
  margin-top: var(--space-12);
}

/* ----------------------------------------------------------
   ANIMAÇÕES
---------------------------------------------------------- */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}
