/* ============================================
   tk-chiedi-prezzo - Frontend CSS
   ============================================ */

/* ── Anti-duplicazione bottoni (nasconde bottoni acquisto del tema) ──
   Sulla pagina singola prodotto in modalità "chiedi prezzo", il body
   ha la classe `.tk-cp-mode`. Nascondiamo qualsiasi bottone "aggiungi
   al carrello" custom del tema che non viene rimosso dal core WC. */
body.tk-cp-mode .single_add_to_cart_button,
body.tk-cp-mode .summary form.cart > .quantity,
body.tk-cp-mode .summary form.cart > .button.alt,
body.tk-cp-mode .summary .button.product_type_simple,
body.tk-cp-mode .summary .button.add_to_cart_button,
body.tk-cp-mode .product_meta + .single_add_to_cart_button,
body.tk-cp-mode .summary .cart .button:not(.tk-cp-button) {
    display: none !important;
}

/* Nasconde l'eventuale `.price` vuoto residuo (alcuni temi mostrano
   uno spazio vuoto se il prezzo è una stringa vuota). */
body.tk-cp-mode .price:empty,
.products .product .price:empty {
    display: none !important;
}

/* Bottone "Chiedi prezzo" */
.tk-cp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0f172a;
    color: #ffffff !important;
    border: none;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: all .18s cubic-bezier(.4, 0, .2, 1);
    line-height: 1.2;
    margin: 0 10px 0 0;
}

.tk-cp-button:hover {
    background: #1e293b;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .25);
    text-decoration: none !important;
}

.tk-cp-button.button-large {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: 8px;
}

/* Modale - overlay e dialog */
.tk-cp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.tk-cp-modal.is-open {
    display: flex;
}

.tk-cp-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .7);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.tk-cp-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .4);
    width: 90%;
    max-width: 500px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 28px 30px;
    animation: tk-cp-modal-in .25s cubic-bezier(.16, 1, .3, 1);
}

@keyframes tk-cp-modal-in {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tk-cp-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: #f1f5f9;
    color: #475569;
    border-radius: 50%;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tk-cp-modal-close svg {
    display: block;
    width: 16px;
    height: 16px;
}

.tk-cp-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.tk-cp-modal-close:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

.tk-cp-modal-title {
    margin: 0 24px 14px 0;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    color: #0f172a;
}

/* Riga info prodotto */
.tk-cp-product-info {
    background: #f8fafc;
    border-left: 4px solid #f59e0b;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #334155;
}

.tk-cp-product-info strong {
    color: #64748b;
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 3px;
}

.tk-cp-product-name {
    font-weight: 600;
    color: #0f172a;
}

/* Form rows */
.tk-cp-form-row {
    margin-bottom: 13px;
}

.tk-cp-form-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
    text-transform: none;
    letter-spacing: 0;
}

.tk-cp-required {
    color: #ef4444;
    font-weight: 700;
}

.tk-cp-form-row input[type="text"],
.tk-cp-form-row input[type="email"],
.tk-cp-form-row input[type="tel"],
.tk-cp-form-row input[type="number"],
.tk-cp-form-row textarea {
    display: block;
    width: 100% !important;      /* alcuni temi WooCommerce impostano width diverse per email/tel/number */
    max-width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    float: none !important;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 14px;
    line-height: 1.4;
    color: #0f172a;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    box-sizing: border-box !important;
    background: #f8fafc;
    box-shadow: none;
}

.tk-cp-form-row input::placeholder,
.tk-cp-form-row textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.tk-cp-form-row input:hover,
.tk-cp-form-row textarea:hover {
    border-color: #cbd5e1;
}

.tk-cp-form-row input:focus,
.tk-cp-form-row textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}

.tk-cp-form-row textarea {
    resize: vertical;
    min-height: 80px;
}

/* Privacy checkbox */
.tk-cp-form-privacy {
    margin-top: 4px;
}
.tk-cp-form-privacy label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 12.5px;
    color: #64748b;
    cursor: pointer;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
}
.tk-cp-form-privacy label > span { text-transform: none; }

.tk-cp-form-privacy label > span {
    flex: 1;
    min-width: 0;
}

.tk-cp-form-privacy input[type="checkbox"] {
    margin-top: 4px;
    flex-shrink: 0;
}

.tk-cp-form-privacy a {
    color: #0f172a;
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: text-decoration-color .15s ease, color .15s ease;
}
.tk-cp-form-privacy a:hover {
    color: #0f172a;
    text-decoration-color: #0f172a;
}

/* Form actions */
.tk-cp-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.tk-cp-btn-primary,
.tk-cp-btn-secondary {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .18s ease;
    font-family: inherit;
}

.tk-cp-btn-primary {
    background: #0f172a;
    color: #ffffff;
}

.tk-cp-btn-primary:hover:not(:disabled) {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .25);
}

.tk-cp-btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.tk-cp-btn-secondary {
    background: #f1f5f9;
    color: #334155;
}

.tk-cp-btn-secondary:hover {
    background: #e2e8f0;
}

/* Messaggi successo/errore */
.tk-cp-form-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.tk-cp-form-message.is-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.tk-cp-form-message.is-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.tk-cp-form-message.is-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Separatore "oppure compila il modulo" sotto il pulsante WhatsApp */
.tk-cp-wa-separator {
    display: flex;
    align-items: center;
    text-align: center;
    gap: 12px;
    margin: 14px 0 16px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}
.tk-cp-wa-separator::before,
.tk-cp-wa-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Pulsante WhatsApp */
.tk-cp-btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: #25d366;
    color: #ffffff !important;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.tk-cp-btn-whatsapp:hover {
    background: #1ebe5b;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, .35);
}
.tk-cp-btn-whatsapp svg {
    flex-shrink: 0;
}

/* Banner "Negozio in vacanza"
   I colori/misure arrivano dalle impostazioni come custom properties inline:
   qui c'e' sempre un fallback, cosi' il banner resta corretto anche senza
   opzioni salvate. */
.tk-cp-vacation-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--tkcp-vb-bg, #fffbeb);
    border: 1px solid var(--tkcp-vb-border, #fcd34d);
    border-left: 4px solid var(--tkcp-vb-accent, #f59e0b);
    border-radius: var(--tkcp-vb-radius, 10px);
    padding: 16px 20px;
    width: var(--tkcp-vb-width, 100%);
    max-width: 100%;
    box-sizing: border-box;
    margin: var(--tkcp-vb-margin, 0 auto 24px 0);
    color: var(--tkcp-vb-color, #92400e);
    font-size: var(--tkcp-vb-font, 15px);
    line-height: 1.5;
}
.tk-cp-vacation-icon {
    font-size: var(--tkcp-vb-icon, 26px);
    line-height: 1;
    flex-shrink: 0;
}
/* Immagine personalizzata al posto dell'emoji */
.tk-cp-vacation-img {
    width: calc(var(--tkcp-vb-icon, 26px) * 1.7);
    height: calc(var(--tkcp-vb-icon, 26px) * 1.7);
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}
.tk-cp-vacation-text {
    flex: 1;
    min-width: 0;
}
.tk-cp-vacation-dates,
.tk-cp-vacation-until {
    display: block;
    margin-top: 4px;
    font-size: .87em;
    font-weight: 600;
    color: inherit;
    opacity: .85;
}

/* Mobile */
@media (max-width: 600px) {
    .tk-cp-modal-dialog {
        padding: 24px 20px;
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .tk-cp-form-actions {
        flex-direction: column-reverse;
    }
    .tk-cp-form-actions button {
        width: 100%;
    }
}
