/* ========================================
   RESPONSIVE DESIGN - CONSOLIDATED
   ======================================== */


/* --- 1. BASE LAYOUT & HEADER (Mobile & Tablet) --- */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    .site-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
        padding: 15px;
    }

    .logo-img {
        max-width: 140px;
        height: auto;
    }

    .header-seo-text {
        width: 100%;
        text-align: center;
    }

    /* Force 2-columns on tablet/mobile by default for strict control */
    .models-grid,
    .grid-4-col,
    .grid-5-col {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        position: relative;
    }

    .sidebar {
        /* Mobile: Hidden by default, toggleable */
        display: none;
        width: 100%;
        position: fixed;
        /* Fixed overlay style or just static block */
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 9999;
        overflow-y: auto;
        padding-top: 60px;
        /* Space for close button */
        background: #000;
    }

    .sidebar.active {
        display: block;
    }

    /* Close button for sidebar Mobile */
    .sidebar-close-btn {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        font-size: 2rem;
        color: #fff;
        background: none;
        border: none;
        cursor: pointer;
    }

    /* Standardizes font sizes */
    html {
        font-size: 14px;
    }
}

/* --- 2. STANDARDIZED MODEL CARDS (Distintas.net Style) --- */
/* Applied globally to ensure consistency, but critical on mobile */

.model-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: none !important;
    /* Clean look */
    background: transparent !important;
}

.card-img-wrapper {
    aspect-ratio: 9/16 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 280px !important;
    position: relative;
    overflow: hidden;
    background: transparent !important;
}

.card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.5s ease;
}

.model-card:hover .card-img {
    transform: scale(1.05);
}

/* Overlay Info Style */
.card-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* CLEAN PHOTOS: Transparent background override */
    background: transparent !important;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    min-height: 40%;
    pointer-events: none;
    /* Let clicks pass through to card */
}

.model-name {
    font-size: 1.2rem !important;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    /* CLEAN PHOTOS: No text shadow */
    text-shadow: none !important;
    margin-bottom: 2px;
}

.model-location-overlay {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #ffd700;
    /* Gold */
    font-size: 0.85rem !important;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Hide original badges if they clash, or style them */
.card-badges-right {
    top: 5px;
    right: 5px;
}

/* Removed mobile override for badge-available */


/* --- 3. PROFILE DETAIL & GALERY (Mobile Fixes) --- */

@media (max-width: 1024px) {

    /* Full screen modal on mobile */
    .modal-content {
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .profile-scroll-container {
        flex-grow: 1;
        overflow-y: auto;
    }

    .profile-top-section {
        flex-direction: column !important;
        text-align: center;
        gap: 20px;
        align-items: center;
    }

    .profile-avatar-large {
        width: 160px !important;
        height: 160px !important;
        border: 3px solid #D4AF37;
    }

    .profile-main-info {
        width: 100%;
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    /* Gallery Grid: Force 3 columns tight */
    .gallery-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
    }

    .gallery-img {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 1/1 !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }
}


/* --- 4. LIGHTBOX FIXES (Full Screen & Arrows) --- */

.rf-overlay {
    background: #000 !important;
    /* Solid black or very dark for gallery */
    z-index: 20000 !important;
}

.rf-lightbox-img {
    max-width: 100% !important;
    max-height: 80vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    /* Fit whole image */
    box-shadow: none !important;
    border: none !important;
}

/* Lightbox Navigation - Clean & Mobile Friendly */
#lightbox button {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(4px);
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#lightbox button svg {
    width: 24px !important;
    height: 24px !important;
    stroke: white;
}

#lightbox button:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.2) !important;
}

#lightbox button[style*="left:"] {
    left: 10px !important;
}

#lightbox button[style*="right:"] {
    right: 10px !important;
}

#lightbox button[style*="top:"] {
    top: 15px !important;
    right: 15px !important;
}


/* --- 5. ADMIN PANEL FIXES (Table Scroll) --- */

@media (max-width: 1024px) {
    .profiles-table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
        background: #111;
        border-radius: 8px;
    }

    .profiles-table table {
        min-width: 800px;
        /* Ensure table has width to scroll */
        width: 100%;
        border-collapse: collapse;
    }

    .profiles-table th,
    .profiles-table td {
        white-space: nowrap;
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}


/* --- MOBILE MENU FIX --- */
/* Ensure the top navigation bar allows wrapping so the menu button survives */
@media (max-width: 768px) {
    .main-nav-container {
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: center !important;
        padding: 10px !important;
    }

    /* Left group (Search + City) - Allow to split if needed */
    .nav-left-group {
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        margin-bottom: 5px !important;
    }

    /* Search Box */
    .search-box-wrapper {
        flex: 1 1 auto !important;
        min-width: 150px !important;
        max-width: 100% !important;
    }

    /* City Dropdown - Mobile */
    .custom-dropdown {
        flex: 1 1 auto !important;
        min-width: 160px !important;
        width: auto !important;
    }

    .dropdown-selected {
        min-width: 0 !important;
        width: 100% !important;
        justify-content: space-between !important;
    }

    /* Menu container */
    .dropdown {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin-top: 5px !important;
    }
}

/* --- PC & General Overrides --- */

/* Scrollable Dropdown ("Ruedita") & Wider on PC */
.dropdown-menu,
#cityDropdownMenu {
    max-height: 300px !important;
    overflow-y: auto !important;
    /* Enable scroll */
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: #D4AF37 #222;
}

/* Custom Scrollbar for Webkit */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background-color: #D4AF37;
    border-radius: 3px;
}

/* Wider City Dropdown on PC (Fill space) */
@media (min-width: 1025px) {
    .nav-left-group {
        width: 100%;
        /* Take available space */
    }

    .custom-dropdown {
        flex: 2 !important;
        /* Grow more than search */
        max-width: none !important;
        /* Remove constraints */
        width: 100% !important;
    }

    .dropdown-selected {
        width: 100% !important;
        justify-content: space-between;
    }
}

/* Model Card Text - Lowered further */
/* Model Card Text - Lowered EXTREME for Mobile */
.card-overlay-info {
    padding-bottom: 0px !important;
    /* Force text to very bottom */
    justify-content: flex-end !important;
}

.model-name {
    margin-bottom: 0 !important;
    padding-bottom: 2px !important;
}

/* THE MENU BUTTON ITSELF - Global Style (Small Icon) */
.menu-btn {
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.menu-btn .menu-text {
    font-size: 0.9rem !important;
}

/* --- Sidebar Tier Styling (Realistic Gradient Text) --- */
.nav-item .tier-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.nav-item.tier-tier-super-diamond {
    border-left: 3px solid #764ba2;
    padding-left: 10px;
}

.nav-item.tier-tier-super-diamond .tier-text {
    /* Blue/Purple Gradient Match */
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.nav-item.tier-tier-premium {
    border-left: 3px solid #f5576c;
    padding-left: 10px;
}

.nav-item.tier-tier-premium .tier-text {
    /* Pink/Rose Gradient Match */
    background: linear-gradient(90deg, #ff758c 0%, #ff7eb3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.nav-item.tier-tier-vip {
    border-left: 3px solid #00f2fe;
    padding-left: 10px;
}

.nav-item.tier-tier-vip .tier-text {
    /* Gold/Orange Gradient Match */
    background: linear-gradient(90deg, #f6d365 0%, #fda085 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}



/* --- Menu Positioning Fix (Below Login) --- */
@media (max-width: 768px) {

    /* Ensure the menu dropdown container takes a full row if needed, or floats right */
    .menu-dropdown-container {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin-top: 10px !important;
        order: 10 !important;
        /* Force to bottom of flex container */
    }
}


/* --- CONTACT ICONS FIX & CARD TEXT POSITION --- */
.action-buttons-top {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.btn-icon-circle {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.2s ease;
    text-decoration: none !important;
}

.btn-icon-circle svg,
.btn-icon-circle img {
    width: 28px !important;
    height: 28px !important;
    fill: white !important;
}

.btn-icon-circle:active {
    transform: scale(0.95);
}

.btn-whatsapp-circle {
    background: #25D366 !important;
}

.btn-call-circle {
    background: #999999 !important;
}

@media (max-width: 1024px) {
    .model-name {
        margin-bottom: 0px !important;
        padding-bottom: 2px !important;
    }

    .card-overlay-info {
        padding-bottom: 0px !important;
        height: 100% !important;
        justify-content: flex-end !important;
    }
}

/* --- FOOTER LOGO MOBILE FIX --- */
@media (max-width: 768px) {
    .site-footer .logo-img {
        max-width: 100px !important;
        /* Smaller logo on mobile */
        height: auto;
    }
}