/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Estado de preço protegido por margem mínima */
.tnz-price-protected {
    font-weight: 600;
    color: #555;
}

.tnz-hidden-price-contact {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}

.tnz-hidden-price-contact h3 {
    margin-top: 0;
}

body.tnz-modal-open {
    overflow: hidden;
}

.tnz-stock-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tnz-stock-modal-overlay.is-open {
    display: flex;
}

.tnz-stock-modal-overlay__bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.tnz-stock-modal {
    position: relative;
    width: min(100%, 620px);
    max-height: calc(100vh - 32px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 44px rgba(17, 24, 39, 0.2);
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    display: flex;
    flex-direction: column;
}

.tnz-stock-modal-overlay.is-open .tnz-stock-modal-overlay__bg {
    opacity: 1;
}

.tnz-stock-modal-overlay.is-open .tnz-stock-modal {
    transform: translateY(0);
    opacity: 1;
}

.tnz-stock-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 18px;
    border-bottom: 1px solid #eef2f7;
}

.tnz-stock-modal__header h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    color: #111827;
}

.tnz-stock-modal__body {
    padding: 16px 18px;
}

.tnz-stock-modal__body.is-scrollable {
    max-height: min(48vh, 420px);
    overflow-y: auto;
}

.tnz-stock-modal__message {
    margin: 0 0 14px;
    color: #374151;
}

.tnz-stock-modal__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.tnz-stock-modal__image {
    width: 56px;
    min-width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3f4f6;
}

.tnz-stock-modal__image--placeholder {
    border: 1px dashed #d1d5db;
}

.tnz-stock-modal__name {
    font-weight: 600;
    color: #111827;
}

.tnz-stock-modal__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 18px 18px;
    border-top: 1px solid #eef2f7;
}

.tnz-stock-modal__btn {
    cursor: pointer;
}

.tnz-stock-modal__btn--close {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    padding: 0;
}

/* Bloco único PDP: produto indisponível + formulário */
.tnz-product-unavailable-block {
    margin: 16px 0;
    padding: 16px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
}

.tnz-product-unavailable-block.is-hidden,
.tnz-product-unavailable-block[hidden] {
    display: none;
}

.tnz-product-unavailable-block.is-visible {
    display: block;
}

.tnz-product-unavailable-block.is-out-of-stock {
    border-color: #f59e0b;
    background: #fffbeb;
}

.tnz-product-unavailable-block.is-price-not-ready,
.tnz-product-unavailable-block.is-hidden-price {
    border-color: #e5e7eb;
    background: #f9fafb;
}

.tnz-product-unavailable-block__title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    line-height: 1.3;
}

.tnz-product-unavailable-block__intro {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.45;
    color: #374151;
}

.tnz-product-unavailable-block__form {
    margin: 0;
}

.tnz-product-unavailable-block .tnz-form-panel[hidden] {
    display: none;
}

.tnz-product-unavailable-block .tnz-product-unavailable-subform {
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

/* Botões de envio só dentro do bloco de indisponibilidade (hidden price / back in stock) */
.tnz-product-unavailable-block .tnz-product-unavailable-block__form button[type="submit"].button,
.tnz-product-unavailable-block .tnz-product-unavailable-block__form button[type="submit"],
.tnz-product-unavailable-block .tnz-product-unavailable-block__form input[type="submit"] {
    background-color: #fed700;
    border-color: #fed700;
    color: #000;
}

.tnz-product-unavailable-block .tnz-product-unavailable-block__form button[type="submit"].button:hover,
.tnz-product-unavailable-block .tnz-product-unavailable-block__form button[type="submit"]:hover,
.tnz-product-unavailable-block .tnz-product-unavailable-block__form input[type="submit"]:hover {
    background-color: #e6c200;
    border-color: #e6c200;
    color: #000;
}

/* PDP variável: esconder preço nativo da variação quando há preço principal sync */
.single-product.tnz-has-main-price .variations_form .woocommerce-variation-price,
.single-product div.product.tnz-has-main-price .variations_form .woocommerce-variation-price,
.single-product .product.tnz-has-main-price .variations_form .woocommerce-variation-price,
.single-product form.variations_form.tnz-has-main-price .woocommerce-variation-price,
.woocommerce-variation-price.tnz-variation-price-hidden {
    display: none !important;
}

.tnz-pdp-main-price {
    display: block;
    margin-bottom: 18px;
    text-align: left;
}

/* —— Estado inicial: Desde + preço —— */
.tnz-pdp-main-price--initial:not(.tnz-pdp-main-price--variation) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.tnz-pdp-main-price--initial:not(.tnz-pdp-main-price--variation) .tnz-pdp-price-prefix {
    display: block;
    color: #777;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: none;
}

.tnz-pdp-main-price--initial:not(.tnz-pdp-main-price--variation) .tnz-pdp-price-current {
    display: block;
    margin-top: 1px;
    color: #d60000;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.05;
}

.tnz-pdp-main-price--initial:not(.tnz-pdp-main-price--variation) .tnz-pdp-price-current .woocommerce-Price-amount,
.tnz-pdp-main-price--initial:not(.tnz-pdp-main-price--variation) .tnz-pdp-price-current .amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* —— Variação seleccionada (price_html Woo: del/ins) —— */
.tnz-pdp-main-price--variation {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.tnz-pdp-main-price--variation > .price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    margin: 0;
    padding: 0;
}

.tnz-pdp-main-price--variation del,
.tnz-pdp-main-price--variation .price del,
.tnz-pdp-main-price--variation .tnz-pdp-price-regular {
    display: block;
    order: 1;
    color: #777;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.15;
    text-decoration: line-through;
    opacity: 1;
    margin: 0;
    background: transparent;
}

.tnz-pdp-main-price--variation ins,
.tnz-pdp-main-price--variation .price ins,
.tnz-pdp-main-price--variation .tnz-pdp-price-current {
    display: block;
    order: 2;
    color: #d60000 !important;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.05;
    text-decoration: none;
    background: transparent;
    margin: 0;
}

/* Sem promoção: uma linha, sem espaço para regular */
.tnz-pdp-main-price--variation > .price:not(:has(del)) {
    display: block;
}

.tnz-pdp-main-price--variation > .price:not(:has(del)) .woocommerce-Price-amount,
.tnz-pdp-main-price--variation > .price:not(:has(del)) .amount,
.tnz-pdp-main-price--variation > .woocommerce-Price-amount,
.tnz-pdp-main-price--variation > .amount {
    display: block;
    color: #d60000 !important;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.05;
}

.tnz-pdp-main-price--variation del .woocommerce-Price-amount,
.tnz-pdp-main-price--variation del .amount,
.tnz-pdp-main-price--variation .tnz-pdp-price-regular .woocommerce-Price-amount,
.tnz-pdp-main-price--variation .tnz-pdp-price-regular .amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.tnz-pdp-main-price--variation ins .woocommerce-Price-amount,
.tnz-pdp-main-price--variation ins .amount,
.tnz-pdp-main-price--variation .tnz-pdp-price-current .woocommerce-Price-amount,
.tnz-pdp-main-price--variation .tnz-pdp-price-current .amount {
    color: inherit !important;
    font-size: inherit;
    font-weight: inherit;
}

@media (max-width: 767px) {
    .tnz-pdp-main-price--initial:not(.tnz-pdp-main-price--variation) .tnz-pdp-price-current,
    .tnz-pdp-main-price--variation .tnz-pdp-price-current,
    .tnz-pdp-main-price--variation ins,
    .tnz-pdp-main-price--variation .price ins,
    .tnz-pdp-main-price--variation > .price:not(:has(del)) .woocommerce-Price-amount,
    .tnz-pdp-main-price--variation > .price:not(:has(del)) .amount {
        font-size: 26px;
    }
}

/* Produtos simples no mesmo wrapper (não afecta cards NPF) */
.tnz-pdp-main-price .price-sale .price-value,
.tnz-pdp-main-price .price-single .price-value {
    font-size: 25px;
    color: #d60000 !important;
    font-weight: 700;
}

.tnz-pdp-main-price .price-regular .price-value {
    color: #4c4c4c;
    font-size: 16px;
    font-weight: 400;
    text-decoration: line-through;
}

.tnz-real-stock-unavailable {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    background: #fffbeb;
    color: #78350f;
}

.tnz-real-stock-unavailable strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.tnz-real-stock-unavailable p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .tnz-stock-modal {
        width: 100%;
    }

    .tnz-stock-modal__item {
        align-items: flex-start;
    }
}

