/* Loja (vitrine + area do cliente). As cores vem do tema (includes/tema.php injeta :root). */
:root {
    --loja-primaria: #d4677a;
    --loja-primaria-hover: #c04f63;
    --loja-texto-primaria: #ffffff;
    --loja-secundaria: #c8875f;
    --loja-texto-secundaria: #3d2418;
    --loja-cabecalho: #6e3b46;
    --loja-texto-cabecalho: #ffffff;
    --loja-fundo: #fdf2f2;
    --loja-raio: 16px;
}

body {
    background: var(--loja-fundo);
    font-family: 'Quicksand', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 500;
    color: #3b2a2d;
    padding-right: 0 !important; /* mesmo ajuste de offcanvas/modal do painel */
}

a { color: var(--loja-primaria); }
a:hover { color: var(--loja-primaria-hover); }

h1, h2, h3, .fw-bold { font-weight: 700 !important; }

/* ---------- Topo ---------- */
.loja-topo {
    background: var(--loja-cabecalho);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.loja-topo .navbar-brand,
.loja-topo .nav-link,
.btn-topo {
    color: var(--loja-texto-cabecalho) !important;
}

.loja-topo .nav-link { opacity: 0.85; font-weight: 600; }
.loja-topo .nav-link:hover { opacity: 1; }

.loja-logo {
    height: 44px;
    width: 44px;
    object-fit: cover;
    border-radius: 50%;
    background: #fff;
}

.loja-nome {
    font-weight: 700;
    font-size: 1.2rem;
}

.btn-topo {
    background: transparent;
    border: none;
    padding: 0.35rem 0.55rem;
}

.btn-topo:hover { background: rgba(255, 255, 255, 0.12); }

.badge-carrinho {
    background: var(--loja-secundaria);
    color: var(--loja-texto-secundaria);
}

.busca-topo {
    border-radius: 999px;
    min-width: 200px;
}

@media (max-width: 575.98px) {
    .loja-nome { font-size: 1rem; }
    .loja-logo { height: 38px; width: 38px; }
}

/* ---------- Botoes ---------- */
.btn-loja {
    background: var(--loja-primaria);
    border-color: var(--loja-primaria);
    color: var(--loja-texto-primaria);
    border-radius: 999px;
    font-weight: 700;
    padding-left: 1.4rem;
    padding-right: 1.4rem;
}

.btn-loja:hover,
.btn-loja:focus {
    background: var(--loja-primaria-hover);
    border-color: var(--loja-primaria-hover);
    color: var(--loja-texto-primaria);
}

.btn-loja-contorno {
    border: 2px solid var(--loja-primaria);
    color: var(--loja-primaria);
    border-radius: 999px;
    font-weight: 700;
    background: transparent;
}

.btn-loja-contorno:hover {
    background: var(--loja-primaria);
    color: var(--loja-texto-primaria);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--loja-primaria);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--loja-primaria) 25%, transparent);
}

.form-check-input:checked {
    background-color: var(--loja-primaria);
    border-color: var(--loja-primaria);
}

/* ---------- Destaque da home ---------- */
.hero {
    background: linear-gradient(135deg, color-mix(in srgb, var(--loja-primaria) 18%, #fff) 0%, var(--loja-fundo) 100%);
    border-radius: 0 0 32px 32px;
}

.hero-logo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.hero h1 {
    color: var(--loja-cabecalho);
}

.chips-categorias {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.chip {
    white-space: nowrap;
    border-radius: 999px;
    padding: 0.35rem 1rem;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--loja-primaria) 30%, #fff);
    color: var(--loja-cabecalho);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.chip.ativo,
.chip:hover {
    background: var(--loja-primaria);
    border-color: var(--loja-primaria);
    color: var(--loja-texto-primaria);
}

/* ---------- Cards de pacote ---------- */
.card-pacote {
    background: #fff;
    border: none;
    border-radius: var(--loja-raio);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(110, 59, 70, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.card-pacote:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(110, 59, 70, 0.14);
    color: inherit;
}

.card-pacote .capa {
    position: relative;
    aspect-ratio: 1;
    background: color-mix(in srgb, var(--loja-primaria) 8%, #fff);
}

.card-pacote .capa img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.card-pacote .selo {
    position: absolute;
    top: 10px;
    left: 10px;
}

.card-pacote .corpo {
    padding: 0.8rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-pacote .nome {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
}

.card-pacote .detalhe {
    font-size: 0.8rem;
    opacity: 0.7;
}

.preco {
    color: var(--loja-primaria);
    font-weight: 700;
    font-size: 1.15rem;
}

.selo-loja {
    background: var(--loja-secundaria);
    color: var(--loja-texto-secundaria);
    border-radius: 999px;
    font-weight: 700;
}

.selo-tem {
    background: #2e7d5b;
    color: #fff;
    border-radius: 999px;
}

/* ---------- Caixas ---------- */
.caixa {
    background: #fff;
    border-radius: var(--loja-raio);
    box-shadow: 0 4px 16px rgba(110, 59, 70, 0.06);
    padding: 1.5rem;
}

.caixa-estreita {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.titulo-secao {
    color: var(--loja-cabecalho);
    font-weight: 700;
}

/* ---------- Galeria protegida (pacote.php) ---------- */
.galeria-protegida {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.previa-protegida {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: color-mix(in srgb, var(--loja-primaria) 8%, #fff);
    cursor: zoom-in;
}

.previa-protegida canvas,
#modalPrevia canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    -webkit-touch-callout: none;
    transition: filter 0.15s ease;
}

.previa-protegida .carregando {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--loja-primaria);
}

#modalPrevia canvas {
    height: auto;
    max-height: 75vh;
    margin: 0 auto;
}

/* Janela sem foco (ferramenta de recorte, troca de aba): borra as previas. */
body.protecao-ativa .previa-protegida canvas,
body.protecao-ativa #modalPrevia canvas {
    filter: blur(18px);
}

@media print {
    .galeria-protegida,
    #modalPrevia,
    .card-pacote .capa img {
        display: none !important;
    }
}

/* ---------- Biblioteca ---------- */
.item-biblioteca {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #fff;
    border-radius: var(--loja-raio);
    padding: 0.8rem;
    box-shadow: 0 4px 16px rgba(110, 59, 70, 0.06);
}

.item-biblioteca img {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ---------- Rodape ---------- */
.loja-rodape {
    background: var(--loja-cabecalho);
    color: var(--loja-texto-cabecalho);
}

.loja-rodape a {
    color: var(--loja-texto-cabecalho);
    opacity: 0.85;
    text-decoration: none;
}

.loja-rodape a:hover { opacity: 1; text-decoration: underline; }

.texto-legal {
    white-space: pre-line;
    line-height: 1.7;
}

.min-w-0 { min-width: 0; }

/* ---------- Order bump (checkout.php) ---------- */
.order-bump {
    display: block;
    border: 2px dashed color-mix(in srgb, var(--loja-cabecalho) 35%, #fff);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.order-bump:hover,
.order-bump.marcado {
    border-color: var(--loja-primaria);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--loja-primaria) 20%, transparent);
}

.order-bump-topo {
    background: color-mix(in srgb, var(--loja-primaria) 12%, #fff);
    color: var(--loja-cabecalho);
    font-weight: 700;
    text-align: center;
    padding: 0.55rem 0.75rem;
    letter-spacing: 0.02em;
}

.order-bump.marcado .order-bump-topo {
    background: var(--loja-primaria);
    color: var(--loja-texto-primaria);
}

.order-bump-corpo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem;
}

.order-bump-seta {
    color: #e53935;
    font-size: 1.6rem;
    line-height: 1;
    animation: order-bump-pulo 1s ease-in-out infinite;
}

.order-bump.marcado .order-bump-seta { animation: none; opacity: 0.4; }

@keyframes order-bump-pulo {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.order-bump-check {
    width: 1.5em;
    height: 1.5em;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.order-bump-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    pointer-events: none;
}

.order-bump-texto {
    font-size: 0.92rem;
    color: #5b4a4e;
    line-height: 1.4;
}

.order-bump-titulo {
    color: #e53935;
    font-weight: 700;
    text-decoration: underline;
}

.order-bump-preco {
    display: block;
    margin-top: 0.3rem;
    font-weight: 700;
    color: var(--loja-primaria);
}

@media (max-width: 575.98px) {
    .order-bump-seta { display: none; }
    .order-bump-img { width: 52px; height: 52px; }
}
