/**
 * Hotel Reserva Bar - Mobile Styles
 * Premium bottom sheet modal with smooth animations
 * Version: 1.0.0
 */

/* ========================================
   Mobile CSS Variables
   ======================================== */
   @media (max-width: 768px) {
    :root {
        /* Mobile Colors */
        --mobile-bg: #FFFFFF;
        --mobile-overlay: rgba(0, 0, 0, 0.45);
        --mobile-blue: #F8AE5C;
        --mobile-blue-hover: #e79c50;
        --mobile-blue-light: rgba(248, 174, 92, 0.15);
        --mobile-border: #e0e4e8;
        --mobile-text-dark: #1b1b1b;
        --mobile-text-gray: #6b7280;
        --mobile-text-light: #9ca3af;

        /* Mobile Spacing */
        --mobile-padding: 20px;
        --mobile-gap: 16px;

        /* Mobile Border Radius */
        --mobile-radius-sm: 8px;
        --mobile-radius-md: 12px;
        --mobile-radius-lg: 16px;
        --mobile-radius-xl: 28px;

        /* Mobile Shadows */
        --mobile-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
        --mobile-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
        --mobile-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    }
}

/* ========================================
   Mobile Compact Bar
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 100px;
        width: 340px;
        min-width: 320px;
        max-width: calc(100% - 24px); /* garante respiro em telas menores */
        background: #FFFFFF;
        border-radius: 0 30px 0 30px;
        box-shadow: var(--mobile-shadow-md);
        padding: 0 24px; /* aumenta o respiro lateral */
        gap: 12px;       /* aproxima os campos mantendo o padding */
        position: relative;
        overflow: hidden;
        margin: 0 auto;
    }

    .hrb-mobile-bar::before {
        content: '';
        position: absolute;
        inset: 0;
        background: none;
        pointer-events: none;
    }
}

/* ========================================
   Mobile Field
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-field {
        flex: 1;
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: var(--mobile-radius-md);
        position: relative;
    }

    .hrb-mobile-field:active {
        background: var(--mobile-blue-light);
        transform: scale(0.98);
    }

    .hrb-mobile-field::after {
        content: '';
        position: absolute;
        right: 16px;
        top: 14px; /* desce a seta para não sobrepor a data */
        transform: translateY(-50%) rotate(45deg);
        width: 6px;
        height: 6px;
        border-right: 2px solid #465A50;
        border-bottom: 2px solid #465A50;
        opacity: 0.5;
    }
}

/* ========================================
   Mobile Icon
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-icon {
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        color: #465A50;
    }
}

/* ========================================
   Mobile Content
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-content {
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
    }

    .hrb-mobile-label {
        font-size: 11px;
        font-weight: 600;
        color: #465A50;
        text-transform: uppercase;
        letter-spacing: 0.25px;
    }

    .hrb-mobile-value {
        font-size: 14px;
        font-weight: 600;
        color: var(--mobile-text-dark);
    }

    .hrb-mobile-value.placeholder {
        color: var(--mobile-text-light);
        font-weight: 400;
    }
}

/* ========================================
   Mobile Divider
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-divider {
        width: 1px;
        height: 52px;
        background: var(--mobile-border);
    }
}

/* ========================================
   Mobile Modal Overlay
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-modal {
        position: fixed;
        inset: 0;
        z-index: 9999;
        display: flex;
        align-items: flex-end;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hrb-mobile-modal.active {
        opacity: 1;
        visibility: visible;
    }

    .hrb-mobile-overlay {
        position: absolute;
        inset: 0;
        background: var(--mobile-overlay);
        cursor: pointer;
    }
}

/* ========================================
   Mobile Bottom Sheet
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-sheet {
        position: relative;
        width: 100%;
        max-height: 95vh;
        background: var(--mobile-bg);
        border-radius: var(--mobile-radius-xl) var(--mobile-radius-xl) 0 0;
        box-shadow: var(--mobile-shadow-lg);
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hrb-mobile-modal.active .hrb-mobile-sheet {
        transform: translateY(0);
    }

    /* Pull indicator */
    .hrb-mobile-sheet::before {
        content: '';
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--mobile-border);
        border-radius: 2px;
    }
}

/* ========================================
   Mobile Sheet Header
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 24px var(--mobile-padding) 16px;
        border-bottom: 1px solid var(--mobile-border);
    }

    .hrb-mobile-sheet-title {
        font-size: 18px;
        font-weight: 500;
        color: var(--mobile-text-dark);
        margin: 0;
    }

    .hrb-mobile-sheet-close {
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 50%;
        background: transparent;
        color: var(--mobile-text-gray);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0;
    }

    .hrb-mobile-sheet-close:active {
        background: var(--mobile-border);
        transform: scale(0.95);
    }
}

/* ========================================
   Mobile Sheet Content
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-sheet-content {
        flex: 1;
        overflow-y: auto;
        padding: var(--mobile-padding) var(--mobile-padding) 150px var(--mobile-padding);
        padding-bottom: 150px !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .hrb-mobile-sheet-content::after {
        content: '';
        display: block;
        height: 50px;
        width: 100%;
    }

    .hrb-mobile-sheet-content::-webkit-scrollbar {
        width: 4px;
    }

    .hrb-mobile-sheet-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .hrb-mobile-sheet-content::-webkit-scrollbar-thumb {
        background: var(--mobile-border);
        border-radius: 2px;
    }
}

/* ========================================
   Mobile Sheet Footer
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-sheet-footer {
        padding: 16px var(--mobile-padding);
        border-top: 1px solid var(--mobile-border);
        background: var(--mobile-bg);
        display: flex;
        justify-content: center;
    }

    .hrb-mobile-btn-action {
        width: 134px;
        height: 45px;
        border: none;
        border-radius: 0 20px 0 20px;
        background: #465A50;
        color: #FFFFFF !important; /* força branco sobre estilos externos */
        font-family: 'MinervaModern', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-size: 16px;
        font-weight: 450;
        font-style: normal;
        line-height: 100%;
        letter-spacing: 0;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        text-transform: none;
        padding: 13px 30px;
    }

    .hrb-mobile-btn-action:active {
        background: #34463d;
        transform: scale(0.99);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }
}

/* ========================================
   Mobile Date Fields
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-date-fields {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 24px;
    }

    .hrb-mobile-date-field {
        position: relative;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border: 1px solid var(--mobile-border);
        border-radius: var(--mobile-radius-md);
        background: var(--mobile-bg);
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hrb-mobile-date-field:hover {
        border-color: var(--mobile-blue);
        background: #f8fbff;
    }

    .hrb-mobile-date-field.active {
        border-color: #F8AE5C;
        box-shadow: 0 0 0 3px rgba(248, 174, 92, 0.2);
    }

    .hrb-mobile-date-icon {
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        color: var(--mobile-blue);
    }

    .hrb-mobile-date-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .hrb-mobile-date-label {
        font-size: 12px;
        font-weight: 500;
        color: var(--mobile-text-gray);
    }

    .hrb-mobile-date-value {
        font-size: 15px;
        font-weight: 500;
        color: var(--mobile-text-dark);
    }

    .hrb-mobile-date-value.placeholder {
        color: var(--mobile-text-light);
    }
}

/* ========================================
   Mobile Calendar
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-calendar {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .hrb-nav-btn svg {
        width: 12px;
        height: 8px;
    }

    .hrb-nav-btn.hrb-nav-btn-prev svg {
        transform: rotate(90deg);
    }

    .hrb-nav-btn.hrb-nav-btn-next svg {
        transform: rotate(-90deg);
    }

    .hrb-mobile-calendar-footer {
        padding: 8px 8px 0 8px;
    }

    .hrb-mobile-calendar-footer-text {
        font-family: 'MinervaModern', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-weight: 400;
        font-style: normal;
        font-size: 12px;
        line-height: 100%;
        letter-spacing: 0%;
        color: #343935;
        margin: 0;
        text-align: left;
    }

    .hrb-mobile-calendar-clear {
        padding: 4px 8px 12px 8px;
        display: flex;
        justify-content: center;
    }

    .hrb-mobile-clear-btn {
        font-family: 'MinervaModern', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-size: 14px;
        font-weight: 400;
        color: #465A50;
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    .hrb-mobile-calendar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 8px;
    }

    .hrb-mobile-calendar-month {
        font-family: 'MinervaModern', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-size: 20px;
        font-weight: 400;
        font-style: normal;
        line-height: 100%;
        letter-spacing: 0%;
        color: #465A50;
        text-transform: capitalize;
        text-align: center;
    }

    .hrb-mobile-calendar-nav {
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 50%;
        background: transparent;
        color: var(--mobile-text-dark);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hrb-mobile-calendar-nav:active {
        background: var(--mobile-border);
        transform: scale(0.95);
    }

    .hrb-mobile-calendar-nav:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }
}

/* ========================================
   Mobile Calendar Grid
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 0;
        padding: 8px;
        position: relative;
        background: transparent;
    }

    .hrb-mobile-calendar-grid::after {
        content: '';
        position: absolute;
        top: 40px;   /* 8px padding + 32px altura do header */
        left: 8px;
        right: 8px;
        bottom: 8px;
        background: #F8F8F8;
        z-index: 0;
    }

    .hrb-mobile-calendar-day-name {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 32px;
        font-size: 12px;
        font-weight: 400;
        color: #465A50;
        text-transform: none;
        letter-spacing: 0;
        background: #FFFFFF; /* cabeçalho branco */
        position: relative;
        z-index: 2;
    }

    .hrb-mobile-calendar-day {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 36px;
        border-radius: 0;
        font-size: 12px;
        font-weight: 400;
        color: #465A50;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        user-select: none;
        position: relative;
        background: transparent;
        z-index: 1;
    }

    .hrb-mobile-calendar-day.disabled {
        color: rgba(70, 90, 80, 0.3);
        cursor: not-allowed;
    }

    .hrb-mobile-calendar-day.selected {
        background: #465A50;
        color: #FFFFFF;
        font-weight: 600;
    }

    .hrb-mobile-calendar-day.in-range {
        background: rgba(70, 90, 80, 0.15);
        color: #465A50;
    }

    .hrb-mobile-calendar-day.other-month {
        opacity: 0.3;
    }

    .hrb-mobile-calendar-day:not(.disabled):hover {
        background: rgba(70, 90, 80, 0.1);
    }

    .hrb-mobile-calendar-day.today::after {
        content: '';
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: currentColor;
    }
}

/* ========================================
   Mobile Guests Content
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-guests {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .hrb-mobile-guests-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 12px 0;
        background: transparent;
        border-radius: 0;
    }

    .hrb-mobile-guests-label {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .hrb-mobile-guests-title {
        font-size: 16px;
        font-weight: 600;
        color: #465A50;
        text-align: center;
    }

    .hrb-mobile-guests-subtitle {
        font-size: 13px;
        font-weight: 400;
        color: var(--mobile-text-gray);
        text-align: center;
    }

    .hrb-mobile-guests-counter {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .hrb-mobile-counter-btn {
        width: 36px;
        height: 36px;
        border: 1px solid var(--mobile-border);
        border-radius: 50%;
        background: var(--mobile-bg);
        color: var(--mobile-text-dark);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hrb-mobile-counter-btn:active:not(:disabled) {
        background: var(--mobile-border);
        transform: scale(0.95);
    }

    .hrb-mobile-counter-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

    .hrb-mobile-counter-value {
        min-width: 128px;
        height: 64px;
        padding: 20px 32.8px;
        text-align: center;
        font-size: 16px;
        font-weight: 600;
        color: var(--hrb-ink);
        display: flex;
        align-items: center;
        justify-content: center;
        background: #FFFFFF;
        border: none;
        border-top-right-radius: 10px;
        border-bottom-left-radius: 10px;
        border-top-left-radius: 0;
        border-bottom-right-radius: 0;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }
}

/* ========================================
   Mobile Children Ages
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-children-ages {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 8px;
    }

    .hrb-mobile-child-age-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: var(--mobile-bg);
        border: 1px solid var(--mobile-border);
        border-radius: var(--mobile-radius-md);
    }

    .hrb-mobile-child-age-label {
        font-size: 14px;
        font-weight: 500;
        color: var(--mobile-text-dark);
    }

    .hrb-mobile-child-age-select {
        padding: 8px 12px;
        border: 1px solid var(--mobile-border);
        border-radius: var(--mobile-radius-sm);
        background: var(--mobile-bg);
        font-family: var(--hrb-font-body);
        font-size: 14px;
        font-weight: 500;
        color: var(--mobile-text-dark);
        cursor: pointer;
        min-width: 80px;
    }
}

/* ========================================
   Mobile Coupon Field
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-coupon {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .hrb-mobile-coupon-label {
        font-size: 14px;
        font-weight: 500;
        color: var(--mobile-text-dark);
    }

    .hrb-mobile-coupon-input {
        width: 100%;
        padding: 14px 16px;
        border: 1px solid var(--mobile-border);
        border-radius: var(--mobile-radius-md);
        background: var(--mobile-bg);
        font-family: var(--hrb-font-body);
        font-size: 15px;
        font-weight: 500;
        color: var(--mobile-text-dark);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hrb-mobile-coupon-input::placeholder {
        color: var(--mobile-text-light);
        font-weight: 400;
    }

    .hrb-mobile-coupon-input:focus {
        outline: none;
        border-color: var(--mobile-blue);
        box-shadow: 0 0 0 3px rgba(11, 99, 206, 0.1);
    }
}

/* ========================================
   Mobile Search Button
   ======================================== */
@media (max-width: 768px) {
    .hrb-mobile-search-btn {
        width: 100%;
        height: 56px;
        border: none;
        border-radius: var(--mobile-radius-md);
        background: var(--mobile-blue);
        color: #FFFFFF;
        font-family: var(--hrb-font-body);
        font-size: 18px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--mobile-shadow-md);
        margin-top: 24px;
    }

    .hrb-mobile-search-btn:active {
        background: var(--mobile-blue-hover);
        transform: scale(0.98);
        box-shadow: var(--mobile-shadow-sm);
    }
}

/* ========================================
   Mobile Small Screens
   ======================================== */
@media (max-width: 480px) {
    .hrb-mobile-bar {
        height: 80px;
        padding: 0 16px;
        border-radius: 24px;
    }

    .hrb-mobile-field {
        padding: 12px;
        gap: 8px;
    }

    .hrb-mobile-icon {
        width: 20px;
        height: 20px;
    }

    .hrb-mobile-label {
        font-size: 11px;
    }

    .hrb-mobile-value {
        font-size: 14px;
    }

    .hrb-mobile-divider {
        height: 48px;
    }

    .hrb-mobile-sheet-title {
        font-size: 16px;
    }

    .hrb-mobile-calendar-day {
        height: 36px;
        font-size: 14px;
    }

    .hrb-mobile-calendar-day-name {
        height: 36px;
        font-size: 10px;
    }
}

/* ========================================
   Mobile Extra Small Screens
   ======================================== */
@media (max-width: 375px) {
    .hrb-mobile-bar {
        height: 72px;
        padding: 0 12px;
        border-radius: 20px;
    }

    .hrb-mobile-field {
        padding: 10px;
    }

    .hrb-mobile-value {
        font-size: 13px;
    }

    .hrb-mobile-calendar-day {
        height: 32px;
        font-size: 13px;
    }

    .hrb-mobile-calendar-day-name {
        height: 32px;
    }
}

/* ========================================
   Mobile Landscape
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .hrb-mobile-sheet {
        max-height: 90vh;
    }

    .hrb-mobile-calendar-day,
    .hrb-mobile-calendar-day-name {
        height: 36px;
    }
}

/* ========================================
   Mobile Accessibility
   ======================================== */
@media (max-width: 768px) {

    .hrb-mobile-field:focus-visible,
    .hrb-mobile-sheet-close:focus-visible,
    .hrb-mobile-btn-action:focus-visible,
    .hrb-mobile-calendar-nav:focus-visible,
    .hrb-mobile-counter-btn:focus-visible {
        outline: 2px solid var(--mobile-blue);
        outline-offset: 2px;
    }
}

/* ========================================
   Mobile No Scroll
   ======================================== */
@media (max-width: 768px) {
    body.hrb-mobile-no-scroll {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* ========================================
   Mobile Safe Area
   ======================================== */
@media (max-width: 768px) {
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .hrb-mobile-sheet-footer {
            padding-bottom: calc(16px + env(safe-area-inset-bottom));
        }
    }
}