@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --wine: #65090b;
  --wine-2: #8b1014;
  --brown: #321208;
  --brown-2: #5a220d;
  --cream: #fff4df;
  --orange: #f29b18;
  --yellow: #ffc21a;
  --white: #fffaf2;
  --shadow: 0 20px 50px rgba(36, 8, 2, .28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Montserrat, sans-serif;
  background: var(--cream);
  color: var(--brown);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 10px 5vw;
  background: rgba(50, 18, 8, .94);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
}

.brand img { width: 122px; display: block; border-radius: 50%; }
.nav { display: flex; gap: 28px; color: #ffe9d0; font-weight: 700; }
.nav a { transition: .2s; }
.nav a:hover { color: var(--yellow); transform: translateY(-2px); }

.cart-button {
  border: 0;
  background: var(--orange);
  color: var(--brown);
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(242,155,24,.28);
}
.cart-button span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  background: var(--wine);
  color: white;
  border-radius: 50%;
  font-size: 12px;
}

/* Ações do topo (conta + carrinho) ficam juntas à direita. */
.topbar-acoes {
  display: flex;
  align-items: center;
  gap: 10px;
}

/*
  Botão da área do cliente. Fundo transparente com borda clara para não
  competir com o carrinho (que é a ação principal da tela): o carrinho continua
  sendo o botão laranja chamativo.
*/
.account-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border: 2px solid rgba(255, 233, 208, .45);
  border-radius: 999px;
  color: #ffe9d0;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.account-button:hover {
  background: rgba(255, 233, 208, .12);
  border-color: rgba(255, 233, 208, .8);
  transform: translateY(-1px);
}

.hero {
  position: relative;
  min-height: 650px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  padding: 80px 8vw;
  color: white;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 25%, rgba(242,155,24,.28), transparent 25%),
    radial-gradient(circle at 70% 85%, rgba(139,16,20,.6), transparent 30%),
    linear-gradient(135deg, #280b03, #681c08 55%, #8b2c0a);
}

.hero::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -55px;
  height: 110px;
  background: var(--cream);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.hero-content { position: relative; z-index: 2; max-width: 650px; }
.eyebrow {
  display: inline-block;
  color: var(--orange);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  margin-bottom: 10px;
}
.hero h1 {
  font-family: "Baloo 2", cursive;
  font-size: clamp(3.4rem, 8vw, 6.8rem);
  line-height: .83;
  letter-spacing: -.04em;
  text-shadow: 0 8px 0 rgba(0,0,0,.15);
}
.hero h1 strong { color: var(--yellow); }
.hero p {
  max-width: 560px;
  margin: 28px 0;
  color: #ffe9d0;
  font-size: 1.05rem;
  line-height: 1.7;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: var(--yellow);
  color: var(--brown);
  border-radius: 16px;
  font-weight: 900;
  box-shadow: 0 15px 35px rgba(0,0,0,.25);
  transition: .25s;
}
.cta:hover { transform: translateY(-4px) scale(1.02); }
.cta span { font-size: 1.5rem; }


/* Trava a rolagem horizontal na tela inteira */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Garante que o modal do carrinho ocupe a largura correta no mobile */
@media (max-width: 768px) {
  .seu-modal-carrinho { /* Substitua pela classe real do seu modal */
    width: 90vw !important;
    max-width: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}


/* Cartão de destaques do hero (substitui a imagem flutuante).
   Mantém tudo dentro dos limites da tela em qualquer tamanho. */
.hero-highlights {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  justify-self: end;
}

.highlight-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  animation: highlight-in .5s ease-out both;
}

.highlight-card:nth-child(2) { animation-delay: .08s; }
.highlight-card:nth-child(3) { animation-delay: .16s; }
.highlight-card:nth-child(4) { animation-delay: .24s; }

.highlight-emoji {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-size: 1.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}

.highlight-card strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
}
.highlight-card small {
  display: block;
  margin-top: 2px;
  font-size: .82rem;
  color: #f3d8ba;
}

@keyframes highlight-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.section { padding: 80px 7vw; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}
.section-heading h2 {
  font-family: "Baloo 2", cursive;
  font-size: clamp(2.5rem, 5vw, 4.3rem);
  line-height: .9;
}
.section-heading p { max-width: 460px; color: #744b37; line-height: 1.6; }

.categories { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 18px; }
.category {
  white-space: nowrap;
  border: 1px solid #e6cbb2;
  background: white;
  color: var(--brown);
  border-radius: 999px;
  padding: 11px 17px;
  font-weight: 800;
  cursor: pointer;
}
.category.active, .category:hover { background: var(--wine); color: white; border-color: var(--wine); }

.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.product {
  position: relative;
  overflow: hidden;
  background: white;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 12px 35px rgba(75,35,12,.1);
  transition: .25s;
  cursor: pointer; /* Indica que o card inteiro é clicável */
  display: flex;
  flex-direction: column;
}
.product:hover { transform: translateY(-8px); box-shadow: var(--shadow); }
.product-art {
    height: 190px;
    border-radius: 18px;
    overflow: hidden;
    background: #f6d5a8;
}

.product-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.product:hover .product-art img {
    transform: scale(1.08);
}
.product h3 {
  margin-top: 12px;
  font-family: "Baloo 2", cursive;
  font-size: 1.65rem;
  line-height: 1.1; /* <--- Adicione esta linha (quanto menor o valor, mais juntas as linhas ficam) */
  white-space: pre-line; /* Respeita as quebras de linha (\n) dos nomes dos produtos */
}
.product p { color: #806252; font-size: .86rem; margin: 3px 0 15px; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/*.price { font-size: 1.2rem; font-weight: 900; color: var(--wine); }*/
.price {
  display: inline-block;
  align-self: flex-start;
  margin-top: 12px;
  background: var(--orange);
  color: var(--brown);
  border-radius: 13px;
  padding: 10px 14px;
  font-weight: 900;
  font-size: 0.95rem;
  text-align: center;
}
.add {
  border: 0;
  background: var(--orange);
  color: var(--brown);
  border-radius: 13px;
  padding: 10px 13px;
  font-weight: 900;
  cursor: pointer;
}
.add:active { transform: scale(.95); }

/* ---------------------------------------------------------------------------
   ITEM ESGOTADO (controlado pelo painel /admin.html)

   O item continua no cardapio — o cliente ve que existe e que acabou, o que
   evita a duvida "sera que a loja nao vende mais?" — mas nao pode ser comprado.
   O bloqueio real esta no addToCart(); aqui e o aviso visual.
   --------------------------------------------------------------------------- */
.product--esgotado {
    cursor: not-allowed;
}

.product--esgotado .product-art img {
    filter: grayscale(0.75);
    opacity: 0.55;
}

.product--esgotado:hover {
    transform: none;
}

.product--esgotado:hover .product-art img {
    transform: none;
}

.product-flag {
    position: absolute;
    top: 10px;
    left: 10px;

    padding: 5px 12px;
    border-radius: 999px;

    background: #4a3a34;
    color: #fff;

    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.product--esgotado .price {
    background: #e8ded6;
    color: #8a6a58;
}

.promo { background: #3a1107; color: white; }
.promo .section-heading p { color: #e6cbb2; }
.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.promo-grid img {
  width: 100%;
  /* Sem height: auto, o navegador usa a proporção dos atributos width/height
     do HTML e o banner estoura em altura (ficava com 1376px, esticado).
     Com height:auto a imagem sempre respeita a proporção real do arquivo. */
  height: auto;
  /* Garante o recorte certo caso a arte não venha quadrada. */
  object-fit: cover;
  display: block;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
  transition: .3s;
}
.promo-grid img:hover { transform: scale(1.015); }

/* O rodapé é estilizado por .footer / .footer-container (ver fim do arquivo). */

.cart {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  width: min(430px, 92vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fffaf2;
  box-shadow: -20px 0 60px rgba(0,0,0,.25);
  transform: translateX(110%);
  transition: .35s cubic-bezier(.2,.8,.2,1);
}
.cart.open { transform: translateX(0); }
.cart-header, .cart-footer { padding: 22px; }
.cart-header { display: flex; justify-content: space-between; border-bottom: 1px solid #ead9c7; }
.cart-header button { border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; }
.cart-items { flex: 1; overflow: auto; padding: 18px 22px; }
.empty { text-align: center; color: #806252; padding: 50px 10px; }
.cart-line { display: flex; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid #ead9c7; }
.cart-line strong { color: var(--wine); }
.cart-footer { border-top: 1px solid #ead9c7; }
.cart-footer > div { display: flex; justify-content: space-between; margin-bottom: 14px; }
/* Ações do Rodapé do Carrinho */
.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout {
  width: 100%;
  border: 0;
  padding: 15px;
  border-radius: 14px;
  background: var(--wine);
  color: white;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.checkout:hover {
  filter: brightness(1.1);
}

.continue-shopping {
  width: 100%;
  border: 2px solid #eadfd4;
  padding: 14px;
  border-radius: 14px;
  background: white;
  color: var(--brown);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.continue-shopping:hover {
  background: #fff8f0;
}

.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(25,5,2,.55);
  opacity: 0; pointer-events: none;
  transition: .3s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 60px 7vw; }
  .hero-highlights { justify-self: stretch; max-width: 100%; margin-top: 34px; }
  .products { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .topbar { padding: 9px 5vw; }
  .brand img { width: 100px; }
  .hero { min-height: auto; }
  .hero h1 { font-size: 4.1rem; }
  .hero p { font-size: .95rem; }
  .section { padding: 60px 5vw; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 15px; }
  .products { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product { padding: 12px; border-radius: 18px; }
  .product-art { height: 145px; font-size: 4.5rem; }
  .product h3 { font-size: 1.35rem; line-height: 1.1; /* <--- Ajusta o espaçamento entre linhas no celular */ }
  .promo-grid { grid-template-columns: 1fr; }
  footer { display: block; }
  footer > div + div { margin-top: 25px; }
}

/* MODAL PRODUTO */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: .3s;
    z-index: 200;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.product-modal {
    background: #fffaf2;
    width: min(900px, 90%);
    border-radius: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 30px;
    position: relative;
    animation: modalShow .35s ease;
}

@keyframes modalShow {
  from { transform: scale(.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    border: 0;
    background: #65090b;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

.modal-image img {
    width: 100%;
    height: 350px;
    object-fit: contain;
}

.modal-info h2 {
    font-family: "Baloo 2";
    font-size: 3rem;
    line-height: 1.1;
}

.sizes {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 15px 0;
    width: 100%;
}

.size {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 2px solid #e6cbb2;
    background: white;
    padding: 10px 6px;
    border-radius: 16px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 700;
    color: var(--brown);
    white-space: nowrap;
}

.size small {
    font-size: 0.82rem;
    opacity: 0.8;
    font-weight: 600;
}

.size.active {
    background: var(--wine);
    color: white;
    border-color: var(--wine);
}

.size.active small {
    color: var(--yellow);
}

.size:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

.quantity {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 25px 0 15px;
    font-size: 2rem;
}

.quantity button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: #f29b18;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brown);
    margin: 15px 0 20px;
}

.modal-total strong {
    color: var(--wine);
    font-size: 1.6rem;
    margin-left: 6px;
}

.modal-add {
    width: 100%;
    padding: 15px;
    border: 0;
    border-radius: 15px;
    background: #65090b;
    color: white;
    font-weight: 900;
    font-size: 1.1rem;
    cursor: pointer;
}

@media(max-width: 700px) {
  .product-modal { grid-template-columns: 1fr; }
  .modal-image img { height: 220px; }
  .modal-info h2 {
    font-size: 2rem;    /* Diminui um pouco o tamanho no celular para não ocupar a tela toda */
    line-height: 1.1;   /* Reduz o espaçamento entre as linhas */
  }
}

/* ========================================
   CHECKOUT
======================================== */

.checkout-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.75);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.checkout-overlay.show {
    opacity: 1;
    visibility: visible;
}


/* ========================================
   JANELA DO CHECKOUT
======================================== */

.checkout-modal {
    position: relative;

    width: min(100%, 520px);
    max-height: 90vh;

    overflow-y: auto;

    padding: 32px;

    border-radius: 24px;

    background:
        linear-gradient(
            145deg,
            #fffaf0,
            #fff
        );

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4);

    transform: translateY(30px) scale(0.96);

    transition:
        transform 0.3s ease;
}

.checkout-overlay.show .checkout-modal {
    transform: translateY(0) scale(1);
}


/* ========================================
   CABEÇALHO
======================================== */

.checkout-header {
    margin-bottom: 28px;
}

.checkout-header h2 {
    margin: 8px 0;

    font-size: 2rem;
}

.checkout-header p {
    margin: 0;

    color: #666;
}


/* ========================================
   FORMULÁRIO
======================================== */

.form-group {
    display: flex;
    flex-direction: column;

    gap: 7px;

    margin-bottom: 18px;
}

.form-group label {
    font-weight: 700;

    color: #4b1710;
}

.form-group input {
    width: 100%;

    padding: 14px 16px;

    border: 2px solid #eadfd4;
    border-radius: 12px;

    outline: none;

    font: inherit;

    background: #fff;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-group input:focus {
    border-color: #b52b22;

    box-shadow:
        0 0 0 4px rgba(181, 43, 34, 0.12);
}


/* ========================================
   CAMPOS LADO A LADO
======================================== */

.form-row {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 14px;
}


/*
  JANELA DE CONTA DE PONTOS (abrir/criar conta)

  Z-INDEX: precisa ficar ACIMA do checkout (2000) e da tela de revisão (2100),
  porque ela abre SOBRE eles (o botão "Trocar usuário" vive dentro do checkout).
  Reaproveitar .confirm-overlay (z-index 200) fazia a janela abrir ATRÁS do
  checkout e parecer invisível.
*/
.conta-overlay {
  position: fixed;
  inset: 0;
  z-index: 2250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(25, 5, 2, .55);
  backdrop-filter: blur(2px);
}

.conta-overlay.show { display: flex; }

.conta-overlay .conta-campos { margin-bottom: 12px; }

.conta-overlay .conta-aviso { margin-bottom: 0; }

/* ========================================
   BOTÃO
   ======================================== */

.checkout-modal .checkout {
    width: 100%;

    margin-top: 8px;

    padding: 16px;

    border: none;
    border-radius: 14px;

    cursor: pointer;

    font-size: 1rem;
    font-weight: 800;

    transition:
        transform 0.2s ease,
        filter 0.2s ease;
}

.checkout-modal .checkout:hover {
    transform: translateY(-2px);

    filter: brightness(1.08);
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 600px) {

    .checkout-overlay {
        align-items: flex-start;

        padding:
            12px;
    }

    .checkout-modal {
        width: 100%;

        max-height: 94vh;

        padding: 24px 20px;

        border-radius: 20px;
    }

    .checkout-header h2 {
        font-size: 1.6rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .delivery-info {
        padding: 14px;
        margin: 16px 0;
    }

    .delivery-line {
        align-items: flex-start;
        gap: 8px;
        font-size: .88rem;
    }

    .delivery-line span {
        min-width: 0;
        flex: 1 1 auto;
        line-height: 1.35;
    }

    .delivery-line strong {
        flex: 0 0 auto;
        text-align: right;
        white-space: nowrap;
        font-size: .9rem;
    }

    .delivery-line.delivery-total {
        align-items: center;
        gap: 10px;
        font-size: 1rem;
    }

    .delivery-line.delivery-total strong {
        font-size: 1.15rem;
    }

    .cupom-controles {
        padding: 10px;
    }

    #cupomStatus {
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    .delivery-hint {
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

}

/* ========================================
   REVISÃO DO PEDIDO
======================================== */

.review-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.75);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.review-overlay.show {
    opacity: 1;
    visibility: visible;
}


/* ========================================
   JANELA
======================================== */

.review-modal {
    position: relative;

    width: min(100%, 560px);
    max-height: 90vh;

    overflow-y: auto;

    padding: 32px;

    border-radius: 24px;

    background:
        linear-gradient(
            145deg,
            #fffaf0,
            #ffffff
        );

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4);

    transform:
        translateY(30px)
        scale(0.96);

    transition:
        transform 0.3s ease;
}

.review-overlay.show .review-modal {
    transform:
        translateY(0)
        scale(1);
}


/* ========================================
   CABEÇALHO
======================================== */

.review-header {
    margin-bottom: 28px;
}

.review-header h2 {
    margin: 8px 0 0;

    font-size: 2rem;
    line-height: 1.15;
}


/* ========================================
   SEÇÕES
======================================== */

.review-section {
    margin-bottom: 24px;

    padding: 18px;

    border-radius: 16px;

    background: rgba(255, 255, 255, 0.8);

    border: 1px solid #eadfd4;
}

.review-section h3 {
    margin: 0 0 14px;

    color: #4b1710;

    font-size: 1.1rem;
}


/* ========================================
   DADOS DO CLIENTE
======================================== */

.customer-review {
    color: #555;

    line-height: 1.7;
}

.customer-review strong {
    color: #32100c;
}


/* ========================================
   PRODUTOS DA REVISÃO
======================================== */

.review-items {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.review-item {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding-bottom: 12px;

    border-bottom: 1px solid #eee1d6;
}

.review-item:last-child {
    padding-bottom: 0;

    border-bottom: none;
}

.review-item-info {
    flex: 1;
}

.review-item-name {
    display: block;

    margin-bottom: 4px;

    font-weight: 800;

    color: #32100c;
}

.review-item-details {
    color: #777;

    font-size: 0.9rem;
}

.review-item-price {
    white-space: nowrap;

    font-weight: 800;

    color: #7d0b0b;
}


/* ========================================
   TOTAL
======================================== */

.review-total {
    display: flex;
    flex-direction: column;

    gap: 10px;

    margin: 24px 0;

    padding: 20px;

    border-radius: 16px;

    background: #5b0909;

    color: white;
}

.review-total-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ---------------------------------------------------------------------------
   CONTA DO PROGRAMA DE PONTOS (checkout)
   --------------------------------------------------------------------------- */

.conta-section {
    padding: 18px;
    border: 2px dashed rgba(242, 155, 24, .55);
    border-radius: 16px;
    background: #fff8ec;
    margin-bottom: 20px;
}

.conta-section h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--wine);
}

.conta-dica {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.5;
}

.conta-campos {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.conta-campos .form-group {
    flex: 1;
    min-width: 150px;
    margin: 0;
}

.conta-campos input {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid rgba(101, 9, 11, .18);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
}

.conta-campos input:focus {
    outline: none;
    border-color: var(--orange);
}

.conta-acoes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.btn-conta {
    border: 0;
    border-radius: 12px;
    padding: 13px 24px;
    font-family: inherit;
    font-size: .94rem;
    font-weight: 800;
    cursor: pointer;
}

.btn-conta:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-conta.entrar {
    background: var(--orange);
    color: var(--brown);
}

.btn-conta.criar {
    background: #fff;
    color: var(--wine);
    border: 2px solid rgba(101, 9, 11, .25);
}

.btn-conta.sair {
    background: transparent;
    color: var(--wine);
    border: 2px solid rgba(101, 9, 11, .2);
    padding: 8px 14px;
    font-size: .82rem;
    margin-left: auto;
}

.conta-aviso {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 11px;
    font-size: .87rem;
    line-height: 1.45;
}

.conta-aviso.info {
    background: #eef6ff;
    border: 1px solid #b9d7f5;
    color: #16537e;
}

.conta-aviso.ok {
    background: #eaf7ef;
    border: 1px solid #b3ddc4;
    color: #145c2f;
}

.conta-aviso.erro {
    background: #fdeceb;
    border: 1px solid #f3b7b2;
    color: #8a1c14;
}

.conta-logada {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 2px solid rgba(27, 122, 61, .35);
}

.conta-ola {
    font-size: .95rem;
    color: var(--ink);
}

.conta-saldo {
    font-size: .95rem;
    color: var(--wine);
    font-weight: 700;
}

.conta-saldo small {
    color: var(--muted);
    font-weight: 400;
    font-size: .82rem;
}

/* Painel de pontos na revisão do pedido */
.pontos-section {
    padding: 18px;
    border: 2px dashed rgba(242, 155, 24, .55);
    border-radius: 16px;
    background: #fff8ec;
}

.pontos-resumo {
    font-size: .9rem;
    line-height: 1.6;
    color: var(--ink);
}

.pontos-resumo strong {
    color: var(--wine);
}

/* Linha do desconto dos pontos no resumo do checkout */
.delivery-line.delivery-desconto span,
.delivery-line.delivery-desconto strong {
    color: #1b7a3d;
}

/* Linha do desconto no total */
.review-total-line.troca-desconto span,
.review-total-line.troca-desconto strong {
    color: var(--orange);
}

.review-total-line.troca-desconto[hidden] {
    display: none;
}

.review-total span {
    font-weight: 700;
}

.review-total strong {
    font-size: 1rem;
}

.review-total-line.review-grand-total {
    border-top: 1px solid rgba(255, 255, 255, .25);
    padding-top: 10px;
    margin-top: 4px;
}

.review-total-line.review-grand-total strong {
    font-size: 1.4rem;
}


/* ========================================
   BOTÕES
======================================== */

.review-actions {
    display: grid;

    /* Dois botões: "Voltar" e "Enviar no WhatsApp". O "Pagar agora"
       fica logo abaixo, em .pay-online-wrap. */
    grid-template-columns: 1fr 1fr;

    gap: 12px;
}

.review-back {
    padding: 16px;

    border: 2px solid #eadfd4;
    border-radius: 14px;

    background: white;

    color: #4b1710;

    cursor: pointer;

    font: inherit;
    font-weight: 800;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.review-back:hover {
    transform: translateY(-2px);

    background: #fff8f0;
}

.review-actions .checkout {
    width: 100%;

    margin: 0;
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 600px) {

    .review-overlay {
        align-items: flex-start;

        padding: 12px;
    }

    .review-modal {
        width: 100%;

        max-height: 94vh;

        padding: 24px 20px;

        border-radius: 20px;
    }

    .review-header h2 {
        font-size: 1.6rem;
    }

    .review-actions {
        grid-template-columns: 1fr;
    }

    .review-total {
        gap: 9px;
        padding: 16px 14px;
    }

    .review-total-line {
        gap: 10px;
        font-size: .9rem;
    }

    .review-total-line span {
        min-width: 0;
        line-height: 1.35;
    }

    .review-total-line strong {
        flex: 0 0 auto;
        text-align: right;
        white-space: nowrap;
    }

    .review-total strong {
        font-size: 1.05rem;
    }

    .review-total-line.review-grand-total {
        align-items: center;
        gap: 8px;
    }

    .review-total-line.review-grand-total strong {
        font-size: 1.2rem;
    }

}

/* ========================================
   ESTILOS DO RODAPÉ
========================================= */
.footer {
  background-color: #3b0505;
  color: #fff;
  padding: 1rem 1.5rem 1.5rem;
  margin-top: 0.2rem;
  border-top: 2px solid #5b0909;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem 1.5rem;
}

.footer-logo {
  max-width: 130px;
  margin-bottom: 0.3rem;
}

.footer-col h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #ffc107;
}

.footer-col p, .footer-col ul {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #ddd;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-col a:hover {
  opacity: 0.8;
}

.footer-bottom {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.8rem;
  color: #aaa;
}

/* ========================================
   BOTÕES DE REDES SOCIAIS (INSTAGRAM & WHATSAPP)
========================================= */

.footer-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  width: 100%;
}

.footer-socials a {
  flex: 1; /* Força os dois botões a dividirem o espaço igualmente (50% / 50%) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap; /* Impede que o texto quebre em duas linhas */
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Botão do Instagram (Gradiente Oficial) */
.footer-socials a[href*="instagram.com"] {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* Botão do WhatsApp (Verde Oficial) */
.footer-socials a[href*="wa.me"],
.footer-socials a[href*="whatsapp.com"] {
  background-color: #25d366;
}

/* Efeitos ao passar o mouse */
.footer-socials a:hover {
  transform: translateY(-3px);
  filter: brightness(1.1);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35);
  opacity: 1;
}

.footer-socials a:active {
  transform: translateY(-1px);
}/* ========================================
   TOAST (FEEDBACK DE AÇÕES)
======================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 3000;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 14px 20px;

  border-radius: 14px;

  background: #32100c;
  color: #fffaf2;

  font-weight: 700;
  font-size: 0.95rem;

  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);

  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;

  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast.success { background: #1b6b34; }
.toast.error { background: #9c1d15; }
.toast.info { background: #8a5a08; }


/* ========================================
   AVISO DE PEDIDO MÍNIMO
======================================== */

.notice-overlay {
    position: fixed;
    inset: 0;
    z-index: 2400;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.72);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.notice-overlay.show {
    opacity: 1;
    visibility: visible;
}

.notice-box {
    width: min(100%, 400px);

    padding: 32px 28px;

    border-radius: 24px;

    background: linear-gradient(145deg, #fffaf0, #ffffff);

    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);

    text-align: center;

    transform: translateY(22px) scale(0.96);

    transition: transform 0.3s ease;
}

.notice-overlay.show .notice-box {
    transform: translateY(0) scale(1);
}

.notice-icon {
    font-size: 2.8rem;
    line-height: 1;

    margin-bottom: 12px;
}

.notice-box h2 {
    margin: 0 0 10px;

    color: var(--wine);
    font-size: 1.35rem;
}

.notice-box p {
    margin: 0 0 24px;

    color: #6b4a3a;
    font-size: 0.95rem;
    line-height: 1.55;
}

.notice-actions {
    display: grid;
    gap: 10px;
}

.notice-primary {
    padding: 16px;

    border: none;
    border-radius: 14px;

    background: var(--wine-2);
    color: #fff;

    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.notice-primary:hover {
    background: var(--wine);
    transform: translateY(-2px);
}

.notice-secondary {
    padding: 13px;

    border: 2px solid rgba(101, 9, 11, 0.14);
    border-radius: 14px;

    background: transparent;
    color: var(--wine-2);

    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;

    cursor: pointer;

    transition: background 0.2s ease;
}

.notice-secondary:hover {
    background: rgba(101, 9, 11, 0.06);
}


/* ========================================
   VALIDAÇÃO DE FORMULÁRIO
======================================== */

.form-group input.invalid {
  border-color: #c62828;
  box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.12);
}

.field-error {
  color: #c62828;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 0;
}

.form-group input[aria-busy="true"] {
  background-image: linear-gradient(90deg, #fff 0%, #fff5e6 50%, #fff 100%);
  background-size: 200% 100%;
  animation: zipShimmer 1s linear infinite;
}

@keyframes zipShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}


/* ========================================
   CONTROLE DE QUANTIDADE NO CARRINHO
======================================== */

.cart-line {
  align-items: flex-start;
}

.cart-line-info {
  flex: 1;
}

.cart-line-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f29b18;
  color: #32100c;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.15s ease;
}

.qty-btn:active { transform: scale(0.9); }

.qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: 800;
}


/* ========================================
   ACESSIBILIDADE / PREFERÊNCIAS DO USUÁRIO
======================================== */

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

.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;
}


/* ========================================
   BOTÃO FLUTUANTE DO CARRINHO (MOBILE)
======================================== */

.cart-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;

  display: none;
  align-items: center;
  gap: 8px;

  min-height: 56px;
  padding: 0 20px;

  border: 0;
  border-radius: 999px;

  background: var(--wine);
  color: #fff;

  font-weight: 900;
  cursor: pointer;

  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.35);
}

.cart-fab span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  background: var(--yellow);
  color: var(--brown);
  border-radius: 50%;
  font-size: 12px;
}

.cart-fab.show { display: inline-flex; }

@media (min-width: 901px) {
  .cart-fab { display: none !important; }
}
/* ========================================
   FAIXA DE STATUS DA LOJA (ABERTA / FECHADA)
======================================== */

.store-status {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 5vw;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.store-status.show { display: flex; }
.store-status.open { background: #1b6b34; color: #eafff0; }
.store-status.closed { background: #9c1d15; color: #fff0ef; }
.store-status .status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ========================================
   BUSCA DE PRODUTOS
======================================== */

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  margin: 0 0 22px;
  padding: 4px 6px 4px 14px;
  background: white;
  border: 2px solid #f0dcc2;
  border-radius: 999px;
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within {
  border-color: var(--orange);
  box-shadow: 0 8px 24px rgba(242,155,24,.22);
}
.search-icon { font-size: 1rem; opacity: .7; }
.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 0;
  font: inherit;
  color: var(--brown);
  outline: none;
}
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  border: 0;
  background: var(--wine);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.search-clear:hover { background: var(--wine-2); }

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #744b37;
  font-weight: 600;
  font-size: 1.05rem;
}

/* ========================================
   RESUMO DE ENTREGA (CHECKOUT)
======================================== */

.delivery-info {
  margin: 20px 0;
  padding: 18px;
  border-radius: 16px;
  background: #fff4df;
  border: 2px dashed #e6c79a;
}
.delivery-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  font-size: 0.95rem;
}
.delivery-line span { color: #744b37; font-weight: 600; }
.delivery-line strong { color: var(--wine); }
.cupom-controles {
  margin: 10px 0 8px;
  padding: 12px 14px;
  border: 1px solid #e6c79a;
  border-radius: 12px;
  background: #fff;
}
.cupom-controles > label { display: block; margin-bottom: 7px; color: #744b37; font-size: .88rem; font-weight: 700; }
.cupom-linha { display: flex; align-items: stretch; gap: 8px; }
.cupom-linha input { min-width: 0; flex: 1; margin: 0; padding: 10px 12px; border: 1px solid #cbb59e; border-radius: 9px; font: inherit; text-transform: uppercase; }
.btn-cupom { flex: 0 0 auto; border: 0; border-radius: 9px; padding: 9px 14px; background: var(--wine); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.btn-cupom:disabled { opacity: .55; cursor: wait; }
#cupomStatus { min-height: 1.2em; margin: 6px 0 0; color: #356b3d; font-size: .8rem; }
.cupom-controles:has(#cupomStatus:not(:empty)) { border-color: #8fba96; }
.cupom-revisao-confirmado { display: inline-block; margin: 6px 0; padding: 5px 9px; border-radius: 8px; background: #e8f6eb; color: #176534; }
#summaryDescontoCupomLinha { color: #176534; font-weight: 700; }
#summaryDescontoCupomLinha strong { color: #176534; font-size: 1.05rem; }
#summaryDescontoCupomLinha[hidden] { display: none !important; }
.cupom-resumo-status { margin: 3px 0 8px; color: #356b3d; font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.cupom-resumo-status:empty { display: none; }
#summaryDescontoCupomLinha + .cupom-resumo-status { margin-top: 1px; }
.delivery-line.delivery-total {
  border-top: 1px solid #e6c79a;
  margin-top: 6px;
  padding-top: 12px;
  font-size: 1.1rem;
}
.delivery-line.delivery-total strong { font-size: 1.35rem; }

/* Opt-in de usar pontos: a caixa é a unica forma de Activate o desconto. */
.usar-pontos-opcao {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 12px 14px;
  border: 2px solid #e6c79a;
  border-radius: 14px;
  background: #fff;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
}
.usar-pontos-opcao input { width: auto; margin: 2px 0 0; flex: 0 0 auto; }
.usar-pontos-opcao:has(input:checked) { border-color: var(--ok); background: #f2fbf5; }
.usar-pontos-opcao:has(input:disabled) { opacity: 0.6; cursor: not-allowed; }
.delivery-hint {
  margin-top: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #8a5a3c;
}
.delivery-hint.warn { color: #9c1d15; font-weight: 700; }

/* ========================================
   BOTÃO "REPETIR ÚLTIMO PEDIDO"
======================================== */

.repeat-order {
  margin-top: 18px;
  border: 2px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.12);
  color: white;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: .2s;
}
.repeat-order:hover {
  background: rgba(255,255,255,.22);
  transform: translateY(-2px);
}
/* ========================================
   MODAL DE CONFIRMAÇÃO (REMOVER ITENS)
======================================== */

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(36, 8, 2, .6);
  backdrop-filter: blur(6px);
}

.confirm-overlay.show { display: flex; }

.confirm-box {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px 22px;
  border-radius: 22px;
  background: var(--white);
  color: var(--brown);
  text-align: center;
  box-shadow: var(--shadow);
  animation: confirm-pop .22s ease-out;
}

@keyframes confirm-pop {
  from { transform: scale(.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  border-radius: 50%;
  background: #ffe6e3;
}

.confirm-box h2 {
  font-family: "Baloo 2", cursive;
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--wine);
}

.confirm-box p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #744b37;
  margin-bottom: 22px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.confirm-cancel,
.confirm-ok {
  border: 0;
  border-radius: 999px;
  padding: 13px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: .2s;
}

.confirm-cancel {
  background: #f0e2cf;
  color: var(--brown);
}
.confirm-cancel:hover { background: #e6d4bb; }

.confirm-ok {
  background: var(--wine);
  color: white;
  box-shadow: 0 8px 20px rgba(101, 9, 11, .28);
}
.confirm-ok:hover { background: var(--wine-2); transform: translateY(-1px); }


/* Efeito Dourado na borda da imagem do card */
.product-art {
  border: 2px solid transparent;
  background-image: 
    linear-gradient(#f6d5a8, #f6d5a8), 
    linear-gradient(135deg, #FFE57F 0%, #D4AF37 40%, #FFF8DC 50%, #AA771C 85%, #FFDF00 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}


.product::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    115deg, 
    transparent 0%, 
    rgba(255, 223, 0, 0.4) 50%, 
    transparent 100%
  );
  transform: skewX(-25deg);
  pointer-events: none;
  transition: left 0.75s ease;
  z-index: 5;
}

.product:hover::before {
  left: 150%;
}

/* ========================================
   TELA DE PAGAMENTO ONLINE (Pix / Cartão)
======================================== */

.payment-overlay {
    position: fixed;
    inset: 0;
    z-index: 2200;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.75);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.payment-overlay.show {
    opacity: 1;
    visibility: visible;
}

.payment-modal {
    position: relative;

    width: min(100%, 520px);
    max-height: 92vh;

    overflow-y: auto;

    padding: 32px;

    border-radius: 24px;

    background: linear-gradient(145deg, #fffaf0, #ffffff);

    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);

    transform: translateY(30px) scale(0.96);

    transition: transform 0.3s ease;
}

.payment-overlay.show .payment-modal {
    transform: translateY(0) scale(1);
}

.payment-header {
    margin-bottom: 24px;
    text-align: center;
}

.payment-header h2 {
    margin: 8px 0 6px;
    color: var(--wine);
    font-size: 1.6rem;
}

.payment-header p {
    margin: 0;
    color: #6b4a3a;
    font-size: 0.95rem;
}

/* --- Escolha do método --- */

.pay-methods {
    display: grid;
    gap: 14px;
}

/*
  Aviso de "cartao em liberacao".

  Fica visivel quando o cartao esta desligado (chave PAGAMENTO_CARTAO do .env)
  e explica a ausencia do metodo, em vez de simplesmente nao haver a opcao —
  o cliente que veio pagar no cartao entende o que houve e tem uma saida.
*/
.pay-card-notice {
    margin: 0;
    padding: 14px 16px;

    border: 1px dashed rgba(101, 9, 11, 0.28);
    border-radius: 14px;

    background: #fff8f3;
    color: #7a5a4a;

    font-size: 0.92rem;
    line-height: 1.5;
}

.pay-card-notice strong {
    color: var(--wine);
}

.pay-card-notice[hidden] {
    display: none;
}

.pay-method {
    display: flex;
    align-items: center;
    gap: 16px;

    width: 100%;
    padding: 18px 20px;

    border: 2px solid rgba(101, 9, 11, 0.12);
    border-radius: 16px;

    background: #fff;

    font-family: inherit;
    text-align: left;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.pay-method:hover {
    border-color: var(--wine-2);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(101, 9, 11, 0.14);
}

.pay-method-icon {
    font-size: 1.7rem;
    line-height: 1;
}

.pay-method-info {
    display: flex;
    flex-direction: column;
    gap: 2px;

    flex: 1;
}

.pay-method-info strong {
    color: var(--wine);
    font-size: 1.05rem;
}

.pay-method-info small {
    color: #8a6a58;
    font-size: 0.82rem;
}

.pay-method-arrow {
    color: var(--wine-2);
    font-size: 1.2rem;
}

/* --- Painéis internos --- */

/* IMPORTANTE: o atributo [hidden] precisa vencer o display:block abaixo,
   senão todos os painéis aparecem sobrepostos ao mesmo tempo. */
.pay-panel[hidden],
.pay-methods[hidden],
.pay-loading[hidden],
.pay-pix[hidden],
.pay-error[hidden],
.pay-success[hidden] {
    display: none !important;
}

.pay-panel {
    display: block;
}

/* O painel do cartão PRECISA ser um bloco independente, contendo os seus campos.

   MOTIVO (bug relatado pelo lojista: "campos parcelas, banco emissor e documento
   não aparecem nada"): os painéis são flex e o formulário do cartão, com 9
   campos, era espremido como item de flex — os campos ficavam com largura e
   altura colapsadas, invisíveis na prática. Aqui o formulário passa a ser um
   bloco empilhado, ocupando a largura inteira do painel. */
.pay-panel .card-form {
    display: block;
    width: 100%;
    flex: none;
}

.pay-panel .card-fieldset {
    display: block;
    min-width: 0;
}

.pay-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
    padding: 16px 20px;

    border-radius: 14px;

    background: var(--cream);
}

.pay-amount span {
    color: #6b4a3a;
    font-size: 0.9rem;
}

.pay-amount strong {
    color: var(--wine);
    font-size: 1.4rem;
}

/* --- Carregando --- */

.pay-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;

    padding: 36px 0;

    color: #6b4a3a;
}

.spinner {
    display: inline-block;

    width: 22px;
    height: 22px;

    border: 3px solid rgba(101, 9, 11, 0.18);
    border-top-color: var(--wine-2);
    border-radius: 50%;

    animation: girar 0.8s linear infinite;
}

@keyframes girar {
    to { transform: rotate(360deg); }
}

/* --- QR Code --- */

.pay-qr {
    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 18px;
    padding: 16px;

    width: fit-content;

    border-radius: 18px;

    background: #fff;

    box-shadow: 0 8px 26px rgba(101, 9, 11, 0.14);
}

.pay-qr img {
    display: block;

    width: 220px;
    height: 220px;

    image-rendering: pixelated;
}

.pay-hint {
    margin: 0 0 20px;

    color: #6b4a3a;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.5;
}

/* --- Copiar código Pix --- */

.pay-copy {
    margin-bottom: 18px;
}

.pay-copy label {
    display: block;

    margin-bottom: 8px;

    color: #6b4a3a;
    font-size: 0.85rem;
}

.pay-copy-row {
    display: flex;
    gap: 8px;
}

.pay-copy-row input {
    flex: 1;
    min-width: 0;

    padding: 12px 14px;

    border: 2px solid rgba(101, 9, 11, 0.14);
    border-radius: 12px;

    background: #fff;

    font-family: inherit;
    font-size: 0.8rem;
    color: #4a3226;

    text-overflow: ellipsis;
}

.pay-copy-btn {
    flex-shrink: 0;

    padding: 12px 18px;

    border: none;
    border-radius: 12px;

    background: var(--wine-2);
    color: #fff;

    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.pay-copy-btn:hover {
    background: var(--wine);
    transform: translateY(-2px);
}

/* --- Status do pagamento --- */

.pay-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 14px;

    border-radius: 12px;

    font-size: 0.9rem;
}

.pay-status.waiting {
    background: rgba(242, 155, 24, 0.12);
    color: #8a5a08;
}

.pay-status.waiting .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-top-color: var(--orange);
}

.pay-expiry {
    margin: 10px 0 0;

    color: #9a8272;
    font-size: 0.78rem;
    text-align: center;
}

/* --- Erro --- */

.pay-error {
    margin-top: 16px;
    padding: 14px 16px;

    border-radius: 12px;
    border-left: 4px solid #c0392b;

    background: rgba(192, 57, 43, 0.08);
    color: #8b2e22;

    font-size: 0.86rem;
    line-height: 1.5;
}

/* --- Botões de voltar --- */

.pay-back {
    display: block;

    width: 100%;
    margin-top: 18px;
    padding: 14px;

    border: 2px solid rgba(101, 9, 11, 0.14);
    border-radius: 14px;

    background: transparent;
    color: var(--wine-2);

    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.pay-back:hover {
    background: rgba(101, 9, 11, 0.06);
    transform: translateY(-2px);
}

/* --- Pagamento pelo site (o botão principal fica no .review-actions) --- */

.pay-online-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-top: 14px;
    padding-top: 14px;

    border-top: 1px dashed rgba(101, 9, 11, 0.18);
}

.pay-online-hint {
    color: #7a5a4a;
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: center;
}

/* --- Cartão de crédito --- */

.card-form {
    display: flex;
    flex-direction: column;

    gap: 14px;

    margin-top: 18px;
}

.card-field {
    display: flex;
    flex-direction: column;

    gap: 6px;

    /* Sem min-width: 0, um <select> com texto longo estoura a coluna
       do grid no celular (comportamento padrão do flex/grid). */
    min-width: 0;
}

.card-field label {
    font-weight: 700;
    color: #4b1710;
    font-size: 0.82rem;
}

.card-field input,
.card-field select {
    width: 100%;

    padding: 13px 14px;

    border: 2px solid #eadfd4;
    border-radius: 12px;

    outline: none;

    font: inherit;
    font-size: 0.95rem;

    background: #fff;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* A SDK do Mercado Pago aplica este atributo enquanto valida o campo. */
.card-field input[aria-invalid="true"] {
    border-color: #c62828;
}

.card-field input:focus,
.card-field select:focus {
    border-color: #b52b22;

    box-shadow:
        0 0 0 4px rgba(181, 43, 34, 0.12);
}

.card-field select:disabled {
    color: #9b8a80;
    background: #f7f2ee;
}

/* Validade + CVV, e Documento + Número, ficam lado a lado. */
.card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 12px;
}

.pay-card-submit {
    width: 100%;

    margin-top: 4px;

    padding: 16px;

    font-size: 1rem;
    font-weight: 900;
}

.pay-card-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.card-secure {
    margin: 0;

    color: #7a5a4a;
    font-size: 0.74rem;
    line-height: 1.45;
    text-align: center;
}

#payCardLoading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

    margin-top: 18px;
}

#payCardLoading[hidden] {
    display: none;
}

@media (max-width: 420px) {
    /* Em telas muito estreitas, um campo por linha evita texto cortado. */
    .card-row {
        grid-template-columns: 1fr;
    }
}

/* --- Sucesso --- */

.pay-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;

    text-align: center;
}

.pay-success-icon {
    font-size: 3rem;
    line-height: 1;

    animation: aparecer 0.45s ease;
}

@keyframes aparecer {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.pay-success h3 {
    margin: 0;
    color: var(--wine);
    font-size: 1.35rem;
}

.pay-success p {
    margin: 0 0 8px;
    color: #6b4a3a;
    font-size: 0.92rem;
    line-height: 1.5;
}

.pay-success .checkout {
    width: 100%;
}

/* Link de acompanhamento na tela de sucesso (leva para a área do cliente). */
.pay-track {
    display: block;
    margin-top: 10px;
    padding: 13px;
    border: 2px solid rgba(101, 9, 11, .2);
    border-radius: 14px;
    color: var(--wine, #65090b);
    font-weight: 700;
    font-size: .93rem;
    text-align: center;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}

.pay-track:hover {
    background: rgba(101, 9, 11, .06);
    transform: translateY(-1px);
}

/* --- Botão "Pagar agora" na revisão --- */

.pay-online {
    padding: 16px;

    border: none;
    border-radius: 14px;

    background: linear-gradient(135deg, #1f9d55, #16803f);
    color: #fff;

    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.pay-online:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(31, 157, 85, 0.32);
}

/* --- Ajustes no mobile --- */

@media (max-width: 768px) {
    .payment-overlay {
        align-items: flex-start;
        padding: 12px;
    }

    .payment-modal {
        padding: 24px 20px;
        max-height: 95vh;
    }

    .payment-header h2 {
        font-size: 1.35rem;
    }

    .pay-qr img {
        width: 180px;
        height: 180px;
    }

    .pay-copy-row {
        flex-direction: column;
    }

    .pay-copy-btn {
        width: 100%;
    }

    .review-actions {
        grid-template-columns: 1fr;
    }
}
