/**
 * Modern Theme - Mobile & Tablet Responsive Styles
 * Premium Luxury Design for all devices
 * Version: 1.0.0
 */

/* ==========================================================================
   VARIABLES & BASE
   ========================================================================== */
:root {
    --mobile-padding: 1rem;
    --tablet-padding: 1.5rem;
    --card-gap-mobile: 1rem;
    --card-gap-tablet: 1.25rem;
    --touch-target-min: 44px;
}

/* ==========================================================================
   MOBILE FIRST - BASE STYLES (320px+)
   ========================================================================== */

/* Typography - Mobile Optimized */
@media (max-width: 767px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    h4 {
        font-size: 1.1rem !important;
    }
}

/* Container Mobile */
@media (max-width: 767px) {
    .container {
        padding-left: var(--mobile-padding);
        padding-right: var(--mobile-padding);
    }
}

/* ==========================================================================
   HERO SECTION - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .pf-hero {
        min-height: 480px !important;
    }
    
    .pf-hero-inner {
        padding: 3rem 0 !important;
    }
    
    .pf-hero-text h1 {
        font-size: 1.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .pf-hero-text p {
        font-size: 0.95rem !important;
        line-height: 1.5;
    }
    
    /* Search Bar Mobile */
    .pf-hero-search {
        margin-top: 1.5rem !important;
        padding: 0.75rem !important;
        border-radius: 12px !important;
        background: rgba(255,255,255,.65) !important;
        border: 1px solid rgba(255,255,255,.48) !important;
        box-shadow: 0 12px 24px rgba(16,24,40,.14) !important;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    
    .search-bar {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .search-field {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .search-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 1rem !important;
        min-height: var(--touch-target-min);
    }
    
    /* Transaction Type Buttons Mobile */
    .radio-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }
    
    .radio-label {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Search Filters Mobile */
    .pf-advanced-filters {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }
}

/* ==========================================================================
   PROPERTY CARDS - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    /* Grid Layout Mobile */
    .pf-yachts-grid,
    .pf-jets-grid,
    .pf-cars-grid,
    .pf-project-grid,
    .pf-properties-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    
    /* Property Card */
    .pf-yacht-card,
    .pf-jet-card,
    .pf-car-card,
    .pf-project-card,
    .pf-property-card {
        border-radius: 12px !important;
    }
    
    .pf-yacht-media,
    .pf-jet-media,
    .pf-car-media,
    .pf-project-media,
    .pf-property-media {
        height: 220px !important;
        border-radius: 12px 12px 0 0 !important;
    }
    
    /* Card Body */
    .pf-yacht-body,
    .pf-jet-body,
    .pf-car-body,
    .pf-project-body,
    .pf-property-body {
        padding: 1rem !important;
    }
    
    /* Card Title */
    .pf-yacht-card h3,
    .pf-jet-card h3,
    .pf-car-card h3,
    .pf-project-card h3,
    .pf-property-card h3 {
        font-size: 1.1rem !important;
        line-height: 1.3;
    }
    
    /* Card Details Grid */
    .pf-yacht-details,
    .pf-jet-details,
    .pf-car-details,
    .pf-project-details,
    .pf-property-details {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
    }
    
    .pf-detail {
        font-size: 0.85rem !important;
    }
    
    .pf-detail svg {
        width: 16px !important;
        height: 16px !important;
    }
    
    /* Price Display */
    .pf-price-value {
        font-size: 1.25rem !important;
    }
    
    /* WhatsApp Button */
    .pf-whatsapp {
        padding: 0.85rem 1rem !important;
        font-size: 0.95rem !important;
    }
}

/* ==========================================================================
   RENT/SALE TABS - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .pf-tabs {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    .pf-tab {
        flex: 1 1 calc(50% - 0.25rem) !important;
        padding: 0.85rem 1rem !important;
        font-size: 0.95rem !important;
        text-align: center;
    }
}

/* ==========================================================================
   HEADER & NAVIGATION - MOBILE
   ========================================================================== */
@media (max-width: 991px) {
    /* Header */
    .pf-header {
        padding: 0.75rem 0 !important;
    }
    
    .pf-header-content {
        flex-wrap: wrap !important;
    }
    
    /* Logo */
    .pf-logo img {
        height: 32px !important;
    }
    
    /* Mobile Menu */
    .pf-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999;
        overflow-y: auto;
        padding: 1.5rem 0;
    }
    
    .pf-nav.active {
        right: 0;
    }
    
    .pf-nav-list {
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .pf-nav-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .pf-nav-link {
        padding: 1rem 1.5rem !important;
        display: block !important;
        min-height: var(--touch-target-min);
    }
    
    /* Hamburger Menu */
    .pf-mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: transparent;
        cursor: pointer;
        z-index: 10000;
    }
    
    .pf-hamburger {
        display: block;
        width: 24px;
        height: 2px;
        background: #2c2518;
        position: relative;
        transition: all 0.3s;
    }
    
    .pf-hamburger::before,
    .pf-hamburger::after {
        content: '';
        position: absolute;
        width: 24px;
        height: 2px;
        background: #2c2518;
        transition: all 0.3s;
    }
    
    .pf-hamburger::before {
        top: -8px;
    }
    
    .pf-hamburger::after {
        bottom: -8px;
    }
    
    .pf-mobile-toggle.active .pf-hamburger {
        background: transparent;
    }
    
    .pf-mobile-toggle.active .pf-hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }
    
    .pf-mobile-toggle.active .pf-hamburger::after {
        transform: rotate(-45deg);
        bottom: 0;
    }
    
    /* Mobile Overlay */
    .pf-nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        backdrop-filter: blur(2px);
    }
    
    .pf-nav-overlay.active {
        display: block;
    }
}

/* ==========================================================================
   FOOTER - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .pf-footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .pf-footer-section {
        text-align: center;
    }
    
    .pf-footer-links {
        align-items: center;
    }
    
    .pf-footer-bottom {
        flex-direction: column !important;
        text-align: center;
        gap: 1rem !important;
    }
}

/* ==========================================================================
   SECTIONS - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .section-padding {
        padding: 2.5rem 0 !important;
    }
    
    .pf-section-header {
        margin-bottom: 1.5rem !important;
    }
    
    .pf-section-title {
        font-size: 1.5rem !important;
    }
    
    .pf-section-subtitle {
        font-size: 0.95rem !important;
    }
}

/* ==========================================================================
   PROPERTY DETAIL PAGE - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    /* Gallery */
    .pf-gallery-main {
        height: 300px !important;
        border-radius: 12px !important;
    }
    
    .pf-gallery-thumbs {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    /* Property Info */
    .pf-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .pf-detail-main {
        order: 1;
    }
    
    .pf-detail-sidebar {
        order: 2;
    }
    
    /* Specifications Grid */
    .pf-specs-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }
    
    /* Contact Card */
    .pf-contact-card {
        position: static !important;
        margin-top: 1rem;
    }
    
    /* Amenities */
    .pf-amenities-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
}

/* ==========================================================================
   LISTINGS PAGE - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    /* Filters Sidebar */
    .pf-filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        background: #fff;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999;
        overflow-y: auto;
        padding: 1.5rem;
    }
    
    .pf-filters-sidebar.active {
        left: 0;
    }
    
    /* Filters Toggle Button */
    .pf-filters-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #b7a56a, #2c2518);
        color: #fff;
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    
    /* Results Header */
    .pf-results-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    .pf-results-count {
        font-size: 0.95rem !important;
    }
    
    .pf-sort-select {
        width: 100% !important;
    }
}

/* ==========================================================================
   FORMS - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 16px !important; /* Prevent iOS zoom */
        padding: 0.85rem 1rem !important;
        min-height: var(--touch-target-min);
    }
    
    .form-label {
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .btn {
        padding: 0.85rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: var(--touch-target-min);
    }
    
    .btn-block {
        width: 100% !important;
    }
}

/* ==========================================================================
   MODALS - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    .modal-content {
        border-radius: 12px !important;
    }
    
    .modal-header {
        padding: 1rem 1.25rem !important;
    }
    
    .modal-body {
        padding: 1.25rem !important;
    }
    
    .modal-footer {
        padding: 1rem 1.25rem !important;
        flex-direction: column-reverse !important;
        gap: 0.75rem !important;
    }
    
    .modal-footer .btn {
        width: 100% !important;
    }
}

/* ==========================================================================
   ACCOUNT PAGES - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .pf-account-layout {
        grid-template-columns: 1fr !important;
    }
    
    .pf-account-sidebar {
        position: static !important;
        margin-bottom: 1.5rem;
    }
    
    .pf-account-nav {
        flex-direction: column !important;
    }
    
    .pf-account-nav-item {
        width: 100% !important;
        text-align: left !important;
        padding: 1rem !important;
    }
}

/* ==========================================================================
   TABLET STYLES (768px - 1024px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Container Tablet */
    .container {
        padding-left: var(--tablet-padding);
        padding-right: var(--tablet-padding);
    }
    
    /* Grid Layouts - 2 columns */
    .pf-yachts-grid,
    .pf-jets-grid,
    .pf-cars-grid,
    .pf-project-grid,
    .pf-properties-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--card-gap-tablet) !important;
    }
    
    /* Search Bar Tablet */
    .search-bar {
        flex-wrap: wrap !important;
    }
    
    .search-field {
        min-width: calc(50% - 0.5rem) !important;
    }
    
    .search-btn {
        width: 100% !important;
        margin-top: 0.5rem;
    }
    
    /* Hero Text */
    .pf-hero-text h1 {
        font-size: 2.25rem !important;
    }
    
    /* Navigation */
    .pf-nav-list {
        gap: 1rem !important;
    }
}

/* ==========================================================================
   UTILITIES - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .text-mobile-center {
        text-align: center !important;
    }
    
    .w-mobile-full {
        width: 100% !important;
    }
    
    /* Spacing Utilities */
    .mb-mobile-1 { margin-bottom: 0.5rem !important; }
    .mb-mobile-2 { margin-bottom: 1rem !important; }
    .mb-mobile-3 { margin-bottom: 1.5rem !important; }
    
    .mt-mobile-1 { margin-top: 0.5rem !important; }
    .mt-mobile-2 { margin-top: 1rem !important; }
    .mt-mobile-3 { margin-top: 1.5rem !important; }
    
    .p-mobile-1 { padding: 0.5rem !important; }
    .p-mobile-2 { padding: 1rem !important; }
    .p-mobile-3 { padding: 1.5rem !important; }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* Reduce animations on mobile for better performance */
@media (max-width: 767px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .pf-card-link,
    .pf-button,
    .pf-nav-link {
        transition-duration: 0.2s !important;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    a, button, .pf-clickable {
        min-height: var(--touch-target-min);
        min-width: var(--touch-target-min);
    }
}
