/* ========================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ======================================== */

/* ========================================
   MODERN BOOKING FORM - MOBILE
   ======================================== */
@media screen and (max-width: 768px) {
    /* Modern Booking Form Container */
    .phb-modern-form {
        padding: 20px 15px !important;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Tab Navigation */
    .phb-form-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .phb-tab-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    /* Room Counter */
    .phb-room-counter {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .phb-counter-controls {
        width: 100%;
        justify-content: center;
    }
    
    .phb-counter-btn {
        width: 44px;
        height: 44px;
    }
    
    .phb-counter-value {
        min-width: 60px;
        font-size: 20px;
    }
    
    /* Guest Selector */
    .phb-guest-selector {
        width: 100%;
    }
    
    .phb-guest-dropdown-btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    
    /* Room Grid */
    .phb-room-grid-modern {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        width: 100%;
    }
    
    .phb-room-card-modern {
        padding: 12px;
        min-width: 0;
    }
    
    .phb-room-card-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .phb-room-checkbox-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    
    .phb-room-price-modern {
        font-size: 14px;
    }
    
    .phb-room-name-modern {
        font-size: 13px;
    }
    
    /* Date Pickers */
    .phb-date-pickers {
        flex-direction: column;
        gap: 15px;
    }
    
    .phb-date-picker {
        width: 100%;
    }
    
    /* Price Summary */
    .phb-price-summary-modern {
        padding: 15px;
    }
    
    .phb-price-total-modern {
        font-size: 20px;
    }
    
    /* Pay Button */
    .phb-pay-btn {
        padding: 16px 20px;
        font-size: 14px;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .phb-room-cards-grid{
        grid-template-columns: repeat(1,1fr) !important;
    }
    .phb-submit-modern{
        padding: 20px !important;
    }
    .phb-calendar-popup{
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

@media screen and (max-width: 480px) {
    /* Modern Booking Form */
    .phb-modern-form {
        padding: 15px 10px !important;
    }
    
    /* Room Grid - Single Column */
    .phb-room-grid-modern {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .phb-room-card-modern {
        padding: 12px;
        border-radius: 8px;
    }
    
    .phb-room-checkbox-wrapper {
        width: 100%;
    }
    
    .phb-room-name-modern {
        font-size: 14px;
    }
    
    .phb-room-type-modern {
        font-size: 11px;
    }
    
    .phb-room-capacity-modern {
        font-size: 12px;
    }
    
    .phb-room-price-modern {
        font-size: 14px;
    }
    
    /* Price Summary */
    .phb-price-summary-modern {
        padding: 12px;
        margin-top: 15px;
    }
    
    .phb-price-header {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .phb-price-total-modern {
        font-size: 18px;
    }
    
    /* Price Breakdown */
    .phb-price-breakdown {
        font-size: 13px;
    }
    
    .phb-price-item {
        flex-direction: row;
        gap: 8px;
    }
    
    /* Success Message */
    .phb-success-message {
        padding: 20px 15px;
    }
    
    .phb-success-message h3 {
        font-size: 18px;
    }
    
    /* Warning Messages */
    .phb-warning-message,
    .phb-error-message {
        padding: 12px;
        font-size: 13px;
    }
    
    /* Pay Button */
    .phb-pay-btn {
        padding: 14px 16px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }
}

@media screen and (max-width: 360px) {
    .phb-room-grid-modern {
        gap: 8px;
    }
    
    .phb-room-card-modern {
        padding: 8px;
    }
    
    .phb-counter-btn {
        width: 40px;
        height: 40px;
    }
    
    .phb-counter-value {
        font-size: 18px;
        min-width: 50px;
    }
    
    .phb-price-total-modern {
        font-size: 20px;
    }
}

/* ========================================
   CALENDAR PICKER - MOBILE
   ======================================== */
@media screen and (max-width: 768px) {
    /* Calendar Popup/Modal */
    .phb-calendar-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        z-index: 10000;
    }
    
    .phb-calendar-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 15px;
    }
    
    .phb-calendar-header-modern {
        padding: 15px;
    }
    
    .phb-calendar-title {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Calendar Grid */
    .phb-calendar-grid {
        gap: 4px;
    }
    
    .phb-calendar-day-cell {
        min-height: 44px;
        padding: 6px 2px;
        font-size: 14px;
    }
    
    .phb-calendar-day-name {
        font-size: 12px;
        padding: 8px 2px;
    }
    
    /* Weekday Info */
    .phb-weekday-info {
        font-size: 13px;
        padding: 10px;
    }
}

@media screen and (max-width: 480px) {
    /* Calendar in Modal */
    .phb-calendar-modal-content {
        padding: 10px 8px;
    }
    
    .phb-calendar-header-modern {
        flex-direction: row;
        gap: 10px;
        padding: 12px 8px;
        justify-content: space-between;
    }
    
    .phb-calendar-nav {
        width: auto;
        justify-content: center;
    }
    
    .phb-calendar-title {
        font-size: 16px;
        min-width: 120px;
        text-align: center;
    }
    
    .phb-calendar-grid {
        gap: 2px;
    }
    
    .phb-calendar-day-cell {
        min-height: 40px;
        padding: 4px 1px;
        font-size: 13px;
    }
    
    .phb-calendar-day-name {
        font-size: 10px;
        padding: 6px 1px;
    }
    
    /* Availability Indicators */
    .phb-calendar-day-cell.limited::after,
    .phb-calendar-day-cell.full::after {
        width: 4px;
        height: 4px;
        bottom: 2px;
    }
}

@media screen and (max-width: 360px) {
    .phb-calendar-day-cell {
        min-height: 36px;
        padding: 3px;
        font-size: 12px;
    }
    
    .phb-calendar-day-name {
        font-size: 10px;
    }
}

/* ========================================
   POPUPS & MODALS - MOBILE
   ======================================== */
@media screen and (max-width: 768px) {
    /* Generic Modal/Popup */
    .phb-modal-overlay {
        padding: 15px;
    }
    
    .phb-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .phb-modal-header {
        padding: 15px 20px;
    }
    
    .phb-modal-header h3 {
        font-size: 18px;
    }
    
    .phb-modal-body {
        padding: 20px;
    }
    
    .phb-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .phb-modal-footer .phb-btn {
        width: 100%;
    }
    
    /* Guest Dropdown */
    .phb-guest-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 70vh;
        animation: slideUp 0.3s ease;
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    .phb-guest-dropdown-header {
        padding: 15px;
    }
    
    .phb-guest-type-row {
        padding: 12px 15px;
    }
    
    .phb-guest-type-label {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .phb-modal-overlay {
        padding: 10px;
    }
    
    .phb-modal-content {
        border-radius: 10px;
    }
    
    .phb-modal-header {
        padding: 12px 15px;
    }
    
    .phb-modal-header h3 {
        font-size: 16px;
    }
    
    .phb-modal-body {
        padding: 15px;
    }
    
    .phb-modal-footer {
        padding: 12px 15px;
    }
    
    /* Close Button */
    .phb-modal-close {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ========================================
   FORM INPUTS & CONTROLS - MOBILE
   ======================================== */
@media screen and (max-width: 768px) {
    .phb-form-input,
    .phb-form-select,
    .phb-form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        min-height: 44px;
    }
    
    .phb-form-label {
        font-size: 14px;
    }
    
    .phb-checkbox-label {
        font-size: 14px;
    }
    
    .phb-btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    .phb-form-input,
    .phb-form-select,
    .phb-form-textarea {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .phb-form-group {
        margin-bottom: 15px;
    }
    
    .phb-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .phb-btn-large {
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* ========================================
   DATE PICKER INPUT - MOBILE
   ======================================== */
@media screen and (max-width: 768px) {
    .phb-date-picker-input {
        padding: 12px;
        font-size: 16px;
    }
    
    .phb-date-picker-icon {
        width: 20px;
        height: 20px;
    }
    
    .phb-date-display {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .phb-date-picker {
        width: 100%;
    }
    
    .phb-date-picker-input {
        padding: 10px 12px;
    }
    
    .phb-date-label {
        font-size: 12px;
    }
}

/* ========================================
   MOBILE OVERRIDES - AGGRESSIVE FIXES
   ======================================== */

/* Force single column room cards on all mobile */
@media screen and (max-width: 768px) {
    .phb-room-grid-modern,
    .phb-room-grid,
    #phb-booking-form .phb-room-grid-modern {
        grid-template-columns: 1fr !important;
        display: grid !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .phb-room-card-modern,
    .phb-room-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }
    
    /* Calendar title fix */
    .phb-calendar-title,
    .phb-calendar-header-modern h3,
    .phb-calendar-header h3 {
        font-size: 16px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 150px !important;
        text-align: center !important;
    }
    
    /* Pay button fix */
    .phb-pay-btn,
    .phb-submit-btn,
    button[type="submit"].phb-pay-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        font-size: 14px !important;
        padding: 14px 16px !important;
        white-space: normal !important;
        line-height: 1.3 !important;
    }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
    .phb-calendar-title,
    .phb-calendar-header-modern h3,
    .phb-calendar-header h3 {
        font-size: 14px !important;
        max-width: 120px !important;
    }
    
    .phb-calendar-header-modern,
    .phb-calendar-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .phb-calendar-nav {
        width: auto !important;
    }
}

/* Tiny screens */
@media screen and (max-width: 360px) {
    .phb-calendar-title,
    .phb-calendar-header-modern h3,
    .phb-calendar-header h3 {
        font-size: 13px !important;
        max-width: 100px !important;
    }
    
    .phb-pay-btn {
        font-size: 13px !important;
        padding: 12px !important;
    }
}
@media screen and (max-width: 768px) {
    /* Ensure Razorpay popup is properly sized on mobile */
    .razorpay-container {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .razorpay-checkout-frame {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media screen and (max-width: 480px) {
    .razorpay-container {
        padding: 10px !important;
    }
    
    .razorpay-checkout-frame {
        border-radius: 8px !important;
    }
}
