/* ═══════════════════════════════════════════════════════
   panels.css — Estação Vegana
   Painéis deslizantes: carrinho, login, detalhe do produto
   Adicionar no <head> de todas as páginas, após main.css
   ═══════════════════════════════════════════════════════ */

/* ── Overlay escuro de fundo ────────────────────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 61, 46, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.panel-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Base dos painéis ────────────────────────────────────── */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background-color: var(--color-off-white);
  z-index: 70;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.panel--visible {
  transform: translateX(0);
}

/* ── Cabeçalho do painel ────────────────────────────────── */
.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-verde-menta);
  flex-shrink: 0;
}

.panel__title {
  font-family: var(--font-onest);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-verde-floresta);
}

.panel__close {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-verde-floresta);
  transition: background var(--transition-base), color var(--transition-base);
}

.panel__close:hover {
  background-color: var(--color-verde-menta);
  color: var(--color-verde-agua);
}

/* ── Corpo com scroll ───────────────────────────────────── */
.panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-6);
  scrollbar-width: thin;
  scrollbar-color: var(--color-verde-agua) transparent;
}

/* ── Rodapé fixo ────────────────────────────────────────── */
.panel__footer {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--color-verde-menta);
  background-color: var(--color-off-white);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════
   PAINEL CARRINHO
   ════════════════════════════════════════════════════════ */

/* Itens do carrinho */
.panel-cart__item {
  display: flex;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-verde-menta);
}

.panel-cart__item:last-child { border-bottom: none; }

.panel-cart__image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background-color: var(--color-verde-menta);
  overflow: hidden;
  flex-shrink: 0;
}

.panel-cart__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-cart__info { flex: 1; min-width: 0; }

.panel-cart__name {
  font-family: var(--font-onest);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-verde-floresta);
  line-height: 1.3;
}

.panel-cart__price {
  font-family: var(--font-onest);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-verde-agua);
  margin-top: var(--space-1);
}

.panel-cart__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
}

.panel-cart__qty {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.panel-cart__qty-value {
  font-family: var(--font-onest);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-verde-floresta);
  width: 1.5rem;
  text-align: center;
}

.panel-cart__total {
  font-family: var(--font-onest);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-verde-floresta);
}

/* Resumo do carrinho */
.panel-cart__summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.panel-cart__summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-cart__summary-label {
  font-family: var(--font-alike);
  font-size: var(--text-sm);
  color: rgba(26, 61, 46, 0.7);
}

.panel-cart__summary-value {
  font-family: var(--font-onest);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-verde-floresta);
}

.panel-cart__summary-row--total .panel-cart__summary-label {
  font-family: var(--font-onest);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-verde-floresta);
}

.panel-cart__summary-row--total .panel-cart__summary-value {
  font-size: var(--text-xl);
  color: var(--color-verde-agua);
}

.panel-cart__frete-msg {
  font-family: var(--font-onest);
  font-size: var(--text-xs);
  text-align: center;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background-color: var(--color-verde-menta);
  color: rgba(26, 61, 46, 0.7);
  margin-bottom: var(--space-4);
}

.panel-cart__frete-msg--free {
  color: var(--color-verde-agua);
  font-weight: 600;
  background-color: rgba(45, 140, 114, 0.12);
}

/* Estado vazio */
.panel-cart__empty {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.panel-cart__empty-icon {
  color: var(--color-verde-menta);
}

.panel-cart__empty-text {
  font-family: var(--font-alike);
  font-size: var(--text-base);
  color: rgba(26, 61, 46, 0.5);
  line-height: 1.6;
}

/* ════════════════════════════════════════════════════════
   PAINEL LOGIN
   ════════════════════════════════════════════════════════ */

.panel-login__logo {
  text-align: center;
  margin-bottom: var(--space-6);
}

.panel-login__logo-svg {
  width: 180px;
  fill: var(--color-verde-floresta);
  margin-inline: auto;
}

.panel-login__subtitle {
  font-family: var(--font-alike);
  font-size: var(--text-sm);
  color: rgba(26, 61, 46, 0.6);
  text-align: center;
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.panel-login__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.panel-login__forgot {
  font-family: var(--font-alike);
  font-size: var(--text-sm);
  color: var(--color-verde-agua);
  text-align: center;
  transition: color var(--transition-base);
  cursor: pointer;
}

.panel-login__forgot:hover { color: var(--color-verde-floresta); }

.panel-login__divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block: var(--space-2);
}

.panel-login__divider::before,
.panel-login__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-verde-menta);
}

.panel-login__divider-text {
  font-family: var(--font-onest);
  font-size: var(--text-xs);
  color: rgba(26, 61, 46, 0.4);
  white-space: nowrap;
}

.panel-login__register {
  font-family: var(--font-alike);
  font-size: var(--text-sm);
  color: rgba(26, 61, 46, 0.6);
  text-align: center;
}

.panel-login__register a {
  color: var(--color-verde-agua);
  font-weight: 600;
  transition: color var(--transition-base);
}

.panel-login__register a:hover { color: var(--color-verde-floresta); }

/* ════════════════════════════════════════════════════════
   MODAL DETALHE DO PRODUTO
   ════════════════════════════════════════════════════════ */

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;    /* mobile: sobe do fundo */
  justify-content: center;
  pointer-events: none;
}

.product-modal--visible { pointer-events: all; }

.product-modal__sheet {
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  background-color: var(--color-off-white);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-modal--visible .product-modal__sheet {
  transform: translateY(0);
}

/* Handle de arrastar (mobile) */
.product-modal__handle {
  width: 40px;
  height: 4px;
  background-color: rgba(26, 61, 46, 0.18);
  border-radius: var(--radius-full);
  margin: var(--space-3) auto var(--space-1);
  flex-shrink: 0;
}

/* Imagem */
.product-modal__image {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: var(--color-verde-menta);
  overflow: hidden;
  flex-shrink: 0;
}

.product-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Corpo scrollável */
.product-modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-5);
  scrollbar-width: thin;
  scrollbar-color: var(--color-verde-agua) transparent;
  position: relative;
}

.product-modal__name {
  font-family: var(--font-onest);
  font-weight: 700;
  font-size: var(--text-2xl);
  color: var(--color-verde-floresta);
  line-height: 1.2;
}

.product-modal__price {
  font-family: var(--font-onest);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--color-verde-agua);
  margin-top: var(--space-2);
}

.product-modal__section-title {
  font-family: var(--font-onest);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-laranja);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-laranja);
}

.product-modal__ingredient {
  font-family: var(--font-alike);
  font-size: var(--text-sm);
  color: rgba(26, 61, 46, 0.7);
  padding-left: var(--space-4);
  position: relative;
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

.product-modal__ingredient::before {
  content: '·';
  position: absolute;
  left: var(--space-1);
  color: var(--color-verde-agua);
}

/* Reviews carrossel */
.product-modal__reviews-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.product-modal__reviews {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: var(--space-2);
  flex: 1;
}

.product-modal__reviews::-webkit-scrollbar { display: none; }

.reviews-nav {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--color-verde-floresta);
  background: var(--color-off-white);
  color: var(--color-verde-floresta);
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.reviews-nav:hover {
  background: var(--color-verde-floresta);
  color: var(--color-off-white);
}

.review-card {
  flex-shrink: 0;
  width: 220px;
  background-color: var(--color-verde-floresta);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.review-card__stars {
  color: var(--color-laranja);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.review-card__text {
  font-family: var(--font-alike);
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--color-off-white);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.review-card__author {
  font-family: var(--font-onest);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-verde-menta);
}

/* Barra fixa de adicionar */
.product-modal__add-bar {
  flex-shrink: 0;
  background-color: rgba(250, 250, 242, 0.97);
  backdrop-filter: blur(8px);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-verde-menta);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.product-modal__qty {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.product-modal__qty-value {
  font-family: var(--font-onest);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-verde-floresta);
  width: 2rem;
  text-align: center;
}

/* ── Hover nos cards da página de produtos ───────────────── */
.product-card {
  position: relative;
}

.product-card__hover-action {
  position: absolute;
  inset: 0;
  background: rgba(26, 61, 46, 0.45);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.product-card:hover .product-card__hover-action {
  opacity: 1;
}

.product-card__hover-icon {
  width: 3.5rem;
  height: 3.5rem;
  background-color: var(--color-laranja);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transform: scale(0.8);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-laranja);
}

.product-card:hover .product-card__hover-icon {
  transform: scale(1);
}

/* ════════════════════════════════════════════════════════
   DESKTOP — painéis e modal
   ════════════════════════════════════════════════════════ */
@media (min-width: 900px) {

  /* Modal: centralizado em vez de bottom sheet */
  .product-modal {
    align-items: center;
  }

  .product-modal__sheet {
    max-width: 860px;
    height: min(90vh, 700px);
    border-radius: var(--radius-2xl);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    transform: scale(0.94) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease;
  }

  .product-modal--visible .product-modal__sheet {
    transform: scale(1) translateY(0);
    opacity: 1;
  }

  /* Handle some no desktop */
  .product-modal__handle { display: none; }

  /* Imagem ocupa coluna esquerda inteira (ambas as linhas) */
  .product-modal__image {
    aspect-ratio: unset;
    height: 100%;
    border-radius: var(--radius-2xl) 0 0 var(--radius-2xl);
    grid-column: 1;
    grid-row: 1 / 3;
  }

  /* Corpo na coluna direita, linha 1 */
  .product-modal__body {
    padding: var(--space-8) var(--space-6) var(--space-4) var(--space-6);
    grid-column: 2;
    grid-row: 1;
    position: relative;
    overflow-y: auto;
    min-height: 0;
  }

  /* Barra de adicionar na coluna direita, linha 2 */
  .product-modal__add-bar {
    grid-column: 2;
    grid-row: 2;
    border-radius: 0 0 var(--radius-2xl) 0;
  }

  /* Botão fechar (desktop, dentro do modal) */
  .product-modal__close-btn {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
  }

  .product-modal__name  { font-size: var(--text-3xl); }
  .product-modal__price { font-size: var(--text-2xl); }

  .review-card { width: 200px; }

  /* Painel lateral mais largo no desktop */
  .panel { width: min(520px, 100vw); }

  .panel__title { font-size: var(--text-xl); }
}
