@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

#irm-container {
    display: flex;
    height: 740px;
    font-family: 'Inter', sans-serif;
    background: #ffffff;
    overflow: hidden;
    position: relative;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

/* --- SIDEBAR --- */
.irm-sidebar {
    width: 340px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    height: 100%;
}

.irm-sidebar-header {
    padding: 25px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.irm-sidebar-header h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

#irm-search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    font-size: 14px;
    outline: none;
    transition: 0.3s;
}

#irm-search-input:focus {
    background: #fff;
    border-color: #c5ba90;
    box-shadow: 0 0 0 4px rgba(197, 186, 144, 0.1);
}

.irm-filters-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* --- FILTER GROUPS --- */
.irm-filter-group {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
    overflow: hidden;
}

.irm-filter-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #fff;
}

.parent-filter {
    flex: 1;
}

.parent-filter label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.irm-category-acf-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    margin-right: 10px;
    flex-shrink: 0;
}

.irm-group-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.irm-collapse-arrow {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: #94a3b8;
    transition: 0.3s;
}

.is-open>.irm-filter-group-header .irm-collapse-arrow,
.is-open>.irm-subgroup-title .irm-collapse-arrow {
    transform: rotate(180deg);
}

.irm-filter-group-content,
.irm-subgroup-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.irm-filter-group-content {
    background: #fafafa;
    padding: 0 15px;
}

.is-open>.irm-filter-group-content {
    max-height: 1500px;
    padding-bottom: 15px;
}

.is-open>.irm-subgroup-options {
    max-height: 1500px;
    padding-bottom: 8px;
}

/* --- CUSTOM CHECKBOX --- */
input.irm-f-cat {
    display: none !important;
}

.irm-check {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    margin-right: 12px;
    position: relative;
    background: #fff;
    flex-shrink: 0;
}

.irm-f-cat:checked+label .irm-check {
    background: #c5ba90;
    border-color: #c5ba90;
}

.irm-f-cat:checked+label .irm-check::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.irm-filter-item label {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
}

.irm-label-text {
    font-size: 14px;
    color: #334155;
}

/* --- BULK ACTIONS --- */
.irm-bulk-actions {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.irm-action-btn {
    flex: 1;
    padding: 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    color: #c5ba90;
}

/* --- RIGHT PANEL (OLD STYLE RESTORED) --- */
#irm-right-panel {
    position: absolute;
    top: 0;
    right: -450px;
    width: 420px;
    height: 100%;
    background: #ffffff;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#irm-right-panel.open {
    right: 0;
}

#irm-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.irm-p-img {
    flex-shrink: 0;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.irm-p-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.irm-p-scroll-area {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c5ba90 #f1f5f9;
}

.irm-p-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.irm-p-scroll-area::-webkit-scrollbar-thumb {
    background: #c5ba90;
    border-radius: 10px;
}

.irm-p-body {
    padding: 25px 30px 60px;
}

.irm-p-cat-tag {
    display: inline-block;
    background: #f0ede3;
    color: #a3966a;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.irm-p-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
}

.irm-p-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 25px 0 15px;
    display: flex;
    align-items: center;
}

.irm-p-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f1f5f9;
    margin-left: 15px;
}

.irm-p-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.irm-p-grid {
    display: grid;
    gap: 10px;
}

.irm-p-card {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    transition: 0.3s;
}

.irm-p-card:hover {
    border-color: #c5ba90;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.irm-p-card .k {
    font-size: 10px;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 2px;
}

.irm-p-card .v {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    word-wrap: break-word;
}

.irm-p-card.dynamic {
    border-left: 3px solid #c5ba90;
}

.irm-p-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #475569;
    padding: 15px;
    background: #fdfdfd;
    border-radius: 10px;
    border: 1px dashed #e2e8f0;
}

.irm-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* --- MAP --- */
.irm-main-panel {
    flex: 1;
    position: relative;
}

#gmap-canvas {
    width: 100%;
    height: 100%;
}

.irm-filter-group-content .irm-category-acf-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

/* --- MEASUREMENT TOOLS --- */
.irm-map-tools {
    position: absolute;
    top: 12px;
    right: 60px;
    z-index: 999;
    display: flex;
    gap: 10px;
}

.irm-map-tool-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.irm-map-tool-btn:hover {
    background: #c5ba90;
    border-color: #c5ba90;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(197, 186, 144, 0.3);
}

.irm-map-tool-btn.active {
    background: #c5ba90;
    color: #fff;
    border-color: #c5ba90;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- MOBILE RESPONSIVE LOGIC --- */

/* Hide mobile elements on desktop */
.irm-mobile-only {
    display: none;
}

@media (max-width: 768px) {
    #irm-container {
        flex-direction: column;
        height: 600px;
        /* Adjust height for mobile */
    }

    /* Toggle Button Style */
    #irm-mobile-filter-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        position: absolute;
        top: 120px !important;
        /* Requested position */
        left: 15px;
        z-index: 999;
        background: #fff;
        border: 1px solid #e2e8f0;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 700;
        color: #1e293b;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    #irm-mobile-close-sidebar {
        display: flex !important;
        position: absolute;
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
        background: #f1f5f9;
        border: none;
        border-radius: 50%;
        font-size: 22px;
        color: #64748b;
        align-items: center;
        justify-content: center;
        z-index: 2001;
        cursor: pointer;
    }

    /* Sidebar as a Slide-over Menu */
    .irm-sidebar {
        position: absolute;
        top: 0;
        left: -82%;
        width: 300px;
        height: 100%;
        z-index: 2000;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .irm-sidebar.mobile-open {
        transform: translateX(100%);
        /* Slide in */
    }

    /* Main panel takes full width */
    .irm-main-panel {
        width: 100%;
        height: 100%;
    }

    /* Overlay when menu is open */
    #irm-sidebar-overlay {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1999;
        backdrop-filter: blur(2px);
    }

    #irm-sidebar-overlay.active {
        display: block;
    }

    /* Adjust right panel (POI details) for mobile */
    #irm-right-panel {
        width: 100%;
        right: -100%;
    }

    /* Move map tools lower to not overlap toggle button */
    .irm-map-tools {
        top: 70px;
        right: 10px;
        flex-direction: column;
    }

    .irm-sidebar-header {
        padding-right: 50px !important;
    }

    /* Adjust map tools so they don't block the Filters button */
    .irm-map-tools {
        top: 120px !important;
    }

}

@media (min-width: 769px) {
    #irm-mobile-close-sidebar {
        display: none !important;
    }
}