body.barpa-sp-has-bottom-bar {
    padding-bottom: calc(98px + env(safe-area-inset-bottom));
}

.barpa-sp-bottom-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99990;
    display: none;
    color: #fff;
    background: #976bf6;
    box-shadow: 0 -10px 30px rgba(31, 24, 49, 0.14);
}

.barpa-sp-bottom-bar.is-visible {
    display: block;
}

.barpa-sp-bottom-bar,
.barpa-sp-bottom-bar * {
    box-sizing: border-box;
}

.barpa-sp-bottom-bar__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 24px;
    align-items: center;
    width: calc(100% - 64px);
    max-width: 1440px;
    min-height: 98px;
    margin: 0 auto;
    padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
}

.barpa-sp-bottom-bar__product {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
}

.barpa-sp-bottom-bar__product-name {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.barpa-sp-bottom-bar__price {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 112px;
    text-align: right;
}

.barpa-sp-bottom-bar__price-label {
    margin-bottom: 2px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
}

.barpa-sp-action-price,
.barpa-sp-action-price .amount,
.barpa-sp-action-price .woocommerce-Price-amount {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.barpa-sp-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

button.barpa-sp-action-button {
    display: inline-flex;
    min-width: 160px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 9px;
    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

button.barpa-sp-action-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button.barpa-sp-action-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.72);
    outline-offset: 3px;
}

button.barpa-sp-add-to-cart {
    border-color: #fff;
    color: #2e2442;
    background: #fff;
}

button.barpa-sp-add-to-cart:hover:not(:disabled) {
    color: #2e2442;
    background: #f6f2ff;
}

button.barpa-sp-buy-now {
    border-color: #211a31;
    color: #fff;
    background: #211a31;
}

button.barpa-sp-buy-now:hover:not(:disabled) {
    color: #fff;
    background: #0f0c17;
}

button.barpa-sp-action-button:disabled,
button.barpa-sp-action-button.is-disabled {
    opacity: 0.52;
    cursor: not-allowed;
    transform: none;
}

button.barpa-sp-add-to-cart.is-success {
    border-color: #15803d;
    color: #fff;
    background: #15803d;
}

button.barpa-sp-add-to-cart.is-error {
    border-color: #b42318;
    color: #fff;
    background: #b42318;
}

/* 0.6.6 - loading real do botao clicado (Add to cart ou Checkout): spinner + "Adding..." ate o servidor
   responder. O texto e desenhado por CSS e o rotulo original fica escondido (font-size: 0), sem mexer no DOM:
   a camada de traducoes troca o conteudo de .barpa-sp-action-label por <barpa-t> e nao pode ver texto novo.
   A lingua vem de <html lang> (en-US, fr-FR, pt-PT, es-ES); sem correspondencia fica em ingles.
   Os escapes sao ASCII de proposito: \2026 = reticencias, \F1 = n com til (o espaco a seguir fecha o escape). */
button.barpa-sp-action-button.is-loading,
button.barpa-sp-action-button.is-loading:disabled,
button.barpa-sp-action-button.is-loading.is-disabled {
    opacity: 1;
    cursor: progress;
    transform: none;
}

button.barpa-sp-action-button.is-loading .barpa-sp-action-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 1.2;
}

button.barpa-sp-action-button.is-loading .barpa-sp-action-label::before {
    content: "";
    display: block;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: barpa-sp-spin 700ms linear infinite;
}

button.barpa-sp-action-button.is-loading .barpa-sp-action-label::after {
    content: "Adding\2026";
    font-size: 14px;
    white-space: nowrap;
}

html[lang^="fr"] button.barpa-sp-action-button.is-loading .barpa-sp-action-label::after {
    content: "Ajout\2026";
}

html[lang^="pt"] button.barpa-sp-action-button.is-loading .barpa-sp-action-label::after {
    content: "A adicionar\2026";
}

html[lang^="es"] button.barpa-sp-action-button.is-loading .barpa-sp-action-label::after {
    content: "A\F1 adiendo\2026";
}

@keyframes barpa-sp-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    button.barpa-sp-action-button.is-loading .barpa-sp-action-label::before {
        animation: none;
    }
}

.barpa-sp-hidden-utility-action {
    display: none !important;
}

.barpa-sp-hidden-purchase-action {
    display: none !important;
}

.barpa-sp-live-price {
    display: none;
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    color: #111;
    background: #fff;
    text-align: center;
}

.barpa-sp-live-price__label {
    margin-bottom: 4px;
    color: #777;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.barpa-sp-live-price__value {
    color: #111;
    font-size: 24px;
    font-weight: 800;
}

.barpa-sp-live-price__meta {
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

.barpa-sp-live-price__debug {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    color: #333;
    font-size: 11px;
    text-align: left;
}

.barpa-sp-debug-failure {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0 0 10px;
    padding: 9px 11px;
    border: 1px solid #fda29b;
    border-left: 4px solid #d92d20;
    border-radius: 6px;
    color: #912018;
    background: #fff1f0;
}

.barpa-sp-debug-failure strong {
    color: #b42318;
    font-size: 12px;
}

.barpa-sp-debug-row--failure {
    margin: 2px -6px;
    padding: 5px 6px !important;
    border-bottom-color: #fda29b !important;
    border-radius: 4px;
    color: #b42318;
    background: #fff1f0;
}

.barpa-sp-debug-row--failure strong {
    color: #b42318;
}

@media (max-width: 850px) {
    body.barpa-sp-has-bottom-bar {
        padding-bottom: calc(148px + env(safe-area-inset-bottom));
    }

    .barpa-sp-bottom-bar__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 20px;
        row-gap: 12px;
        width: calc(100% - 32px);
        min-height: 0;
        padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    }

    .barpa-sp-bottom-bar__product {
        grid-column: 1;
        grid-row: 1;
    }

    .barpa-sp-bottom-bar__product-name {
        font-size: 14px;
    }

    .barpa-sp-bottom-bar__price-label {
        font-size: 13px;
    }

    .barpa-sp-action-price,
    .barpa-sp-action-price .amount,
    .barpa-sp-action-price .woocommerce-Price-amount {
        font-size: 15px;
    }

    .barpa-sp-bottom-bar__price {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .barpa-sp-actions {
        display: grid;
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 10px;
    }

    button.barpa-sp-action-button {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        padding: 10px 12px;
        font-size: 13px;
    }

    button.barpa-sp-action-button.is-loading .barpa-sp-action-label::after {
        font-size: 13px;
    }
}

@media (max-width: 390px) {
    .barpa-sp-bottom-bar__inner {
        column-gap: 12px;
    }
}

@media print {
    body.barpa-sp-has-bottom-bar {
        padding-bottom: 0;
    }

    .barpa-sp-bottom-bar {
        display: none !important;
    }
}

/* 0.7.0 - estilos que o plugin barpa-precos-barra-patch 1.2.0 carregava a parte (assets/recalculo.css), so com o seu
   frontend.js corrigido ativo e sempre depois deste ficheiro: estado «a recalcular» da barra e aviso de falha do
   calculo do preco (ver frontend.js 0.7.0). Copiados sem alteracoes e no fim do ficheiro, para a cascata ficar igual. */

/* 0.6.9 - recalculo em curso (mudou uma opcao, a quantidade ou o comprimento): a barra nao desaparece; o preco e a
   data anteriores ficam visiveis e esbatidos, os botoes ficam desativados (ver frontend.js) e uma linha fina (na cor
   do texto da barra) corre no topo ate chegar o preco novo. A linha da data (.barpa-pp) e do plugin de prazos: esbate-se
   so o icone, o texto e o «i», nao o painel do «i» (filho de .barpa-pp), que pode estar aberto. */
.barpa-sp-bottom-bar.is-recalculating .barpa-sp-action-price,
.barpa-sp-bottom-bar.is-recalculating .barpa-pp > .barpa-pp__icone,
.barpa-sp-bottom-bar.is-recalculating .barpa-pp > .barpa-pp__texto,
.barpa-sp-bottom-bar.is-recalculating .barpa-pp > .barpa-pp__info {
    opacity: 0.65;
    transition: opacity 120ms ease;
}

/* O preco anterior vem do atributo (o elemento do preco fica vazio; ver frontend.js). A segunda declaracao (texto
   alternativo vazio) evita que os leitores de ecra leiam o preco duas vezes; quem nao a conhece fica com a primeira. */
.barpa-sp-bottom-bar.is-recalculating .barpa-sp-action-price:empty::before {
    content: attr(data-barpa-stale-price);
    content: attr(data-barpa-stale-price) / "";
}

.barpa-sp-bottom-bar.is-recalculating::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, currentColor, transparent) no-repeat;
    background-size: 40% 100%;
    animation: barpa-sp-recalc 1000ms linear infinite;
    pointer-events: none;
}

@keyframes barpa-sp-recalc {
    from {
        background-position: -40% 0;
    }
    to {
        background-position: 140% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .barpa-sp-bottom-bar.is-recalculating::before {
        animation: none;
        background-size: 100% 100%;
        opacity: 0.5;
    }
}

/* 1.2.0 - falha do calculo do preco (403/5xx/rede): aviso discreto para os clientes, em baixo, no sitio da barra (que nesse
   momento esta escondida porque nao ha preco). O contentor #barpa-sp-calc-error (role=status) fica no body, FORA da barra e do
   elemento do preco (o guarda de precos le o texto de .barpa-sp-action-price para saber se ha preco); vazio nao ocupa nada e nao
   apanha cliques. Elementos proprios (barpa-sp-erro...) porque o CSS do site tem regras para div/p/span; o botao e um <button>,
   por isso leva o id na regra para ganhar ao estilo global dos botoes do tema. */
.barpa-sp-calc-error {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99991;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.barpa-sp-calc-error barpa-sp-erro {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 640px;
    margin: 0 auto calc(12px + env(safe-area-inset-bottom));
    padding: 12px 16px;
    border: 1px solid #e8e2ff;
    border-left: 4px solid #8b5cf6;
    border-radius: 12px;
    background: #fcfcfd;
    box-shadow: 0 8px 25px rgba(31, 24, 49, 0.18);
    color: #222;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    pointer-events: auto;
}

.barpa-sp-calc-error barpa-sp-erro-texto {
    display: block;
    flex: 1 1 240px;
    min-width: 0;
}

#barpa-sp-calc-error a {
    color: #6d28d9;
    text-decoration: underline;
}

#barpa-sp-calc-error button.barpa-sp-calc-error__retry {
    appearance: none;
    flex: 0 0 auto;
    min-height: 40px;
    margin: 0;
    padding: 8px 18px;
    border: 0;
    border-radius: 999px;
    background: #976bf6;
    box-shadow: none;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
}

#barpa-sp-calc-error button.barpa-sp-calc-error__retry:hover,
#barpa-sp-calc-error button.barpa-sp-calc-error__retry:focus-visible {
    background: #7c3aed;
}

#barpa-sp-calc-error button.barpa-sp-calc-error__retry:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

#barpa-sp-calc-error button.barpa-sp-calc-error__retry:disabled {
    opacity: 0.6;
    cursor: default;
}

@media print {
    .barpa-sp-calc-error {
        display: none !important;
    }
}

/* 0.8.0: mensagem e nota do comprimento, por baixo do campo (o bloco e um <div> com <small>; nunca <span>: o CSS do tema pinta spans).
   Ocupa a linha toda se o campo estiver num contentor flex/grid; a nota de tolerancia e so uma nota. */
.single-product .barpa-sp-length-info {
    display: block;
    flex: 0 0 100%;
    grid-column: 1 / -1;
    box-sizing: border-box;
    width: 100%;
    margin: 6px 0 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

.single-product .barpa-sp-length-info small.barpa-sp-length-msg,
.single-product .barpa-sp-length-info small.barpa-sp-length-note {
    display: block;
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: 0;
    text-transform: none;
}

.single-product .barpa-sp-length-info small.barpa-sp-length-msg {
    color: #b32d2e;
    font-weight: 600;
}

.single-product .barpa-sp-length-info small.barpa-sp-length-note {
    color: #5b6470;
}

.single-product .barpa-sp-length-info small:empty {
    display: none;
}

@media print {
    .barpa-sp-length-info {
        display: none !important;
    }
}
