/* Estilos próprios da loja (lojaV3). Carregado pelo Lojav3::index depois do libs.css e do main.css. */

/* Checkout mobile: o libs.css limitava o conteúdo a calc(100vh - 320px) com o resumo em position:fixed por cima.
   O rodapé (cupom + total + botões) passa de 320px e 100vh no navegador do celular é maior que a área visível,
   então os últimos campos ficavam atrás do rodapé sem como rolar até eles. Aqui vira coluna flex: o conteúdo
   ocupa só o que sobra e o rodapé fica no fluxo, com qualquer altura (inclusive "Ver detalhes" aberto). */
@media (max-width: 767px) {
    #checkoutModal {
        display: flex;
        flex-direction: column;
    }
    #checkoutModal > .checkout-header-mobile,
    #checkoutModal > .checkout-stepper-mobile {
        flex-shrink: 0;
    }
    #checkoutModal > .checkout-body-with-fixed-summary {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        padding-bottom: 0 !important;
    }
    #checkoutModal .checkout-main-mobile {
        flex: 1 1 auto;
        min-height: 0;
    }
    #checkoutModal .checkout-content-mobile {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
    }
    #checkoutModal .checkout-summary-mobile {
        position: static !important;
        flex-shrink: 0;
        max-height: 60vh;
        overflow-y: auto;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

/* Carrinho: botões de quantidade com área de toque de verdade (antes eram só os ícones, ~14px) */
.carrinho-qtd {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
}
.carrinho-qtd-botao {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: #6b7280;
}
.carrinho-qtd-botao:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.carrinho-qtd-valor {
    min-width: 1.75rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
}
.carrinho-remover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-right: -0.5rem;
}
.carrinho-desfazer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #1f2937;
    color: #fff;
    font-size: 0.875rem;
}

/* Busca com type="search" (teclado com botão "Buscar"): o X nativo duplicaria o X da loja */
input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    display: none;
}

/* Compartilhar: no desktop é um quadrado só com ícone; no celular vira barra larga e precisa do texto */
.compartilhar-rotulo {
    display: none;
}
@media (max-width: 700px) {
    .compartilhar-rotulo {
        display: inline;
        margin-left: 0.5rem;
        font-weight: 600;
    }
}

/* Foto do produto em tela cheia (clique na foto da página do produto) */
#product-swiper .swiper-slide img {
    cursor: zoom-in;
}
.foto-ampliar {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.foto-ampliar:hover {
    background: #fff;
}
.foto-tela-cheia {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.95);
    overscroll-behavior: contain;
}
.foto-tela-cheia-swiper {
    width: 100%;
    height: 100%;
}
.foto-tela-cheia-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
}
/* Preenche a tela mesmo quando a foto é pequena (fotos de catálogo costumam ter ~800px) */
.foto-tela-cheia-swiper .swiper-zoom-container img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.foto-tela-cheia-topo {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem;
    padding-top: calc(1rem + env(safe-area-inset-top));
    pointer-events: none;
}
.foto-tela-cheia-contador {
    color: #fff;
    font-size: 0.875rem;
    margin-right: auto;
}
.foto-tela-cheia-botao {
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.25rem;
    pointer-events: auto;
    transition: background 0.15s;
}
.foto-tela-cheia-botao:hover {
    background: rgba(255, 255, 255, 0.3);
}
.foto-tela-cheia-anterior,
.foto-tela-cheia-proxima {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
.foto-tela-cheia-anterior {
    left: 1rem;
}
.foto-tela-cheia-proxima {
    right: 1rem;
}
/* No celular o gesto de arrastar já troca a foto; as setas só tampariam a imagem */
@media (max-width: 767px) {
    .foto-tela-cheia-anterior,
    .foto-tela-cheia-proxima {
        display: none;
    }
}

/* Descrição vem do lojista (v-html): palavras/links sem espaço e mídias largas não podem vazar da caixa */
.descricao-catalogo {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.descricao-catalogo img {
    max-width: 100%;
    height: auto;
}
.descricao-catalogo table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

@keyframes piscar-erro-box {
    0%, 100% { box-shadow: 0 0 0 2.5px #ef4444; }
    50%      { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2); }
}
.piscar-erro-prop {
    animation: piscar-erro-box 0.4s ease-in-out 4 !important;
    transition: none !important;
}

/* Espaço acima dos banners. Classe daqui, e não mt-[10px], porque o .container do libs.css zera a margem. */
.banners-topo {
    margin-top: 10px;
}

/* Caixa dos modais de compartilhar e de juntar carrinhos. Classe daqui, e não max-h-[90vh], porque o libs.css
   tem regras para ".relative[class*=max-h-]" (feitas para o banner) que pegariam a caixa. */
.modal-caixa {
    max-height: 90vh;
}

/* Banner: fundo embaçado com a própria foto do banner (antes era background-image no style da div) */
.banner-background-imagem {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Pontinhos de "carregando" dos modais de pagamento: um começa depois do outro */
.atraso-animacao-2 {
    animation-delay: 0.2s;
}
.atraso-animacao-4 {
    animation-delay: 0.4s;
}
