/**
 * Polymar Reserva - Estilos Visuais
 * Design premium baseado nas referências visuais
 */

.polymar-reserva-wrapper {
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
    z-index: 50;
}

.polymar-reserva-wrapper *,
.polymar-reserva-wrapper *::before,
.polymar-reserva-wrapper *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Main Booking Bar (Desktop com altura ampla e visual marcante)
   ========================================================================== */
.polymar-reserva-bar {
    background-color: #12b8b3;
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='wavePattern' x='0' y='0' width='120' height='120' patternUnits='userSpaceOnUse'%3E%3Cpath d='M0 60 Q 30 30 60 60 T 120 60' fill='none' stroke='%2322d2cc' stroke-width='8' stroke-linecap='round' opacity='0.4'/%3E%3Cpath d='M0 90 Q 30 60 60 90 T 120 90' fill='none' stroke='%2322d2cc' stroke-width='8' stroke-linecap='round' opacity='0.4'/%3E%3Cpath d='M0 30 Q 30 0 60 30 T 120 30' fill='none' stroke='%2322d2cc' stroke-width='8' stroke-linecap='round' opacity='0.4'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23wavePattern)'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(18, 184, 179, 0.28), 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.pm-bar-section {
    display: flex;
    align-items: center;
}

/* 1. Brand / Step Block */
.pm-brand-section {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 6px 0 2px;
}

.pm-brand-title {
    color: #ffffff;
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.pm-brand-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 500;
    margin-top: 3px;
    white-space: nowrap;
}

/* 2. Dates Section (Entrada / Saída) */
.pm-dates-section {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    height: 64px;
    padding: 0 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    user-select: none;
    flex-shrink: 1;
}

.pm-dates-section:hover {
    background: rgba(255, 255, 255, 0.24);
}

.pm-date-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pm-date-icon {
    color: #ffffff;
    display: flex;
    align-items: center;
    opacity: 0.95;
}

.pm-date-icon svg {
    width: 18px;
    height: 18px;
}

.pm-date-content {
    display: flex;
    flex-direction: column;
}

.pm-date-label {
    font-size: 9.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.6px;
    line-height: 1;
}

.pm-date-value {
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 2px;
    line-height: 1.1;
    white-space: nowrap;
}

.pm-date-separator {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 8px;
    display: flex;
    align-items: center;
}

.pm-date-separator svg {
    width: 16px;
    height: 16px;
}

/* 3. Guests Section */
.pm-guests-section {
    position: relative;
    flex-shrink: 1;
}

.pm-guests-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    height: 64px;
    padding: 0 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.pm-guests-trigger:hover,
.pm-guests-trigger.active {
    background: rgba(255, 255, 255, 0.24);
}

.pm-guests-icon {
    color: #ffffff;
    display: flex;
    align-items: center;
    opacity: 0.95;
}

.pm-guests-icon svg {
    width: 18px;
    height: 18px;
}

.pm-guests-content {
    display: flex;
    flex-direction: column;
}

.pm-guests-label {
    font-size: 9.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.6px;
    line-height: 1;
}

.pm-guests-summary {
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 2px;
    line-height: 1.1;
    white-space: nowrap;
}

.pm-guests-arrow {
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.pm-guests-arrow svg {
    width: 13px;
    height: 13px;
}

.pm-guests-trigger.active .pm-guests-arrow {
    transform: rotate(180deg);
}

/* Guests Popover Card */
.pm-guests-popover {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f5;
    padding: 20px;
    width: 320px;
    z-index: 9999;
    animation: pmFadeInDown 0.2s ease forwards;
}

.pm-guests-popover.open {
    display: block;
}

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

.pm-popover-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f4f8;
}

.pm-popover-row:first-child {
    padding-top: 0;
}

.pm-row-info {
    display: flex;
    flex-direction: column;
}

.pm-row-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.pm-row-sub {
    font-size: 11px;
    color: #8c9ba5;
    margin-top: 2px;
}

.pm-counter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pm-btn-counter {
    width: 32px;
    height: 32px;
    border: 1px solid #cfd8dc;
    background: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    outline: none;
    padding: 0;
}

.pm-btn-counter:hover:not(:disabled) {
    border-color: #f5a600;
    color: #f5a600;
    background: #fffdfa;
}

.pm-btn-counter:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pm-counter-val {
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
    min-width: 22px;
    text-align: center;
}

/* Dynamic Child Ages */
.pm-children-ages-container {
    padding-top: 14px;
    border-bottom: 1px solid #f1f4f8;
    padding-bottom: 14px;
}

.pm-ages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pm-ages-title {
    font-size: 13px;
    font-weight: 700;
    color: #2d3748;
}

.pm-ages-note {
    font-size: 11px;
    color: #718096;
}

.pm-ages-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.pm-age-select-group {
    display: flex;
    flex-direction: column;
}

.pm-age-label {
    font-size: 11px;
    color: #718096;
    margin-bottom: 4px;
}

.pm-age-select {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    background-color: #f8fafc;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.pm-age-select:focus {
    border-color: #f5a600;
    background-color: #ffffff;
}

/* Apply button inside popover */
.pm-popover-actions {
    margin-top: 14px;
}

.pm-btn-apply {
    width: 100%;
    background: #dbeef7;
    color: #0284c7;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.pm-btn-apply:hover {
    background: #c7e6f4;
    color: #0369a1;
}

.pm-apply-summary {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.85;
}

/* 4. Promo Code */
.pm-code-section {
    min-width: 95px;
    max-width: 135px;
    flex: 1 1 auto;
}

.pm-code-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 0 10px;
    height: 64px;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.pm-code-input-wrapper:focus-within {
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.pm-code-icon {
    color: #718096;
    display: flex;
    align-items: center;
    margin-right: 6px;
    flex-shrink: 0;
}

.pm-code-icon svg {
    width: 16px;
    height: 16px;
}

.pm-code-input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
}

.pm-code-input::placeholder {
    color: #a0aec0 !important;
    font-weight: 400 !important;
}

/* 5. Action / Submit Button */
.pm-action-section {
    flex-shrink: 0;
}

.pm-btn-submit {
    background: #ff5500;
    color: #ffffff;
    border: none;
    outline: none;
    border-radius: 8px;
    padding: 0 24px;
    height: 64px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(255, 85, 0, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.pm-btn-submit:hover {
    background: #e64a00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 85, 0, 0.45);
}

.pm-btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 85, 0, 0.3);
}

.pm-btn-icon {
    transition: transform 0.2s ease;
}

.pm-btn-submit:hover .pm-btn-icon {
    transform: scale(1.1);
}

/* ==========================================================================
   Flatpickr Custom Resort Theme
   ========================================================================== */
.flatpickr-calendar {
    font-family: inherit !important;
    border-radius: 12px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.16) !important;
    border: 1px solid #eef2f5 !important;
    padding: 12px 14px !important;
    z-index: 99999 !important;
    box-sizing: content-box !important;
    overflow: visible !important;
}

.flatpickr-calendar.multiMonth {
    width: auto !important;
}

.flatpickr-months {
    display: flex !important;
    min-width: max-content !important;
    position: relative !important;
    padding-bottom: 6px;
    box-sizing: content-box !important;
}

.flatpickr-months .flatpickr-month {
    min-width: 308px !important;
    width: 308px !important;
    flex: 0 0 308px !important;
    position: relative !important;
    overflow: visible !important;
}

.flatpickr-months .flatpickr-prev-month {
    left: 4px !important;
    top: 0 !important;
}

.flatpickr-months .flatpickr-next-month {
    right: 4px !important;
    top: 0 !important;
}

.flatpickr-innerContainer {
    display: flex !important;
    min-width: max-content !important;
    overflow: visible !important;
    box-sizing: content-box !important;
}

.flatpickr-rContainer {
    display: inline-block !important;
    min-width: max-content !important;
    overflow: visible !important;
    box-sizing: content-box !important;
}

.flatpickr-weekdays {
    overflow: visible !important;
    width: 100% !important;
    display: flex !important;
    min-width: max-content !important;
}

.flatpickr-weekdays .flatpickr-weekdaycontainer {
    display: flex !important;
    min-width: 308px !important;
    width: 308px !important;
    flex: 0 0 308px !important;
    overflow: visible !important;
}

.flatpickr-days {
    overflow: visible !important;
    width: auto !important;
    min-width: max-content !important;
    display: flex !important;
}

.dayContainer {
    overflow: visible !important;
    min-width: 308px !important;
    width: 308px !important;
    max-width: 308px !important;
    box-sizing: border-box !important;
}

.flatpickr-current-month {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1a202c !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    left: 0 !important;
    padding: 0 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    width: auto !important;
    font-weight: 700 !important;
}

.flatpickr-current-month .numInputWrapper {
    width: auto !important;
}

.flatpickr-current-month input.cur-year {
    font-weight: 700 !important;
}

span.flatpickr-weekday {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #718096 !important;
    text-transform: uppercase;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.flatpickr-day {
    border-radius: 6px !important;
    font-weight: 500 !important;
    color: #2d3748 !important;
    height: 36px !important;
    line-height: 36px !important;
}

.flatpickr-day.today {
    border-color: #f5a600 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #f5a600 !important;
    border-color: #f5a600 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.flatpickr-day.inRange {
    background: #fff2d6 !important;
    border-color: #fff2d6 !important;
    color: #8c5b00 !important;
}

.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
    color: #cbd5e0 !important;
    cursor: not-allowed !important;
}

/* ==========================================================================
   Responsividade Intermediária (Tablet/Notebooks pequenos)
   ========================================================================== */
@media (max-width: 1024px) {
    .polymar-reserva-bar {
        flex-wrap: wrap;
        padding: 16px;
        gap: 10px;
    }
    .pm-brand-section {
        width: 100%;
        text-align: center;
        align-items: center;
        margin-bottom: 4px;
    }
    .pm-dates-section {
        flex: 1 1 100%;
        width: 100%;
        justify-content: space-around;
    }
    .pm-guests-section {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
    }
    .pm-guests-trigger {
        width: 100%;
        justify-content: space-between;
    }
    .pm-guests-popover {
        width: calc(200% + 10px);
        max-width: 320px;
    }
    .pm-code-section {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
        max-width: none;
    }
    .pm-code-input-wrapper {
        width: 100%;
    }
    .pm-action-section {
        flex: 1 1 100%;
        width: 100%;
    }
    .pm-btn-submit {
        width: 100%;
    }
}

/* ==========================================================================
   Standard Media Queries (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 768px) {
    .polymar-reserva-bar {
        flex-wrap: wrap;
        padding: 16px 14px;
        gap: 10px;
        border-radius: 12px;
    }
    .pm-brand-section {
        width: 100%;
        text-align: center;
        align-items: center;
        margin-bottom: 4px;
        padding: 0;
    }
    .pm-brand-title {
        font-size: 17px;
    }
    .pm-brand-subtitle {
        font-size: 12px;
    }
    .pm-dates-section {
        flex: 1 1 100%;
        width: 100%;
        justify-content: space-around;
        padding: 0 12px;
        height: 48px;
    }
    /* HOSPEDES e CODIGO LADO A LADO NO MOBILE */
    .pm-guests-section {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
    }
    .pm-guests-trigger {
        width: 100%;
        height: 48px;
        padding: 0 10px;
        justify-content: space-between;
    }
    .pm-guests-summary {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pm-guests-popover {
        width: calc(200% + 10px);
        max-width: 320px;
        left: 0;
    }
    .pm-code-section {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
        max-width: none;
    }
    .pm-code-input-wrapper {
        width: 100%;
        height: 48px;
        padding: 0 10px;
    }
    .pm-code-input {
        font-size: 12px !important;
    }
    .pm-action-section {
        flex: 1 1 100%;
        width: 100%;
    }
    .pm-btn-submit {
        width: 100%;
        height: 48px;
        font-size: 15px;
    }

    .flatpickr-calendar {
        padding: 12px 14px 14px 14px !important;
        max-width: 95vw !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin;
        scrollbar-color: #cbd5e0 transparent;
    }

    .flatpickr-calendar::-webkit-scrollbar {
        height: 6px;
    }

    .flatpickr-calendar::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .flatpickr-calendar::-webkit-scrollbar-thumb {
        background-color: #cbd5e0;
        border-radius: 4px;
    }

    .flatpickr-innerContainer {
        padding-right: 24px !important;
    }

    .flatpickr-months {
        padding-right: 24px !important;
    }

    .flatpickr-months .flatpickr-next-month {
        right: 24px !important;
    }

    .flatpickr-rContainer {
        padding-right: 8px !important;
    }
}
