/* ---- CONTENITORI E SEZIONI ---- */

.bfw-booking-form-container {
    margin: 15px 0;
    width: 100%;
}

.bfw-form-section {
    flex: 1;
    min-width: auto;
    margin: 0;
    padding: 0;
    width: 100%;
}

.bfw-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.bfw-price-section {
    margin-top: 20px;
}

.bfw-submit-section {
    text-align: center;
    width: 100%;
}

/* ---- FORM E RIGHE ---- */
.bfw-booking-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.bfw-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    margin-top: -20px;
    width: 100%;
}

.bfw-dates-section .bfw-form-row {
    flex-wrap: nowrap;
}

.bfw-guests-section .bfw-form-row {
    flex-wrap: nowrap;
    align-items: flex-end;
}

.bfw-price-section .bfw-form-row {
    flex-wrap: nowrap;
    align-items: flex-end;
}

.bfw-price-row {
    margin-bottom: 20px;
}

/* ---- CAMPI E INPUT ---- */
.bfw-form-field {
    flex: 1;
    min-width: 0;
}

.bfw-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.bfw-form-field input[type="text"],
.bfw-form-field input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0px;
}

.bfw-form-field input[type="text"]:focus,
.bfw-form-field input[type="number"]:focus {
    border-color: #bbb;
    outline: none;
}

.bfw-form-field .required {
    color: #e2401c;
}

.bfw-datepicker-field {
    flex: 1;
    min-width: 0;
}

.bfw-guests-field {
    flex: 1;
    min-width: 0;
}

.bfw-price-box {
    flex: 1;
    min-width: 0;
}

/* ---- VANILLA-JS DATEPICKER ---- */
.datepicker-cell, 
.datepicker-cell.day,
.datepicker-cell.day:not(.disabled),
.datepicker-cell.day.available,
.datepicker-cell.day.focused {
    opacity: 1 !important;
    color: #333 !important;
    background-color: transparent !important;
    pointer-events: auto !important;
}

.datepicker-cell.day.selected,
.datepicker-cell.selected {
    background-color: #572f2f !important;
    color: white !important;
    font-weight: bold !important;
}

.datepicker-cell.day:hover {
    background-color: #f0f0f0 !important;
}

.datepicker-cell.day.disabled {
    opacity: 0.4 !important;
    color: #ccc !important;
    cursor: not-allowed !important;
}

.datepicker.active {
    display: block !important;
}

.datepicker-dropdown {
    position: absolute !important;
    z-index: 20000 !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.2) !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: white !important;
}

.datepicker-header {
    padding: 5px !important;
    background-color: #f9f9f9 !important;
}

.datepicker-title {
    font-weight: bold !important;
    color: #572f2f !important;
}

.datepicker-controls {
    display: flex !important;
    justify-content: space-between !important;
}

.datepicker-view {
    padding: 5px !important;
}

.datepicker-grid {
    width: 100% !important;
}

.datepicker-footer {
    padding: 5px !important;
    border-top: 1px solid #eee !important;
}

/* Stile campo input datepicker */
input.bfw-checkin, 
input.bfw-checkout {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

/* ---- CAMPI QUANTITÀ ---- */
.bfw-quantity-input {
    display: flex;
    height: 40px;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background-color: #FFF;
    width: 100%;
}

.bfw-quantity-input input {
    border: none !important;
    text-align: center;
    -moz-appearance: textfield;
    width: 40px !important;
    padding: 0 !important;
}

.bfw-quantity-input input[type="number"] {
    margin: 0;
    background-color: transparent;
    box-shadow: none;
}

.bfw-quantity-input input::-webkit-outer-spin-button,
.bfw-quantity-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bfw-qty-btn {
    background: #f5f5f5;
    border: none;
    height: 40px;
    padding: 8px 12px;
    cursor: pointer;
    flex: 1;
    font-weight: bold;
}

.bfw-qty-btn:hover {
    background: #eee;
}

/* ---- BOTTONI ---- */
.bfw-button {
    display: inline-block;
    background-color: #CC7D14;
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    width: 100%;
    height: 40px;
}

.bfw-button:hover {
    background-color: #824444;
    color: #fff;
}

.bfw-button:disabled {
    background-color: #ddd;
    cursor: not-allowed;
}

.bfw-submit-button {
    padding: 8px 12px;
    margin-top: 0;
    font-size: 14px;
}

.bfw-submit-button:hover {
    background-color: #2d9e3d;
}

#bfw_submit_booking {
    background-color: #69C661;
}

#bfw_submit_booking:hover {
    background-color: #76DD7D;
}

.bfw-button-details, 
.bfw-button-book {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    color: white;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 14px;
}

.bfw-button-details {
    background-color: #CC7D14;
}

.bfw-button-details:hover {
    background-color: #824444;
    text-decoration: none;
}

.bfw-button-book {
    background-color: #28a745;
}

.bfw-button-book:hover {
    background-color: #218838;
    text-decoration: none;
}

.bfw-calculate-btn-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- INFO E MESSAGGI ---- */
.bfw-children-not-allowed {
    display: block;
    font-size: 12px;
    color: #e2401c;
    margin-top: 5px;
}

.bfw-price-label {
    font-weight: 600;
}

.bfw-price-value {
    font-size: 18px;
    font-weight: 600;
}

.bfw-price-amount {
    font-weight: 600;
    font-size: 30px;
}

.bfw-loading {
    font-style: italic;
    color: #777;
}

.bfw-booking-info {
    margin-top: 20px;
    padding: 15px;
    background: #f0f7ff;
    border-left: 4px solid #2271b1;
    border-radius: 2px;
}

.bfw-message {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.bfw-error {
    color: #e2401c;
    padding: 10px;
    background: #f8d7da;
    border-radius: 4px;
    margin-bottom: 15px;
}

.bfw-message.bfw-error {
    background: #f8d7da;
    border-left: 4px solid #e2401c;
}

.bfw-nights-display {
    margin-top: 5px;
    font-style: italic;
    color: #666;
}

.bfw-no-results {
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 4px;
    font-style: italic;
    color: #666;
}

#bfw_price_display {
    font-weight: 400;
    display: block;
    font-size: 14px;
    line-height: 27px;
    margin-top: 10px;
    background: none !important;
}

/* ---- CAMPO DI RICERCA ---- */
.bfw-search-container {
    width: 100%;
}

.bfw-search-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    width: 100%;
}

.bfw-search-field {
    flex: 1 1 200px;
    min-width: 0;
}

.bfw-search-field.bfw-submit-field {
    display: flex;
    align-items: flex-end;
    gap:15px;
}

.bfw-search-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.bfw-search-field input[type="text"] {
    width: 100%;
    height: 40px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    margin: 0;
}

/* ---- MODAL ---- */
.bfw-modal {
    display: none;
    position: fixed;
    z-index: 2147483646 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px;
    box-sizing: border-box;
}

.bfw-modal.bfw-modal-open {
    display: flex;
    justify-content: center;
    align-items: center;
}

.bfw-modal-content {
    position: relative;
    z-index: 2147483647 !important;
    background-color: #fff;
    width: 95%;
    max-width: 800px;
    height: auto;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.25s ease;
    display: flex;
    flex-direction: column;
    margin: 0;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bfw-modal-close {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 28px;
    font-weight: 300;
    color: #555;
    cursor: pointer;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bfw-modal-close:hover {
    background-color: #f1f1f1;
    color: #333;
}

.bfw-modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}


body.bfw-modal-active {
    overflow: hidden;
}

/* ---- RISULTATI E ANIMAZIONI ---- */
.bfw-results-container {
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    height: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f5f5f5;
}

.bfw-results-container::-webkit-scrollbar {
    width: 8px;
}

.bfw-results-container::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.bfw-results-container::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 4px;
}

.bfw-search-loading {
    padding: 30px;
    text-align: center;
}

.bfw-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ---- CARD ALLOGGI ---- */
.bfw-accommodation-card {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #eee;
    margin-bottom: 25px;
    padding-bottom: 25px;
    width: 100%;
    gap: 20px;
    align-items: stretch;
}

.bfw-accommodation-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.bfw-accommodation-image {
    flex: 0 0 200px;
    margin-right: 0;
    margin-bottom: 0;
    display: flex;
    align-items: flex-start;
}

.bfw-accommodation-image img {
    width: 200px;
    height: 200px !important;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.bfw-accommodation-details {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bfw-accommodation-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    letter-spacing: normal;
}

.bfw-accommodation-features {
    margin-bottom: 12px;
}

.bfw-feature {
    display: inline-block;
    padding: 6px 10px;
    background: #f7f7f7;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 5px;
    color: #444;
}

.bfw-accommodation-price {
    margin: 10px 0;
    font-size: 16px;
}

.bfw-accommodation-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

/* ---- DETTAGLI ALLOGGIO ---- */
.bfw-details-container {
    margin-bottom: 40px;
}

.bfw-details-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.bfw-details-column {
    flex: 1;
    min-width: 300px;
}

.bfw-section {
    margin-bottom: 30px;
}

.bfw-section-title {
    font-size: 26px;
    color:unset;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
    letter-spacing: 0px;
}

.bfw-features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.bfw-feature {
    background: #f7f7f7;
    border-radius: 5px;
    padding: 15px;
    flex: 1;
    min-width: 250px;
}

.bfw-feature-title {
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    font-size: 18px;
    align-items: center;
}

.bfw-feature-title i {
    margin-right: 10px;
    width: auto;
    font-size: 25px;
    text-align: center;
}

.bfw-feature-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bfw-feature-items li {
    display: flex;
    align-items: center;
}

.bfw-feature-items li:before {
    content: "•";
    margin-right: 8px;
    color: #666;
}

.bfw-feature-status {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.bfw-status-item {
    display: flex;
    align-items: center;
    background: #f7f7f7;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
}

.bfw-status-item-search {
    margin-right: 5px;
    align-items: center;
    background: #f7f7f7;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
}

.bfw-status-item i {
    margin-right: 5px;
}

.bfw-status-item.available {
    background: #e8f5e9;
    color: #2e7d32;
}

.bfw-status-item.unavailable {
    background: #ffebee;
    color: #c62828;
}

.bfw-price-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
    border-radius: 5px;
    overflow: hidden;
}

.bfw-price-table th,
.bfw-price-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.bfw-price-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.bfw-price-table tr:last-child td {
    border-bottom: none;
}

.bfw-price {
    font-weight: 600;
    color: #333;
}

.bfw-price-info {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.bfw-min-nights {
    background: #f7f7f7;
    border-radius: 5px;
    padding: 10px 15px;
    margin-top: 15px;
    margin-bottom: 10px;
    color: #555;
}

.bfw-min-nights i {
    margin-right: 8px;
    vertical-align: middle;
}

.bfw-no-prices {
    padding: 20px;
    text-align: center;
    background: #f7f7f7;
    border-radius: 5px;
    color: #666;
    font-style: italic;
}

/* Utility Classes per elementi HTML */
.relative {
    position: relative !important;
}

.absolute {
    position: absolute !important;
}

.inset-y-0 {
    top: 0 !important;
    bottom: 0 !important;
}

.start-0 {
    left: 0 !important;
}

.flex {
    display: flex !important;
}

.items-center {
    align-items: center !important;
}

.ps-3 {
    padding-left: 0.75rem !important;
}

.pointer-events-none {
    pointer-events: none !important;
}

.w-4 {
    width: 1rem !important;
}

.h-4 {
    height: 1rem !important;
}

.text-gray-500 {
    color: #6b7280 !important;
}

.bg-white {
    background-color: white !important;
}

.border-gray-300 {
    border-color: #d1d5db !important;
}

.text-gray-900 {
    color: #1f2937 !important;
}

.text-sm {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
}

.rounded-lg {
    border-radius: 0.5rem !important;
}

.focus\:ring-blue-500:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5) !important;
}

.focus\:border-blue-500:focus {
    border-color: #3b82f6 !important;
}

.ps-10 {
    padding-left: 2.5rem !important;
}

.p-2\.5 {
    padding: 0.625rem !important;
}

.block {
    display: block !important;
}

.w-full {
    width: 100% !important;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .bfw-search-field {
        flex: 1 1 175px;
    }
    
    .bfw-form-field {
        flex: 1 1 175px;
    }
}

@media (max-width: 768px) {
    /* Layout grid per mobile */
    .bfw-search-fields {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        grid-gap: 10px;
        grid-template-areas:
            "checkin checkout"
            "adults children"
            "submit submit";
    }
    
    /* Assegnamo aree alle caselle */
    .bfw-search-fields .bfw-search-field:nth-child(1) {
        grid-area: checkin;
    }
    
    .bfw-search-fields .bfw-search-field:nth-child(2) {
        grid-area: checkout;
    }
    
    .bfw-search-fields .bfw-search-field:nth-child(3) {
        grid-area: adults;
    }
    
    .bfw-search-fields .bfw-search-field:nth-child(4) {
        grid-area: children;
    }
    
    .bfw-search-fields .bfw-search-field:nth-child(5) {
        grid-area: submit;
    }
    
    /* Fix margini e pulsante */
    .bfw-search-field {
        width: 100% !important;
        margin: 0 !important;
        min-width: 0;
    }
    
    .bfw-search-field.bfw-submit-field button {
        width: 100%;
    }
    
    /* Adatta le date per evitare overflow su mobile */
    .bfw-dates-section .bfw-form-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* Fix immagine e card su mobile */
    .bfw-accommodation-card {
        flex-direction: column;
        gap: 15px;
    }
    
    .bfw-accommodation-image {
        flex: 0 0 100% !important;
        width: 100% !important;
        justify-content: center;
    }
    
    .bfw-accommodation-image img {
        width: 100% !important;
        max-width: 320px;
        height: auto !important;
        aspect-ratio: 1/1;
    }
    
    .bfw-accommodation-details {
        width: 100%;
    }
    
    .bfw-accommodation-buttons {
        width: 100%;
    }
    
    /* Form di prenotazione mobile */
    .bfw-form-section {
        width: 100%;
    }
    
    .bfw-form-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }
    
    .bfw-form-field {
        flex: 1 1 calc(50% - 10px);
        min-width: 0;
    }
    
    .bfw-submit-section .bfw-form-row {
        flex-direction: column;
        width: 100%;
    }
    
    .bfw-details-column {
        min-width: 100%;
    }
    
    .bfw-feature {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    /* Stile super mobile */
    .bfw-search-fields {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }
    
    .bfw-search-field {
        flex: 1 1 100%;
        margin-bottom: 10px !important;
    }
    
    .bfw-form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .bfw-form-field {
        flex: 1 1 100%;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .bfw-accommodation-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .bfw-button-details, 
    .bfw-button-book {
        width: 100%;
        text-align: center;
    }
    
    .bfw-guests-field {
        flex: 1;
        min-width: 100px;
    }
    
    /* Assicura che i pulsanti siano a tutta larghezza */
    .bfw-button, 
    .bfw-submit-button,
    .bfw-button-details,
    .bfw-button-book,
    .bfw-search-field.bfw-submit-field button {
        width: 100%;
        text-align: center;
    }
    
    /* Adatta il datepicker su mobile */
    .datepicker-dropdown {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 300px !important;
        max-width: 95% !important;
    }
    
    .datepicker-grid {
        width: 100% !important;
    }
}

/* Adattamento per il datepicker su schermi diversi */
@media (min-width: 769px) {
    .bfw-dates-section .bfw-form-row,
    .bfw-guests-section .bfw-form-row {
        display: flex;
        flex-wrap: nowrap;
        gap: 20px;
    }
    
    .bfw-datepicker-field,
    .bfw-guests-field {
        min-width: 0;
        flex: 1;
    }
    
    .bfw-search-fields {
        display: flex;
        flex-wrap: wrap;
    }
    
    .bfw-search-field:nth-child(1),
    .bfw-search-field:nth-child(2),
    .bfw-search-field:nth-child(3),
    .bfw-search-field:nth-child(4) {
        flex: 1 1 calc(25% - 15px);
    }
    
    .bfw-search-field.bfw-submit-field {
        flex: 1 1 auto;
    }
    
    .datepicker-dropdown {
        min-width: 300px !important;
    }
}


/* SOLO il tuo datepicker */

/* Contenitore principale */
#ui-datepicker-div {
    all: unset;
    display: none;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    font-family: 'Arial', sans-serif;
    z-index: 9999 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: 280px !important; /* Larghezza fissa per desktop */
    max-width: 280px !important; /* Limit max width */
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-size: 12px !important;
}

/* Header con disposizione per mese tra frecce */
.ui-datepicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    margin-bottom: 16px;
    padding: 0;
    position: relative;
}

/* Frecce con icone FA5 */
.ui-datepicker-prev,
.ui-datepicker-next {
    cursor: pointer;
    color: #CC7D14;
    font-size: 18px;
    border: none;
    background: none;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    position: relative;
    z-index: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

/* Nascondi testo */
.ui-datepicker-prev span,
.ui-datepicker-next span {
    display: none !important;
}

/* Font Awesome 5 specifico */
.ui-datepicker-prev::before,
.ui-datepicker-next::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    display: inline-block;
}

/* Icona sinistra */
.ui-datepicker-prev::before {
    content: "\f104"; /* fa-angle-left */
}

/* Icona destra */
.ui-datepicker-next::before {
    content: "\f105"; /* fa-angle-right */
}

/* Mese centrato */
.ui-datepicker-title {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    margin:0;
    color: #333;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Tabella datepicker */
.ui-datepicker table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
}

/* Giorni della settimana */
.ui-datepicker th {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 6px 0;
    font-size: 12px;
}

/* Celle */

.ui-datepicker td {
    border: none !important;
}

.ui-datepicker td .ui-state-default{
    border: none !important;
    padding: 2px;
    text-align: center;
    vertical-align: middle;
}

/* Giorni (link o span) */
.ui-datepicker td a,
.ui-datepicker td span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 auto;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    color: #333;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}

/* Hover */
.ui-datepicker td .ui-state-default.ui-state-hover {
    background-color: #CC7D14;
    color: #ffffff!important;
}

/* Selezione */
.ui-datepicker td a.ui-state-active {
    background-color: #CC7D14 !important;
    color: #ffffff !important;
}

/* Oggi */
.ui-datepicker td a.ui-state-highlight {
    background-color: #f0f0f0 !important;
    color: #000000 !important;
}

/* Giorni disabilitati */
.ui-datepicker td.ui-datepicker-unselectable span {
    color: #ccc !important;
    pointer-events: none;
}

/* Fix per mobile */
@media screen and (max-width: 480px) {
    #ui-datepicker-div {
        width: calc(100% - 40px) !important;
        left: 50% !important;
        transform: translateX(-50%);
        max-width: 280px !important;
    }
    
    .ui-datepicker td a,
    .ui-datepicker td span {
        width: 28px;
        height: 28px;
    }
    
    /* Specifico per iPhone/iPad con Chrome */
    @supports (-webkit-touch-callout: none) and (-webkit-appearance: none) {
        #ui-datepicker-div {
            width: calc(100% - 40px) !important;
        }
        
        .ui-datepicker td {
            padding: 1px;
        }
    }
}