/* Bloco: Variáveis de estilo locais */
:root {
  /* nenhuma variável local obrigatória por enquanto */
}

/* Bloco: Layout principal do componente */
.mc-header {
  background: var(--mc-surface);
  border-bottom: 1px solid var(--mc-border);
}

.mc-header__bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--mc-gap);
  padding: 12px 0;
  position: relative;
}

/* Logo */
.mc-logo,
.mc-header__logo {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--mc-border);
  background: #fff;
}

.mc-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Navegação desktop */
.mc-header__nav {
  justify-self: center;
}

.mc-nav__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 18px;
}

.mc-nav__list > li > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--mc-text-weak);
  border: 1px solid transparent;
  font-size: 0.9rem;
}

.mc-nav__list > li > a:hover {
  background: var(--mc-layer);
  color: var(--mc-text);
  border-color: var(--mc-border);
}

/* Ações (botões à direita) */
.mc-header__actions {
  display: flex;
  justify-self: flex-end;
  align-items: center;
  gap: 10px;
}

.mc-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--mc-layer);
  border: 1px solid var(--mc-border);
  padding: 8px 10px;
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.mc-action:hover {
  border-color: color-mix(in oklab, var(--mc-accent) 45%, var(--mc-border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--mc-accent) 20%, transparent);
  background: #fff;
}

.mc-action__icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.mc-action__label {
  font-size: 0.92rem;
  color: var(--mc-text-weak);
}

/* Badge do carrinho */
.mc-action--cart {
  position: relative;
}

.mc-cartbadge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--mc-accent);
  color: var(--mc-accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 0 0 2px #fff;
}

/* Bloco: Elementos internos (hambúrguer, menu mobile, barra mobile) */

/* Botão hambúrguer */
.mc-header__burger {
  display: none; /* desktop */
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--mc-border);
  background: var(--mc-layer);
  padding: 6px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column; /* 3 tracinhos um embaixo do outro */
}

.mc-header__burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--mc-text);
}

/* Menu mobile em overlay (estilo “vidro”) */
.mc-headermenu {
  position: fixed;
  inset: 0;
  z-index: 10950;
  display: none;
}

.mc-headermenu.is-open {
  display: block;
}

.mc-headermenu__overlay {
  position: absolute;
  inset: 0;
  background: var(--mc-overlay);
  backdrop-filter: blur(2px);
  opacity: 0;
  animation: mc-headermenu-fade .22s forwards;
}

@keyframes mc-headermenu-fade {
  to { opacity: 1; }
}

.mc-headermenu__panel {
  position: absolute;
  top: 0;
  left: 0;
  width: min(320px, 82vw);
  height: 100%;
  background: rgba(255,255,255,.9);
  border-right: 1px solid var(--mc-border);
  box-shadow: 14px 0 32px rgba(0,0,0,.20);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  transform: translateX(-10px);
  opacity: 0;
  animation: mc-headermenu-slide .24s ease forwards;
}

@keyframes mc-headermenu-slide {
  to { transform: translateX(0); opacity: 1; }
}

.mc-headermenu__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--mc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mc-headermenu__head span {
  font-weight: 600;
  color: var(--mc-text);
}

.mc-headermenu__close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: transparent;
  font-size: 20px;
}

.mc-headermenu__close:hover {
  background: var(--mc-layer);
}

.mc-headermenu__body {
  padding: 10px 12px 16px;
  overflow-y: auto;
  flex: 1;
}

.mc-headermenu__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mc-headermenu__list > li > a {
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--mc-text);
  font-size: 0.95rem;
}

.mc-headermenu__list > li > a:hover {
  background: var(--mc-layer);
}

/* Barra inferior mobile */
.mc-mobilebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10050;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--mc-border);
  padding: 8px;
}

.mc-mobilebar__row {
  display: flex;
  justify-content: space-around;
}

.mc-mbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mc-mbtn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.mc-mbtn span {
  font-size: 0.72rem;
  color: var(--mc-text-weak);
}

.mc-mbtn:hover span {
  color: var(--mc-accent);
}

/* Bloco: Cart Drawer (aba lateral do carrinho) */

.mc-cartdrawer {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: none;
}

.mc-cartdrawer.is-open {
  display: block;
}

/* overlay escurecendo levemente + blur */
.mc-cartdrawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,17,26,.25);
  backdrop-filter: blur(6px);
  opacity: 0;
  animation: mc-cartdrawer-fade .22s forwards;
}

@keyframes mc-cartdrawer-fade {
  to { opacity: 1; }
}

/* painel com vidro translúcido bem opaco */
.mc-cartdrawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--mc-drawer-w);
  max-width: 100%;
  height: 100%;
  background: rgba(255,255,255,.78);
  border-left: 1px solid var(--mc-border);
  box-shadow: var(--mc-shadow-xl);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  transform: translateX(12px);
  opacity: 0;
  animation: mc-cartdrawer-slide .24s ease forwards;
}

@keyframes mc-cartdrawer-slide {
  to { transform: translateX(0); opacity: 1; }
}

.mc-cartdrawer__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--mc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mc-cartdrawer__title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--mc-text);
}

.mc-cartdrawer__close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--mc-border);
  background: rgba(255,255,255,.75);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-cartdrawer__close:hover {
  background: #fff;
}

.mc-cartdrawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 18px;
}

/* Skeleton básico para quando estiver carregando */
.mc-skel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mc-skel__card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--mc-layer);
}

.mc-skel__thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--mc-border);
}

.mc-skel__line {
  height: 12px;
  border-radius: 999px;
  background: var(--mc-border);
}

/* Bloco: Mini-cart WooCommerce (itens, subtotal, botões) */

.mc-cartdrawer .widget_shopping_cart_content {
  font-family: var(--mc-font-ui);
  font-size: 0.9rem;
  color: var(--mc-text);
}

/* lista de itens */
.mc-cartdrawer .woocommerce-mini-cart,
.mc-cartdrawer .woocommerce-mini-cart__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Card do produto – layout em flex:
   [IMG] [Título]
   (abaixo, quantity recuado) */
.mc-cartdrawer .woocommerce-mini-cart-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--mc-border);
}

/* Linha principal: imagem + título */
.mc-cartdrawer .woocommerce-mini-cart-item-header {
  /* classe não existe no HTML, então usamos o próprio <a> como "header":
     ver regra logo abaixo */
}

/* link do produto vira um flex row: IMG | texto */
.mc-cartdrawer .woocommerce-mini-cart-item > a:not(.remove) {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mc-text);
  text-decoration: none;
}

.mc-cartdrawer .woocommerce-mini-cart-item > a:not(.remove):hover {
  text-decoration: underline;
}

/* Thumbnail sempre à esquerda */
.mc-cartdrawer .woocommerce-mini-cart-item img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
  flex-shrink: 0;
}

/* "2 × R$ X" alinhado abaixo do título, com recuo da largura da imagem */
.mc-cartdrawer .woocommerce-mini-cart-item .quantity {
  margin-left: calc(56px + 10px);
  font-size: 0.85rem;
  color: var(--mc-text-weak);
}

/* Botão remover – X dentro de um círculo no canto superior direito */
.mc-cartdrawer .woocommerce-mini-cart-item .remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--mc-border);
  background: rgba(255,255,255,.9);
  color: var(--mc-danger, #EF4444);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.mc-cartdrawer .woocommerce-mini-cart-item .remove:hover {
  background: var(--mc-danger-bg, #3c1111);
  color: var(--mc-danger-tx, #ffb3b3);
}

/* Mensagem de carrinho vazio */
.mc-cartdrawer .woocommerce-mini-cart__empty-message {
  margin: 12px 0 4px;
  font-size: 0.9rem;
  color: var(--mc-text-weak);
}

/* Subtotal */
.mc-cartdrawer .woocommerce-mini-cart__total {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--mc-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--mc-text);
}

.mc-cartdrawer .woocommerce-mini-cart__total strong {
  font-weight: 600;
}

/* Botões "Ver carrinho" e "Finalizar compras" */
.mc-cartdrawer .woocommerce-mini-cart__buttons {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.mc-cartdrawer .woocommerce-mini-cart__buttons .button {
  flex: 1;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--mc-border);
  background: #f3f3f3;
  color: #111;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 3px 9px rgba(0,0,0,.08);
}

.mc-cartdrawer .woocommerce-mini-cart__buttons .button.checkout {
  background: var(--mc-accent);
  color: var(--mc-accent-ink);
  border-color: transparent;
}

.mc-cartdrawer .woocommerce-mini-cart__buttons .button:hover {
  filter: brightness(0.97);
}

/* Bloco: Responsividade (breakpoints) */

/* Desktop (>= 768px) */
@media (min-width: 768px) {
  .mc-header__burger {
    display: none;
  }

  .mc-header__nav {
    display: block;
  }

  .mc-mobilebar {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {

  /* 3 colunas: [hambúrguer] [logo] [ações/carrinho] */
  .mc-header__bar {
    grid-template-columns: auto 1fr auto;
  }

  .mc-header__burger {
    display: inline-flex;
    justify-self: flex-start;
  }

  .mc-header__logo {
    justify-self: center;
  }

  .mc-header__nav {
    display: none; /* esconde nav desktop */
  }

  .mc-header__actions {
    justify-self: flex-end;
    gap: 0;
  }

  .mc-action--account,
  .mc-action--notify {
    display: none !important;
  }

  .mc-action--cart {
    padding: 8px;
  }

  .mc-action--cart .mc-action__label {
    display: none !important;
  }

  body {
    padding-bottom: 72px; /* espaço para a barra inferior */
  }
}
