/**
 * MYR Booking Engine Styles
 * Estilos para el formulario de reservas de hoteles MYR
 * 
 * @package MYR_Booking_Engine
 * @version 1.0.0
 */

/* Reset y Base */
.myr-booking-form {
    background: #ffffff;
    max-width: 100%;
}

/* Grid Layout - Horizontal inline */
.myr-booking-grid {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
}

@media (max-width: 767px) {
    .myr-booking-grid {
        flex-wrap: wrap;
    }
}

/* Form Fields */
.myr-form-field {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-right: 1px solid #e5e5e5;
    flex: 1;
    min-width: 0;
}

.myr-form-field:last-child {
    border-right: 0;
    flex: 0 0 auto;
}

@media (max-width: 767px) {
    .myr-form-field {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid #e5e5e5;
    }
    
    .myr-form-field:last-child {
        border-bottom: 0;
    }
}

/* Labels */
.myr-field-label {
    display: block;
    font-size: 0.75rem;
    color: #6f6f6f;
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Select Wrapper */
.myr-select-wrap {
    position: relative;
    width: 100%;
}

.myr-select {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: 0.9375rem;
    color: #171717;
    outline: none;
    appearance: none;
    padding-right: 1.5rem;
    cursor: pointer;
    font-weight: 500;
}

.myr-select-wrap::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #6f6f6f;
    pointer-events: none;
}

/* Date Picker */
.myr-calendar-wrap {
    position: relative;
    width: 100%;
}

.myr-date-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.myr-date-input {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: 0.9375rem;
    color: #171717;
    outline: none;
    cursor: pointer;
    font-weight: 500;
    padding-right: 1.5rem;
}

.myr-date-input::placeholder {
    color: #6f6f6f;
}

/* Occupancy Trigger */
.myr-occupancy-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: 0.9375rem;
    color: #171717;
    outline: none;
    text-align: left;
    cursor: pointer;
    padding: 0;
}

.myr-occupancy-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.myr-occupancy-summary {
    font-weight: 500;
}

.myr-chevron-icon {
    width: 1rem;
    height: 1rem;
    color: #6f6f6f;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

/* Occupancy Dropdown */
.myr-occupancy-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    width: 320px;
    padding: 1.25rem;
    /* Floating UI manejará el posicionamiento */
}

.myr-occupancy-dropdown.hidden {
    display: none;
}

/* Occupancy Item */
.myr-occupancy-item {
    margin-bottom: 1rem;
}

.myr-occupancy-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.myr-occupancy-label {
    font-size: 0.875rem;
    color: #171717;
}

.myr-counter-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.myr-counter-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    color: #ffffff;
    border-radius: 0.25rem;
    border: 0;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.myr-counter-btn:hover {
    background: #1a1a1a;
}

.myr-counter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.myr-counter-btn svg {
    width: 1rem;
    height: 1rem;
}

.myr-counter-value {
    font-size: 0.875rem;
    font-weight: 500;
    width: 1.5rem;
    text-align: center;
}

/* Children Ages */
.myr-children-ages {
    margin-top: 0.75rem;
}

.myr-children-ages-label {
    font-size: 0.75rem;
    color: #6f6f6f;
    margin-bottom: 0.5rem;
    display: block;
}

.myr-age-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.myr-child-age-input {
    width: 3.5rem;
    height: 2.25rem;
    text-align: center;
    border: 1px solid #e5e5e5;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    outline: none;
}

.myr-child-age-input:focus {
    border-color: #b28a5a;
}

/* Apply Button */

.myr-booking-form button{
    border: 1px solid #ab8a62;
}

.myr-apply-button {
    width: 100%;
    background: #000000;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.875rem 1.5rem;
    border: 0;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.myr-apply-button:hover {
    background: #1a1a1a;
}

/* Promo Code */
.myr-promo-wrap {
    width: 100%;
}

.myr-promo-input {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: 0.9375rem;
    color: #171717;
    outline: none;
    font-weight: 500;
}

.myr-promo-input::placeholder {
    color: #6f6f6f;
}

/* Submit Button */
.myr-submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #b28a5a;
    color: #ffffff;
    border: 0;
    padding: 1rem 2.25rem;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    letter-spacing: 0.14em;
    white-space: nowrap;
    font-size: 0.875rem;
}

.myr-submit-button:hover {
    background: #9a7349;
}

@media (max-width: 767px) {
    .myr-submit-button {
        width: 100%;
    }
}

/* Flatpickr Customization */
.flatpickr-calendar {
    font-family: inherit;
}

.flatpickr-day.selected {
    background: #b28a5a;
    border-color: #b28a5a;
}

.flatpickr-day.selected:hover {
    background: #9a7349;
    border-color: #9a7349;
}

.flatpickr-months .flatpickr-month {
    background: #b28a5a;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: #b28a5a;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .myr-booking-wrapper {
        padding: 1.5rem 0.75rem;
    }
    
    .myr-form-field {
        padding: 1rem;
    }
    
    .myr-occupancy-dropdown {
        width: 100%;
        left: 0;
        right: 0;
    }
}

/* Accessibility */
.myr-booking-form *:focus-visible {
    outline: 2px solid #b28a5a;
    outline-offset: 2px;
}

/* Loading State */
.myr-booking-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.myr-booking-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #b28a5a;
    border-radius: 50%;
    animation: myr-spin 1s linear infinite;
}

@keyframes myr-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
