/* TA Rent - Noleggio WooCommerce */

.ta-rent-container {
    border: 2px solid #8b5cf6;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    box-sizing: border-box;
    overflow: hidden;
    max-width: 100%;
}

.ta-rent-container *,
.ta-rent-container *::before,
.ta-rent-container *::after {
    box-sizing: border-box;
}

.ta-rent-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9d5ff;
}

.ta-rent-icon {
    font-size: 1.4rem;
}

.ta-rent-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #6d28d9;
}

.ta-rent-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.ta-rent-field {
    min-width: 0;
    overflow: hidden;
}

.ta-rent-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ta-rent-field input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 0.95rem;
    color: #1f2937;
    background: white !important;
    transition: border-color 0.2s;
    box-sizing: border-box !important;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

.ta-rent-field input[type="date"]:focus {
    outline: none;
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* Pricing */
.ta-rent-pricing {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
}

.ta-rent-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 0.95rem;
    color: #4b5563;
}

.ta-rent-giorni strong {
    font-size: 1.1rem;
    color: #8b5cf6;
}

.ta-rent-prezzo-giorno {
    color: #6b7280;
    font-size: 0.85rem;
}

.ta-rent-totale-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
}

.ta-rent-totale {
    font-size: 1.35rem;
    font-weight: 800;
    color: #059669;
}

.ta-rent-fascia {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: right;
}

/* Loading */
.ta-rent-loading {
    text-align: center;
    padding: 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.ta-rent-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: ta-rent-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
}

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

/* Error / Unavailable */
.ta-rent-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid #fecaca;
}

.ta-rent-unavailable {
    background: #fffbeb;
    color: #d97706;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid #fde68a;
}

/* Price label on product/shop pages */
.ta-rent-price-label {
    font-size: 0.8rem;
    color: #8b5cf6;
    font-weight: 500;
}

.ta-rent-price-suffix {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
}

/* Hidden fields */
.ta-rent-container input[type="hidden"] {
    display: none !important;
}

/* Mobile */
@media (max-width: 480px) {
    .ta-rent-dates {
        grid-template-columns: 1fr;
    }
    .ta-rent-container {
        padding: 1rem;
        margin: 1rem 0;
    }
}

/* Flatpickr: giorni occupati */
.flatpickr-day.ta-rent-occupied {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
    text-decoration: line-through;
}
.flatpickr-day.ta-rent-occupied:hover {
    background: rgba(239, 68, 68, 0.25) !important;
}
/* Stile flatpickr nel tema scuro */
.flatpickr-calendar {
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3) !important;
}
.ta-rent-dates .flatpickr-input,
.ta-rent-dates input.flatpickr-input + input {
    width: 100%;
    padding: 0.7rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
}
.ta-rent-dates input:focus {
    border-color: #8b5cf6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
