/**
 * PerfectFinish Reservations ? Responsive & PWA Styles v2 (CORRECT CLASSES)
 * ALINHADO com classes reais dos templates/JS.
 * Breakpoints: tablet (<=768px), mobile (<=480px), small (<=360px)
 *
 * @package PerfectFinish_Reservations
 * @version 2.0.1
 */

/* ============================================================
   TABLET ? ?768px
   ============================================================ */
@media (max-width: 768px) {
    body .pf-booking-header {
        padding: 30px 24px 0;
    }
    body .pf-booking-header h2 {
        font-size: 32px;
    }
    body .pf-booking-header p {
        font-size: 14px;
        margin-bottom: 24px;
    }

    body .pf-step {
        padding: 14px 8px;
        font-size: 12px;
        letter-spacing: 1px;
    }
    body .pf-step body .pf-step-label {
        display: none;
    }

    body .pf-form-step {
        padding: 24px 24px;
    }

    body .pf-form-step h3 {
        font-size: 22px;
    }

    body .pf-services-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body .pf-service-card {
        padding: 20px 16px;
    }
    body .pf-service-card body .pf-service-name {
        font-size: 18px;
    }

    body .pf-form-fields {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    body .pf-btn {
        padding: 14px 24px;
        font-size: 12px;
    }
    body .pf-form-navigation {
        flex-wrap: wrap;
        gap: 12px;
    }
    body .pf-form-navigation body .pf-btn {
        flex: 1;
    }

    body .pf-confirm-card {
        padding: 12px 16px;
    }
    body .pf-confirm-card p {
        font-size: 14px;
    }

    body .pf-slots-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    body .pf-calendar {
        padding: 16px;
    }

    body .pf-push-prompt {
        flex-direction: column;
        text-align: center;
        padding: 20px 24px;
    }

    body .pf-booking-success {
        padding: 40px 24px;
    }
    body .pf-booking-success h3 {
        font-size: 26px;
    }

    body .pf-booking-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 20px;
    }

    /* Services page */
    body .pf-services-page body .pf-services-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }

    /* Lead form */
    body .pf-lead-form-container {
        padding: 24px;
    }

    /* My Bookings */
    body .pf-my-bookings-wrapper h2 {
        font-size: 26px;
        padding: 24px 24px 0;
    }
    body .pf-email-prompt {
        padding: 0 24px 24px;
    }
    body .pf-bookings-list {
        padding: 0 24px 24px;
    }
    body .pf-email-form {
        flex-direction: column;
    }
    body .pf-btn-search {
        width: 100%;
    }
}

/* ============================================================
   MOBILE ? ?480px
   ============================================================ */
@media (max-width: 480px) {
    body .pf-booking-header {
        padding: 24px 16px 0;
    }
    body .pf-booking-header h2 {
        font-size: 26px;
    }
    body .pf-booking-header p {
        font-size: 13px;
        margin-bottom: 20px;
    }

    body .pf-step {
        font-size: 10px;
        padding: 12px 6px;
        letter-spacing: 0.5px;
    }
    body .pf-step-number {
        font-size: 9px;
    }

    body .pf-form-step {
        padding: 20px 16px;
    }

    body .pf-form-step h3 {
        font-size: 20px;
    }
    body .pf-step-subtitle {
        font-size: 14px;
    }

    body .pf-field input,
    body .pf-field select,
    body .pf-field textarea {
        padding: 12px 14px;
        font-size: 14px;
    }

    body .pf-services-grid {
        grid-template-columns: 1fr;
    }

    body .pf-service-card {
        padding: 16px 14px;
    }
    body .pf-service-icon {
        font-size: 28px;
    }
    body .pf-service-name {
        font-size: 16px;
    }
    body .pf-service-price {
        font-size: 18px;
    }

    body .pf-calendar {
        padding: 12px;
    }
    body .pf-calendar-day {
        padding: 6px 0;
        font-size: 12px;
        min-height: 32px;
    }
    body .pf-calendar-weekday {
        font-size: 9px;
    }
    body .pf-calendar-header body .pf-calendar-month-year {
        font-size: 18px;
    }

    body .pf-slots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    body .pf-slot-item {
        padding: 10px 6px;
        font-size: 12px;
    }

    body .pf-btn {
        padding: 12px 18px;
        font-size: 11px;
        letter-spacing: 1px;
    }
    body .pf-form-navigation {
        margin-top: 24px;
        padding-top: 16px;
        flex-direction: column;
        gap: 8px;
    }
    body .pf-form-navigation body .pf-btn {
        width: 100%;
        flex: none;
    }

    body .pf-booking-success {
        padding: 32px 16px;
    }
    body .pf-booking-success h3 {
        font-size: 22px;
    }
    body .pf-booking-success p {
        font-size: 14px;
    }
    body .pf-success-animation {
        width: 56px;
        height: 56px;
    }
    body .pf-success-animation svg {
        width: 24px;
        height: 24px;
    }

    body .pf-push-prompt {
        padding: 16px 20px;
    }
    body .pf-push-prompt p {
        font-size: 13px;
    }
    body .pf-push-prompt body .pf-btn {
        width: 100%;
    }

    body .pf-booking-item {
        padding: 16px;
    }
    body .pf-booking-item h4 {
        font-size: 16px;
    }

    body .pf-confirm-details {
        margin-bottom: 16px;
    }
    body .pf-confirm-card {
        padding: 10px 14px;
    }
    body .pf-confirm-card p {
        font-size: 14px;
    }

    body .pf-no-slots {
        padding: 24px 16px;
    }

    body .pf-lead-form-container {
        padding: 20px 16px;
    }
    body .pf-lead-form-title {
        font-size: 22px;
    }

    body .pf-services-page body .pf-services-grid {
        grid-template-columns: 1fr;
    }

    /* My Bookings */
    body .pf-my-bookings-wrapper h2 {
        font-size: 22px;
        padding: 20px 16px 0;
    }
    body .pf-email-prompt {
        padding: 0 16px 20px;
    }
    body .pf-bookings-list {
        padding: 0 16px 20px;
    }
    body .pf-email-form {
        max-width: 100%;
    }
    body .pf-booking-timeline {
        padding: 12px 16px;
        gap: 4px;
    }
    body .pf-timeline-step {
        font-size: 9px;
    }
}

/* ============================================================
   SMALL MOBILE ? ?360px
   ============================================================ */
@media (max-width: 360px) {
    body .pf-booking-header h2 {
        font-size: 22px;
    }

    body .pf-step {
        font-size: 9px;
        padding: 10px 4px;
    }

    body .pf-form-step h3 {
        font-size: 18px;
    }

    body .pf-calendar-day {
        font-size: 10px;
        min-height: 28px;
        padding: 4px 0;
    }
    body .pf-calendar-weekday {
        font-size: 8px;
    }

    body .pf-slots-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    body .pf-slot-item {
        padding: 8px 4px;
        font-size: 11px;
    }

    body .pf-btn {
        padding: 10px 14px;
        font-size: 10px;
    }
}

/* ============================================================
   PWA STANDALONE MODE
   ============================================================ */
@media all and (display-mode: standalone) {
    body .pf-booking-wrapper,
    body .pf-my-bookings-wrapper {
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }

    body .pf-booking-header {
        padding-top: calc(env(safe-area-inset-top, 0px) + 40px);
    }

    body .pf-form-navigation {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    }

    body .pf-booking-wrapper,
    body .pf-my-bookings-wrapper {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }

    body .pf-booking-wrapper input,
    body .pf-booking-wrapper textarea {
        -webkit-user-select: text;
        user-select: text;
    }

    body .pf-booking-wrapper,
    body .pf-my-bookings-wrapper {
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    body .pf-btn:hover {
        transform: none;
    }
    body .pf-btn:active {
        transform: scale(0.97);
    }

    body .pf-service-card:active,
    body .pf-slot-item:active,
    body .pf-calendar-day:active {
        transform: scale(0.98);
    }

    body .pf-service-card,
    body .pf-slot-item,
    body .pf-calendar-day {
        -webkit-tap-highlight-color: rgba(234, 10, 11, 0.15);
        touch-action: manipulation;
    }

    body .pf-push-prompt {
        margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    }
}

/* ============================================================
   LANDSCAPE MOBILE
   ============================================================ */
@media (max-width: 768px) and (orientation: landscape) {
    body .pf-services-grid {
        grid-template-columns: 1fr 1fr;
    }

    body .pf-slots-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    body .pf-form-fields {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
   HIGH DPI
   ============================================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body .pf-booking-wrapper,
    body .pf-lead-form-wrapper,
    body .pf-my-bookings-wrapper {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   DARK MODE
   ============================================================ */
@media (prefers-color-scheme: dark) {
    body .pf-booking-wrapper,
    body .pf-lead-form-wrapper,
    body .pf-my-bookings-wrapper {
        color-scheme: dark;
    }
}
