/* Mobile-specific styles for Implantations page */
/* Based on the mobile design images provided */

/* Mobile viewport adjustments */
@media (max-width: 768px) {
    
    /* Header adjustments for mobile - only if needed */
    .header {
        /* Remove fixed positioning that might conflict with existing header */
        /* Let the existing header CSS handle positioning */
    }
    
    .header .logo img {
        height: 32px;
        width: auto;
    }
    
    /* Remove body padding that might conflict with existing layout */
    /* body {
        padding-top: 60px;
    } */
    
    /* Hero section mobile styling */
    .hero-implantations-faq {
        padding: 2rem 1rem;
        min-height: auto;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-content p {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    /* Position breadcrumbs correctly on mobile - extract from hero */
    .breadcrumb-nav {
        padding: 0.75rem 1rem;
        top: 0;
        left: 0;
        right: 0;
        z-index: 500;
        margin-top: 0;
    }
    
    .hero-breadcrumb {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .hero-breadcrumb-link {
        color: #666;
        text-decoration: none;
        transition: color 0.2s ease;
    }
    
    .hero-breadcrumb-link:hover {
        color: #c41e3a;
    }
    
    .hero-breadcrumb-separator {
        color: #999;
        margin: 0 0.25rem;
    }
    
    /* Adjust hero section to account for breadcrumb */
    .hero-implantations {
        margin-top: 50px; /* Space for breadcrumb */
    }
    
    /* Main content wrapper - stack vertically on mobile */
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
        padding-bottom: 80px; /* Extra space for fixed button */
    }
    
    /* Hide sidebar completely on mobile to match design */
    .implantations-sidebar {
        display: none;
    }
    
    /* Map container takes full width */
    .map-container {
        width: 100%;
        height: 60vh; /* Adjust height for mobile viewport */
        min-height: 400px;
        border-radius: 0;
        position: relative;
        margin-bottom: 80px; /* Space for fixed button */
    }
    
    /* Map/List toggle button */
    .mobile-view-toggle {
        position: fixed !important;
        bottom: 215px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background: white !important;
        border: 1px solid #ddd !important;
        border-radius: 24px !important;
        padding: 8px 16px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        color: #333 !important;
        cursor: pointer !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
        z-index: 9999 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        transition: all 0.2s ease !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-view-toggle:hover {
        background: #f8f8f8;
    }
    
    .view-option {
        transition: color 0.2s ease;
    }
    
    .view-option.active {
        color: #c41e3a;
        font-weight: 700;
    }
    
    .view-option:not(.active) {
        color: #666;
    }
    
    /* Mobile list view */
    .mobile-implantations-list {
        display: none;
        padding: 1rem;
        background: white;
        min-height: 60vh;
    }
    
    .mobile-implantations-list.active {
        display: block;
    }
    
    .mobile-implantation-card {
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .mobile-implantation-card:last-child {
        margin-bottom: 0;
    }
    
    .mobile-implantation-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.75rem;
    }
    
    .mobile-implantation-name {
        font-size: 1.1rem;
        font-weight: 600;
        color: #333;
        margin: 0;
        flex: 1;
        line-height: 1.3;
    }
    
    .mobile-implantation-type {
        background: #f0f0f0;
        color: #666;
        font-size: 0.75rem;
        font-weight: 500;
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
        margin-left: 0.75rem;
        white-space: nowrap;
    }
    
    .mobile-implantation-address {
        color: #666;
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    .mobile-implantation-phone {
        color: #c41e3a;
        font-size: 0.9rem;
        font-weight: 500;
        text-decoration: none;
    }
    
    .mobile-implantation-phone:hover {
        text-decoration: underline;
    }
    
    .mobile-implantation-hours {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #f0f0f0;
    }
    
    .mobile-hours-title {
        font-size: 0.85rem;
        font-weight: 600;
        color: #333;
        margin-bottom: 0.5rem;
    }
    
    .mobile-hour-item {
        display: flex;
        justify-content: space-between;
        font-size: 0.8rem;
        color: #666;
        margin-bottom: 0.25rem;
    }
    
    .mobile-hour-day {
        font-weight: 500;
    }
    
    .mobile-hour-time {
        color: #333;
    }
    
    /* Hide map when list is active */
    .map-container.hidden {
        display: none;
    }
    
    /* Ensure button stays visible in list view */
    .mobile-view-toggle.in-list-view {
        /* Properties already set in base class */
    }
    
    /* Add some bottom padding to list when button is fixed */
    .mobile-implantations-list.active {
        padding-bottom: 80px; /* Space for fixed button */
    }
    
    /* Filter section above map */
    .mobile-filter-section {
        background: white;
        padding: 1rem;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    
    /* Filter button styling - simple text only */
    .filter-toggle-mobile {
        background: none;
        border: none;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        font-weight: 600;
        color: #333;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .filter-toggle-mobile:hover {
        color: #c41e3a;
    }
    
    .filter-toggle-mobile:hover::after {
        background-image: url("/icons/filter-icon.png");
        opacity: 0.7;
    }
    
    .filter-toggle-mobile::after {
        content: "";
        width: 16px;
        height: 16px;
        background-image: url("/icons/filter-icon.png");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
    
    /* Mobile filter overlay */
    .mobile-filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 2000;
        display: none;
    }
    
    .mobile-filter-overlay.active {
        display: block;
    }
    
    /* Mobile filter panel */
    .mobile-filter-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 16px 16px 0 0;
        padding: 1.5rem;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 2001;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .mobile-filter-panel.active {
        transform: translateY(0);
    }
    
    .mobile-filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }
    
    .mobile-filter-header h3 {
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0;
        color: #333;
        text-align: center;
        flex: 1;
    }
    
    .mobile-filter-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #666;
        cursor: pointer;
        padding: 0.25rem;
        line-height: 1;
    }
    
    /* Filter toggle button - directly under header */
    .mobile-filter-toggle {
        width: 100%;
        background: none;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 0;
        font-size: 1rem;
        font-weight: 600;
        color: #333;
        cursor: pointer;
        border-bottom: 1px solid #eee;
        margin-bottom: 0;
    }
    
    .filter-arrow {
        font-size: 1.2rem;
        transition: transform 0.2s ease;
    }
    
    /* Filter options in mobile panel */
    .mobile-filter-options {
        padding-top: 1rem;
    }
    
    .mobile-filter-label {
        display: flex;
        align-items: center;
        padding: 0.75rem 0;
        font-size: 1rem;
        color: #333;
        cursor: pointer;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-filter-label:last-child {
        border-bottom: none;
    }
    
    /* Custom round checkboxes */
    .mobile-checkbox {
        display: none;
    }
    
    .checkbox-custom {
        width: 20px;
        height: 20px;
        border: 2px solid #ddd;
        border-radius: 50%;
        margin-right: 0.75rem;
        position: relative;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }
    
    .mobile-checkbox:checked + .checkbox-custom {
        border-color: #c41e3a;
        background: #c41e3a;
    }
    
    .mobile-checkbox:checked + .checkbox-custom::after {
        content: "✓";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        font-size: 12px;
        font-weight: bold;
    }
    
    .checkbox-text {
        flex: 1;
    }
    
    /* Filter actions section */
    .mobile-filter-actions {
        margin-top: 2rem;
        padding-top: 1.5rem;
        border-top: 1px solid #eee;
    }
    
    /* Apply filters button */
    .mobile-apply-filters {
        background: #c41e3a;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 1rem 2rem;
        font-size: 1rem;
        font-weight: 600;
        width: 100%;
        cursor: pointer;
        transition: background 0.2s ease;
        margin-bottom: 1rem;
    }
    
    .mobile-apply-filters:hover {
        background: #a01729;
    }
    
    /* Clear all filters button */
    .mobile-clear-filters {
        background: none;
        border: none;
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        color: #666;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        transition: color 0.2s ease;
    }
    
    .mobile-clear-filters:hover {
        color: #c41e3a;
    }
    
    .clear-icon {
        font-size: 1.2rem;
        font-weight: bold;
    }
    
    /* Fullscreen toggle adjustments for mobile */
    .fullscreen-toggle {
        width: 44px;
        height: 44px;
        top: 15px;
        right: 15px;
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    /* Selected filters display on mobile */
    .mobile-selected-filters {
        background: white;
        padding: 1rem;
        border-bottom: 1px solid #eee;
        display: none; /* Hidden by default */
    }
    
    .mobile-selected-filters.has-filters {
        display: block;
    }
    
    .mobile-selected-filters .filter-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .mobile-selected-filters .filter-tag {
        background: #f8f8f8;
        border: 1px solid #ddd;
        border-radius: 16px;
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        color: #333;
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }
    
    .mobile-selected-filters .clear-all-mobile {
        color: #c41e3a;
        font-size: 0.85rem;
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: underline;
    }
    
    /* Map popup adjustments for mobile */
    .leaflet-popup-content-wrapper {
        max-width: 280px;
    }
    
    .leaflet-popup-content {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Marker adjustments for mobile */
    .custom-marker {
        transform: scale(0.9); /* Slightly smaller markers on mobile */
    }
    
    /* Hide desktop-specific elements */
    .global-filters-section {
        display: none;
    }
    
    /* Ensure map controls are touch-friendly */
    .leaflet-control-zoom {
        transform: scale(1.1);
    }
    
    .leaflet-control-zoom a {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 20px;
    }
    
    /* Touch-friendly marker clusters */
    .marker-cluster {
        transform: scale(1.1);
    }
    
    .marker-cluster div {
        margin-left: 6px;
        margin-top: 6px;
        width: 36px;
        height: 36px;
        border-radius: 20px;
    }
    
    .marker-cluster span {
        line-height: 36px;
        font-size: 13px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .map-container {
        height: 50vh;
        min-height: 350px;
    }
    
    .filter-toggle-mobile {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .mobile-filter-panel {
        padding: 1rem;
    }
    
    .leaflet-popup-content-wrapper {
        max-width: 240px;
    }
}