/*
 * Styles for the Hotel Customer Manager booking form
 * Cleaned and updated for better consistency and responsiveness.
 */

/* General container for the form */
.hcm-form {
    border: 1px solid #e0e0e0;
    padding: 25px;
    border-radius: 8px;
    background-color: #f9f9f9;
    max-width: 500px;
    margin: 20px auto; /* Removed negative margin for proper centering */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Added subtle shadow for visual depth */
}

/* Title styling */
.hcm-booking-ui h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

/* Row for each booking option (Adults, Children, etc.) */
.hcm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e9e9e9;
}

.hcm-row:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.hcm-label {
    font-weight: 600;
    flex-grow: 1;
    color: #555;
}

.hcm-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Quantity input field styling */
.hcm-qty {
    width: 50px;
    text-align: center;
    -moz-appearance: textfield;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    height: 45px; /* Added to match button height */
    box-sizing: border-box; /* Ensures padding is included in the total width/height */
    outline: none; /* Removes the default outline on focus */
}

/* Hides spin buttons for number input in Webkit browsers */
.hcm-qty::-webkit-outer-spin-button,
.hcm-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Plus and minus buttons */
.hcm-minus, .hcm-plus {
    background-color: #fff;
    color: #000;
    border: 1px solid #e0e0e0;
    width: 30px;
    height: 45px;
    border-radius: 5px; /* Corrected from 0% to a consistent 5px */
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}


.hcm-minus:hover, .hcm-plus:hover {
    color: #005bb5;
    border: 1px solid #005bb5;
}

.hcm-item-price {
    font-weight: bold;
    color: #444;
    min-width: 60px;
    text-align: right;
    padding-left: 10px; /* Added spacing */
}

/* Date selection section */
.hcm-date {
    margin: 20px 0;
    text-align: left;
}

.hcm-date label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.hcm_booking_date {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    box-sizing: border-box; /* Ensures padding and border are included in the width */
    outline: none; /* Removes the default outline on focus */
}

/* Focus style for the date input */
.hcm_booking_date:focus {
    border-color: #005bb5;
}

.hcm_availability {
    margin-top: 10px;
    font-style: italic;
    color: #777;
    text-align: left; /* Aligns with the input field */
}

/* Messages and validation errors */
.hcm-messages {
    min-height: 20px;
    margin-top: 10px;
    text-align: center;
}

.hcm-messages .error {
    color: #d9534f;
    font-weight: bold;
}

.hcm-messages .success {
    color: #5cb85c;
    font-weight: bold;
}

/* Total price section */
.hcm-total {
    text-align: right;
    font-size: 1.2em;
    padding-top: 15px;
    border-top: 2px solid #ddd;
    margin-top: 20px;
}

/* Submit button styling */
.single_add_to_cart_button {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    background-color: #001782;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.single_add_to_cart_button:hover {
    background-color: #292F29;
    color: #fff;
}

/* Datepicker popup z-index fix */
.ui-datepicker {
    z-index: 99999999999999 !important;
}

/*
 * Styles for the calendar icon using a wrapper element and a pseudo-element.
 * The icon's unicode and font-family are specified here.
 */
.hcm-date-container {
    position: relative;
    display: block; /* Ensures the container takes full width */
}

.hcm-date-container::after {
    /* Font Awesome 5 Free Unicode for calendar-alt */
    content: '\f073'; 
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    
    color: #888;
    pointer-events: none; /* Prevents the icon from interfering with input clicks */
}


@media (max-width: 1900px) {
    #ui-datepicker-div {
    position: absolute !important;
    
    width: auto; 
    max-width: 100%; 
    
    display: block;
    
}
}

/* Media Queries to handle responsiveness */
@media (max-width: 768px) {
    #ui-datepicker-div {
        width: 60%; /* Make it fill the width on smaller devices */
        left: 0; /* Center the datepicker */
        right: 0; /* Center the datepicker */
    }
}

@media (max-width: 480px) {
    #ui-datepicker-div {
        width: 80%; /* Again, make it full width for mobile */
        font-size: 14px; /* Adjust the font size for readability */
        padding: 0px;
    }
}




/* --- RESPONSIVENESS IMPROVEMENTS --- */

/* For very narrow screens (e.g., iPhone 5/SE, or when form is in a narrow column) */
@media (max-width: 480px) {
    .hcm-form {
        padding: 15px;
    }

    /* Stack the label on top of the controls */
    .hcm-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .hcm-label {
        padding-right: 0;
    }

    .hcm-controls {
        width: 100%;
        justify-content: space-between;
        /* Distribute controls evenly */
    }

    .hcm-qty {
        flex-grow: 1;
        /* Allow quantity input to fill space */
    }

    .hcm-item-price {
        padding-left: 0;
    }

    .hcm-total {
        text-align: right;
    }
}