/**
 * Piana Hotel Booking - Responsive Styles
 * Company: Piana It Solutions
 */

/* ========================================
   TABLET STYLES (768px - 1024px)
   ======================================== */
@media screen and (max-width: 1024px) {
    /* Room Grid */
    .phb-grid-col-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Room Single */
    .phb-room-gallery {
        height: 400px;
    }

    .phb-single-title {
        font-size: 28px;
    }

    .phb-amenities-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    /* Booking Form */
    .phb-booking-form-container {
        padding: 30px;
    }

    .phb-form-title {
        font-size: 28px;
    }

    /* Calendar */
    .phb-availability-calendar {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* ========================================
   TABLET PORTRAIT & LARGE PHONES (max-width: 768px)
   ======================================== */
@media screen and (max-width: 768px) {
    /* Room Grid */
    .phb-grid-col-3,
    .phb-grid-col-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .phb-room-card-content {
        padding: 20px;
    }

    .phb-room-title {
        font-size: 18px;
    }

    .phb-price-value {
        font-size: 22px;
    }

    /* Room Single */
    .phb-room-gallery {
        height: 300px;
    }

    .phb-single-title {
        font-size: 24px;
    }

    .phb-room-specs,
    .phb-room-amenities-full,
    .phb-price-box,
    .phb-booking-widget-form {
        padding: 20px;
    }

    .phb-specs-list {
        grid-template-columns: 1fr;
    }

    /* Booking Form */
    .phb-form-row {
        flex-direction: column;
        gap: 15px;
    }

    .phb-form-group.half,
    .phb-half {
        flex: 1 1 100%;
    }

    .phb-booking-form-container {
        padding: 25px;
    }

    .phb-form-title {
        font-size: 24px;
    }

    /* Calendar */
    .phb-availability-calendar {
        grid-template-columns: 1fr;
    }

    /* Features */
    .phb-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   MOBILE STYLES (max-width: 480px)
   ======================================== */
@media screen and (max-width: 480px) {
    /* Room Grid */
    .phb-grid-col-2,
    .phb-grid-col-3,
    .phb-grid-col-4 {
        grid-template-columns: 1fr;
    }

    .phb-room-grid {
        gap: 20px;
    }

    .phb-room-card-content {
        padding: 15px;
    }

    .phb-room-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .phb-room-excerpt {
        font-size: 14px;
    }

    .phb-room-amenities {
        gap: 8px;
    }

    .phb-amenity-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .phb-room-price {
        flex-wrap: wrap;
    }

    .phb-price-value {
        font-size: 20px;
    }

    .phb-book-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Room Single */
    .phb-room-gallery {
        height: 250px;
        border-radius: 0;
    }

    .phb-room-single-content {
        padding: 0 15px;
    }

    .phb-single-title {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .phb-room-content {
        font-size: 15px;
    }

    .phb-room-specs,
    .phb-room-amenities-full,
    .phb-price-box,
    .phb-booking-widget-form {
        padding: 15px;
        margin-bottom: 20px;
    }

    .phb-room-specs h3,
    .phb-room-amenities-full h3,
    .phb-price-box h3 {
        font-size: 18px;
    }

    .phb-amenities-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .phb-amenity-item {
        padding: 8px 0;
    }

    .phb-price-row {
        flex-direction: column;
        gap: 5px;
    }

    /* Booking Form */
    .phb-booking-form-container {
        padding: 20px 15px;
        border-radius: 0;
    }

    .phb-form-title {
        font-size: 22px;
    }

    .phb-form-subtitle {
        font-size: 14px;
    }

    .phb-form-input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .phb-submit-btn {
        padding: 14px 20px;
        font-size: 16px;
    }

    .phb-booking-summary,
    .phb-payment-section {
        padding: 15px;
    }

    /* Calendar */
    .phb-calendar-month {
        border-radius: 0;
    }

    .phb-calendar-header {
        font-size: 16px;
        padding: 12px;
    }

    .phb-calendar-day {
        padding: 8px;
        font-size: 14px;
    }

    .phb-calendar-legend {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    /* Features */
    .phb-features-grid {
        grid-template-columns: 1fr;
    }

    .phb-features-title {
        font-size: 20px;
    }

    .phb-feature-item {
        padding: 10px 12px;
    }

    .phb-feature-label {
        font-size: 14px;
    }

    /* Mini Booking Form */
    .phb-mini-booking-form .phb-form-row {
        flex-direction: column;
    }

/* ========================================
   MODERN BOOKING FORM - MOBILE
   ======================================== */
@media screen and (max-width: 768px) {
    /* Modern Booking Form Container */
    .phb-modern-form {
        padding: 15px;
    }
    
    /* 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;
    }
    
    .phb-room-card-modern {
        padding: 12px;
    }
    
    .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: 16px;
    }
    
    /* 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: 24px;
    }
    
    /* Pay Button */
    .phb-pay-btn {
        padding: 16px 20px;
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    /* Modern Booking Form */
    .phb-modern-form {
        padding: 10px;
    }
    
    /* Room Grid - Single Column */
    .phb-room-grid-modern {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .phb-room-card-modern {
        padding: 10px;
        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;
    }
    
    /* Price Summary */
    .phb-price-summary-modern {
        padding: 12px;
        margin-top: 15px;
    }
    
    .phb-price-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .phb-price-total-modern {
        font-size: 22px;
    }
    
    /* Price Breakdown */
    .phb-price-breakdown {
        font-size: 13px;
    }
    
    .phb-price-item {
        flex-direction: column;
        gap: 4px;
    }
    
    /* Success Message */
    .phb-success-message {
        padding: 20px;
    }
    
    .phb-success-message h3 {
        font-size: 20px;
    }
    
    /* Warning Messages */
    .phb-warning-message,
    .phb-error-message {
        padding: 12px;
        font-size: 13px;
    }
}

@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;
    }
}

    .phb-confirmation-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

/* ========================================
   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;
    }
    
    /* Calendar Grid */
    .phb-calendar-grid {
        gap: 4px;
    }
    
    .phb-calendar-day-cell {
        min-height: 44px;
        padding: 6px;
        font-size: 14px;
    }
    
    .phb-calendar-day-name {
        font-size: 12px;
        padding: 8px 4px;
    }
    
    /* 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;
    }
    
    .phb-calendar-header-modern {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .phb-calendar-nav {
        width: 100%;
        justify-content: space-between;
    }
    
    .phb-calendar-grid {
        gap: 2px;
    }
    
    .phb-calendar-day-cell {
        min-height: 40px;
        padding: 4px;
        font-size: 13px;
    }
    
    .phb-calendar-day-name {
        font-size: 11px;
        padding: 6px 2px;
    }
    
    /* 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;
    }
}

    .phb-detail-row {
        flex-direction: column;
        gap: 5px;
    }

    .phb-back-btn {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   SMALL MOBILE (max-width: 360px)
   ======================================== */
@media screen and (max-width: 360px) {
    .phb-room-title {
        font-size: 16px;
    }

    .phb-price-value {
        font-size: 18px;
    }

    .phb-single-title {
        font-size: 20px;
    }

    .phb-form-title {
        font-size: 20px;
    }

    .phb-calendar-day {
        padding: 6px;
        font-size: 13px;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION SPECIFIC
   ======================================== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .phb-room-gallery {
        height: 200px;
    }

    .phb-booking-form-container {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ========================================
   HIGH RESOLUTION / RETINA DISPLAYS
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .phb-room-image img,
    .phb-room-gallery img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .phb-book-btn,
    .phb-submit-btn,
    .phb-booking-widget-form {
        display: none !important;
    }

    .phb-room-card,
    .phb-booking-form-container {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}
