/* Travel Flight Price v3 — Frontend CSS */

/* Transizione prezzo */
.woocommerce-variation-price .woocommerce-Price-amount {
    transition: opacity 0.15s ease;
}

/* Badge "volo incluso" accanto al prezzo */
.woocommerce-variation-price.tfp-price-injected::after {
    content: "✈ volo incluso";
    display: inline-block;
    margin-left: 10px;
    font-size: 0.72em;
    font-weight: 500;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 2px 10px;
    vertical-align: middle;
}

/* Messaggio blocco acquisto */
.tfp-block-message {
    display: block;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #dc2626;
    border-radius: 4px;
    color: #991b1b;
    font-size: 0.9em;
    font-weight: 500;
}

/* Bottone disabilitato */
.single_add_to_cart_button.tfp-blocked {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
}

/* Badge numero volo specifico */
.woocommerce-variation-price.tfp-price-injected::after {
    content: attr(data-tfp-label);
}

/* ─── Extra / Supplementi frontend ──────────────────────── */
.tfp-extras-container {
    margin: 16px 0;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.tfp-extra-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.tfp-extra-item:last-child {
    margin-bottom: 0;
}

.tfp-extra-label-front {
    font-weight: 600;
    font-size: 0.9em;
    color: #1e293b;
    min-width: 160px;
    flex-shrink: 0;
}

.tfp-extra-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9em;
    background: #fff;
    cursor: pointer;
}

.tfp-extra-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

@media (max-width: 480px) {
    .tfp-extra-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .tfp-extra-select { width: 100%; }
}

/* ─── Stringa prezzo totale ──────────────────────────────── */
.tfp-total-price-box {
    display: block;
    font-size: 30px;
    font-weight: bold;
    color: #8bca02;
    margin: 12px 0;
    line-height: 1.2;
}

/* Nasconde il prezzo WooCommerce SOLO quando il plugin è attivo sul prodotto.
   La classe .tfp-active viene aggiunta al body dal JS solo se il volo è configurato. */
body.tfp-active .woocommerce-variation-price {
    display: none !important;
}

/* ─── Loader prezzo totale ───────────────────────────────── */
.tfp-total-price-box.tfp-loading {
    font-size: 16px;
    font-weight: 500;
    color: #6b7280;
}

.tfp-price-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.tfp-price-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-top-color: #8bca02;
    border-radius: 50%;
    animation: tfp-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ─── Modalità pagamento: Saldo / Acconto ────────────────── */
.tfp-payment-mode {
    margin: 14px 0;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.tfp-payment-mode__title {
    font-weight: 700;
    font-size: 0.95em;
    color: #1e293b;
    margin-bottom: 10px;
}

.tfp-payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.tfp-payment-option:last-of-type {
    margin-bottom: 0;
}

.tfp-payment-option:hover {
    border-color: #94a3b8;
}

.tfp-payment-option.is-selected {
    border-color: #8bca02;
    box-shadow: 0 0 0 2px rgba(139, 202, 2, 0.18);
}

.tfp-payment-option input[type="radio"] {
    margin: 0;
    flex-shrink: 0;
}

.tfp-payment-option__label {
    font-weight: 600;
    font-size: 0.95em;
    color: #1e293b;
}

.tfp-payment-option__amount {
    margin-left: auto;
    font-weight: 700;
    font-size: 1em;
    color: #8bca02;
    white-space: nowrap;
}

.tfp-payment-mode__note {
    margin: 10px 0 0;
    font-size: 0.85em;
    color: #475569;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .tfp-payment-option {
        flex-wrap: wrap;
    }
    .tfp-payment-option__amount {
        width: 100%;
        margin-left: 26px;
    }
}
