/**
 * Modern Theme - Mobile Luxury Enhancements
 * Independent Mobile Layout with Premium Design
 * Version: 2.0.0
 */

/* ==========================================================================
   LUXURY TABLES - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    /* Table Container */
    .table-responsive {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        background: #fff;
        margin-bottom: 1.5rem;
    }
    
    /* Modern Table Styling */
    .table {
        margin-bottom: 0;
        background: #fff;
    }
    
    .table thead {
        background: linear-gradient(135deg, #2c2518 0%, #3d3324 100%);
        color: #fff;
    }
    
    .table thead th {
        padding: 1rem 0.75rem;
        font-weight: 600;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border: none;
    }
    
    .table tbody tr {
        border-bottom: 1px solid #f0f0f0;
        transition: background 0.2s;
    }
    
    .table tbody tr:hover {
        background: #fafbfc;
    }
    
    .table tbody tr:last-child {
        border-bottom: none;
    }
    
    .table tbody td {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
        vertical-align: middle;
        border: none;
    }
    
    /* Card-style table for mobile */
    .table-card-mobile {
        display: block;
        width: 100%;
    }
    
    .table-card-mobile thead {
        display: none;
    }
    
    .table-card-mobile tbody {
        display: block;
    }
    
    .table-card-mobile tr {
        display: block;
        margin-bottom: 1rem;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        background: #fff;
        border: 1px solid #e8e8e8;
    }
    
    .table-card-mobile td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid #f5f5f5;
    }
    
    .table-card-mobile td:last-child {
        border-bottom: none;
    }
    
    .table-card-mobile td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #2c2518;
        margin-right: 1rem;
        flex-shrink: 0;
    }
    
    /* Action buttons in tables */
    .table .btn-group {
        display: flex;
        gap: 0.5rem;
    }
    
    .table .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
}

/* ==========================================================================
   PROPERTY DETAIL PAGE - MOBILE SPECIFIC
   ========================================================================== */
@media (max-width: 767px) {
    /* Remove sticky behavior on contact sidebar */
    .pf-contact-card,
    .pf-detail-sidebar .sticky-top,
    .pf-detail-sidebar [class*="sticky"] {
        position: static !important;
        top: auto !important;
    }
    
    /* Property Detail Layout */
    .pf-detail-container {
        padding: 0 !important;
    }
    
    .pf-detail-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    
    /* Main Content First */
    .pf-detail-main {
        order: 1;
        padding: 1rem;
        background: #fff;
    }
    
    /* Sidebar After Main Content */
    .pf-detail-sidebar {
        order: 2;
        padding: 1rem;
        background: #fafbfc;
    }
    
    /* Gallery Mobile */
    .pf-gallery-container {
        margin: 0 -1rem 1rem;
        border-radius: 0;
    }
    
    .pf-gallery-main {
        height: 280px !important;
        border-radius: 0 !important;
    }
    
    .pf-gallery-thumbs {
        padding: 0.75rem 1rem;
        background: #fff;
    }
    
    /* Contact Card Mobile */
    .pf-contact-card {
        background: #fff;
        border-radius: 12px;
        padding: 1.25rem;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        margin-bottom: 1rem;
    }
    
    .pf-contact-avatar {
        width: 64px;
        height: 64px;
        margin-bottom: 1rem;
    }
    
    .pf-contact-name {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .pf-contact-role {
        font-size: 0.9rem;
        color: #666;
        margin-bottom: 1rem;
    }
    
    /* Contact Buttons Mobile */
    .pf-contact-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .pf-contact-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        padding: 1rem;
        border-radius: 12px;
        font-weight: 600;
        font-size: 1rem;
        text-decoration: none;
        transition: all 0.3s;
        min-height: 50px;
    }
    
    .pf-contact-btn-whatsapp {
        background: linear-gradient(135deg, #25d366 0%, #1ea952 100%);
        color: #fff;
        border: none;
    }
    
    .pf-contact-btn-whatsapp:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    }
    
    .pf-contact-btn-call {
        background: linear-gradient(135deg, #007aff 0%, #0051d5 100%);
        color: #fff;
        border: none;
    }
    
    .pf-contact-btn-call:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    }
    
    .pf-contact-btn-email {
        background: #fff;
        color: #2c2518;
        border: 2px solid #e0e0e0;
    }
    
    .pf-contact-btn-email:hover {
        border-color: #b7a56a;
        background: #fafaf8;
    }
    
    .pf-contact-btn-messenger {
        background: linear-gradient(135deg, #0084ff 0%, #0066cc 100%);
        color: #fff;
        border: none;
    }
    
    .pf-contact-btn-messenger:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 132, 255, 0.3);
    }
    
    /* Property Info Sections Mobile */
    .pf-info-section {
        background: #fff;
        border-radius: 12px;
        padding: 1.25rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    .pf-info-section-title {
        font-size: 1.15rem;
        font-weight: 700;
        color: #2c2518;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid #f0f0f0;
    }
    
    /* Specs Grid Mobile */
    .pf-specs-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .pf-spec-item {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .pf-spec-label {
        font-size: 0.85rem;
        color: #666;
        font-weight: 500;
    }
    
    .pf-spec-value {
        font-size: 1rem;
        color: #2c2518;
        font-weight: 600;
    }
    
    /* Amenities Mobile */
    .pf-amenities-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pf-amenity-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
        background: #fafafa;
        border-radius: 8px;
    }
    
    .pf-amenity-icon {
        width: 24px;
        height: 24px;
        color: #b7a56a;
    }
    
    .pf-amenity-label {
        font-size: 0.95rem;
        color: #2c2518;
    }
    
    /* Description Mobile */
    .pf-description {
        line-height: 1.6;
        font-size: 0.95rem;
        color: #444;
    }
    
    /* Price Display Mobile */
    .pf-price-main {
        font-size: 2rem;
        font-weight: 800;
        color: #2c2518;
        margin-bottom: 0.5rem;
    }
    
    .pf-price-label {
        font-size: 0.9rem;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

/* ==========================================================================
   ACCOUNT SIDEBAR - MOBILE LUXURY
   ========================================================================== */
@media (max-width: 767px) {
    /* Account Layout Mobile */
    .pf-account-container {
        padding: 0;
    }
    
    .pf-account-layout {
        display: flex;
        flex-direction: column;
    }
    
    /* Mobile Account Navigation */
    .pf-account-sidebar,
    aside {
        position: static;
        background: #fff;
        border-radius: 0;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    
    /* Collapsible Sections */
    aside .container > div {
        border-bottom: 1px solid #f0f0f0;
    }
    
    aside .container > div:last-child {
        border-bottom: none;
    }
    
    /* Section Headers */
    aside h5 {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        margin: 0;
        background: #f8f9fa;
        cursor: pointer;
        user-select: none;
        font-size: 1rem;
    }
    
    aside h5 a {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* List Group Items */
    aside .list-group {
        margin: 0;
    }
    
    aside .list-group-item {
        border: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 1rem 1.25rem;
        background: #fff;
    }
    
    aside .list-group-item:last-child {
        border-bottom: none;
    }
    
    aside .list-group-item.active {
        background: linear-gradient(90deg, rgba(183, 165, 106, 0.08) 0%, transparent 100%);
        border-left: 3px solid #b7a56a;
    }
    
    aside .list-group-item a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: #444;
        text-decoration: none;
        font-size: 0.95rem;
    }
    
    aside .list-group-item.active a {
        color: #2c2518;
        font-weight: 600;
    }
    
    aside .list-group-item a i {
        width: 20px;
        font-size: 1.1rem;
        color: #b7a56a;
        text-align: center;
    }
    
    /* Badges */
    aside .badge {
        padding: 0.35rem 0.75rem;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    /* Account Header Mobile (if exists) */
    .pf-account-header {
        background: linear-gradient(135deg, #2c2518 0%, #3d3324 100%);
        padding: 1.5rem 1rem;
        display: flex;
        align-items: center;
        gap: 1rem;
        color: #fff;
    }
    
    .pf-account-avatar {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        border: 3px solid rgba(183, 165, 106, 0.5);
        object-fit: cover;
    }
    
    .pf-account-info h2 {
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
        color: #fff;
    }
    
    .pf-account-info p {
        font-size: 0.9rem;
        opacity: 0.8;
        margin: 0;
    }
    
    /* Account Content Mobile */
    .pf-account-content {
        padding: 1rem;
        background: #fafbfc;
    }
    
    .pf-account-card {
        background: #fff;
        border-radius: 12px;
        padding: 1.25rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        margin-bottom: 1rem;
    }
    
    .pf-account-card-title {
        font-size: 1.2rem;
        font-weight: 700;
        color: #2c2518;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid #f0f0f0;
    }
    
    /* Stats Cards Mobile */
    .pf-stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .pf-stat-card {
        background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
        border: 1px solid #e8e8e8;
        border-radius: 12px;
        padding: 1rem;
        text-align: center;
    }
    
    .pf-stat-value {
        font-size: 1.75rem;
        font-weight: 800;
        color: #b7a56a;
        display: block;
        margin-bottom: 0.25rem;
    }
    
    .pf-stat-label {
        font-size: 0.85rem;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

/* ==========================================================================
   MENU ENHANCEMENTS - MOBILE
   ========================================================================== */
@media (max-width: 991px) {
    /* Modern Header Mobile */
    .modern-header {
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .header-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 0;
    }
    
    /* Logo Mobile */
    .header-logo .logo-desktop {
        display: none;
    }
    
    .header-logo .logo-mobile {
        display: block;
        max-height: 40px;
        width: auto;
    }
    
    /* Hide desktop navigation on mobile */
    .header-nav {
        display: none !important;
    }
    
    /* Mobile Menu Dropdown (Built-in from header) */
    .mobile-menu-dropdown {
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 10002;
    }
    
    .hamburger-line {
        display: block;
        width: 24px;
        height: 2px;
        background: #2c2518;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 2px;
    }
    
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    /* Mobile Dropdown Menu */
    .mobile-dropdown-menu {
        display: none;
        position: fixed;
        top: 64px;
        right: 0;
        width: 85%;
        max-width: 360px;
        max-height: calc(100vh - 64px);
        background: #fff;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        overflow-y: auto;
        z-index: 10000;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .mobile-dropdown-menu.active {
        display: block;
    }
    
    /* Mobile Dropdown Header */
    .mobile-dropdown-header {
        background: linear-gradient(135deg, #2c2518 0%, #3d3324 100%);
        padding: 1.5rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .mobile-user-avatar {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: 3px solid rgba(183, 165, 106, 0.5);
        object-fit: cover;
    }
    
    .mobile-user-avatar-placeholder {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: 3px solid rgba(183, 165, 106, 0.5);
        background: rgba(183, 165, 106, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-user-avatar-placeholder svg {
        color: #b7a56a;
    }
    
    .mobile-user-details {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .mobile-user-name {
        font-weight: 700;
        font-size: 1rem;
        color: #fff;
    }
    
    .mobile-user-email {
        font-size: 0.85rem;
        color: rgba(255,255,255,0.7);
    }
    
    .mobile-dropdown-divider {
        height: 1px;
        background: #f0f0f0;
        margin: 0;
    }
    
    /* Mobile Menu Items */
    .mobile-dropdown-menu > li > a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem 1.25rem;
        color: #444;
        text-decoration: none;
        border-bottom: 1px solid #f0f0f0;
        transition: all 0.2s;
        font-size: 0.95rem;
        min-height: 52px;
    }
    
    .mobile-dropdown-menu > li > a:hover {
        background: linear-gradient(90deg, rgba(183, 165, 106, 0.08) 0%, transparent 100%);
        color: #b7a56a;
    }
    
    .mobile-dropdown-menu > li > a i {
        width: 20px;
        font-size: 1.1rem;
        color: #b7a56a;
        text-align: center;
    }
    
    /* Auth Buttons Mobile (Not logged in) */
    .mobile-dropdown-menu .mobile-auth-item {
        padding: 1rem 1.25rem;
    }
    
    .mobile-dropdown-menu .mobile-auth-item .btn {
        width: 100%;
        padding: 1rem;
        border-radius: 12px;
        font-weight: 600;
        font-size: 1rem;
    }
    
    /* Overlay for mobile menu */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9999;
        backdrop-filter: blur(2px);
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }
    
    /* Hide desktop-only actions on mobile */
    .header-actions .desktop-only {
        display: none !important;
    }
    
    /* User Menu Mobile */
    .header-user-menu {
        padding: 1rem 0;
        border-top: 2px solid #f0f0f0;
        margin-top: 1rem;
    }
    
    .user-menu-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.85rem 1.5rem;
        color: #444;
        text-decoration: none;
        font-size: 0.95rem;
        transition: all 0.2s;
    }
    
    .user-menu-item i {
        width: 20px;
        font-size: 1.1rem;
        color: #b7a56a;
    }
    
    .user-menu-item:hover {
        background: rgba(183, 165, 106, 0.05);
        color: #b7a56a;
    }
}

/* ==========================================================================
   FORM IMPROVEMENTS - MOBILE
   ========================================================================== */
@media (max-width: 767px) {
    .form-luxury {
        background: #fff;
        border-radius: 12px;
        padding: 1.25rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    .form-group-luxury {
        margin-bottom: 1.25rem;
    }
    
    .form-label-luxury {
        font-weight: 600;
        font-size: 0.95rem;
        color: #2c2518;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .form-control-luxury {
        width: 100%;
        padding: 0.85rem 1rem;
        font-size: 16px; /* Prevent iOS zoom */
        border: 2px solid #e0e0e0;
        border-radius: 10px;
        background: #fff;
        transition: all 0.2s;
        min-height: 48px;
    }
    
    .form-control-luxury:focus {
        outline: none;
        border-color: #b7a56a;
        box-shadow: 0 0 0 3px rgba(183, 165, 106, 0.1);
    }
    
    .btn-luxury-primary {
        background: linear-gradient(135deg, #b7a56a 0%, #9a8952 100%);
        color: #fff;
        border: none;
        padding: 1rem 1.5rem;
        border-radius: 12px;
        font-weight: 600;
        font-size: 1rem;
        width: 100%;
        min-height: 52px;
        cursor: pointer;
        transition: all 0.3s;
    }
    
    .btn-luxury-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(183, 165, 106, 0.3);
    }
}

/* ==========================================================================
   LUXURY UTILITIES
   ========================================================================== */
@media (max-width: 767px) {
    .luxury-divider {
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, #e0e0e0 50%, transparent 100%);
        margin: 1.5rem 0;
    }
    
    .luxury-badge {
        display: inline-block;
        padding: 0.35rem 0.75rem;
        background: linear-gradient(135deg, #b7a56a 0%, #9a8952 100%);
        color: #fff;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .luxury-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        background: #f8f9fa;
        border: 1px solid #e0e0e0;
        border-radius: 20px;
        font-size: 0.9rem;
        color: #2c2518;
    }
}
