/* Frontend V2 Styles - Design Consistency & Debugging
   Path: assets/css/frontend-v2.css
   Version: 4.2.1
*/

/* --- DEBUG BOX (Draggable & Minimizable) --- */
.gpp-debug-box {
    position: fixed;
    top: 100px; left: 20px;
    width: 260px;
    z-index: 99999999;
    background: rgba(0, 0, 0, 0.9);
    color: #00ff00;
    font-family: monospace; font-size: 12px;
    border: 1px solid #00ff00;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
}
.gpp-debug-header {
    background: #004400;
    color: #fff;
    padding: 5px 10px;
    cursor: grab; /* Shows it is draggable */
    display: flex; justify-content: space-between; align-items: center;
    font-weight: bold; border-bottom: 1px solid #00ff00;
}
.gpp-debug-header:active { cursor: grabbing; }
.gpp-debug-controls span {
    cursor: pointer; padding: 0 5px; font-size: 14px;
}
.gpp-debug-content {
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}
.gpp-debug-minimized .gpp-debug-content { display: none; }
.gpp-debug-minimized { width: 150px; height: auto; }

/* --- DUAL SEARCH COMPONENT --- */
.gpp-dual-search-wrapper {
    background: transparent; border: none;
    font-family: -apple-system, sans-serif;
    min-width: 280px; max-width: 320px;
    margin: 10px; z-index: 2000;
    transition: all 0.2s ease;
}

/* --- MOBILE COLLAPSED STATE (The "Leaflet Look") --- */
.gpp-dual-search-wrapper.gpp-search-collapsed {
    min-width: 34px !important;
    width: 43px !important;
    height: 43px !important;
    
    /* Match Leaflet Control Style exactly */
    background: #fff;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    background-clip: padding-box;
    box-shadow: none; /* Leaflet usually relies on border */
    
    overflow: hidden;
    cursor: pointer;
    margin-left: 10px; margin-top: 10px; /* Adjust spacing to align with Zoom controls */
}

/* Hover state for the icon */
.gpp-dual-search-wrapper.gpp-search-collapsed:hover {
    background: #f4f4f4;
}

/* The Icon inside */
.gpp-search-toggle-icon {
    position: absolute; top: 0; left: 0; 
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; z-index: 2001;
    color: #000; /* Black icon like standard controls */
}
.gpp-search-toggle-icon .dashicons { font-size: 25px; width: 25px; height: 25px; }

.gpp-dual-search-wrapper.gpp-search-collapsed .gpp-search-toggle-icon { opacity: 1; }
.gpp-dual-search-wrapper.gpp-search-collapsed .gpp-dual-search-header,
.gpp-dual-search-wrapper.gpp-search-collapsed .gpp-dual-search-container { opacity: 0; pointer-events: none; }


/* --- HEADER --- */
.gpp-dual-search-header {
    /* BG/Color set by JS */
    border-radius: 4px 4px 0 0;
    padding: 10px;
    display: flex; flex-direction: column; gap: 8px;
    position: relative;
}
.gpp-mobile-search-close {
    position: absolute; top: 5px; right: 5px;
    background: none; border: none;
    color: inherit; opacity: 0.8;
    font-size: 20px; cursor: pointer; line-height: 1;
}
.gpp-dual-search-title { font-weight: 700; font-size: 13px; text-transform: uppercase; }

/* Tabs */
.gpp-dual-search-toggle {
    display: flex; background: rgba(0,0,0,0.1); border-radius: 4px; padding: 2px;
}
.gpp-toggle-btn {
    flex: 1; text-align: center; font-size: 12px; padding: 4px 0;
    cursor: pointer; border-radius: 3px; color: rgba(255,255,255,0.7);
    transition: all 0.2s;
}
.gpp-toggle-btn.active {
    /* BG set by JS */
    color: #333; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* --- CONTAINER & RESULTS --- */
.gpp-dual-search-container {
    background: white; border-radius: 0 0 4px 4px; padding: 10px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}
.gpp-search-input-wrap { display: none; position: relative; }
.gpp-search-input-wrap.active { display: block; }

.gpp-search-input {
    width: 100%; box-sizing: border-box;
    padding: 6px 25px 6px 8px;
    border: 1px solid #ccc; border-radius: 3px;
    font-size: 13px; outline: none;
}
.gpp-input-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #999; display: none; font-weight: bold; }

.gpp-search-results {
    list-style: none; margin: 5px 0 0 0; padding: 0;
    max-height: 180px; overflow-y: auto; border-top: 1px solid #eee;
    display: none;
}
.gpp-search-results li { padding: 6px 8px; border-bottom: 1px solid #f9f9f9; font-size: 12px; cursor: pointer; color: #444; }
.gpp-search-results li:hover { background: #f4f4f4; }
.gpp-search-results li strong { display: block; color: #000; }

/* --- GLOBAL PRESERVED --- */
body { overflow-x: hidden; }
.gpp-v2-wrapper { position: relative; width: 100vw; left: auto; right: auto; overflow: hidden; background: #f0f0f0; z-index: 1; }
.gpp-v2-map-layer { width: 100%; height: 100%; z-index: 0; }
.gpp-v2-sidebar { position: absolute; top: 0; bottom: 0; width: 60px; z-index: 1000; display: flex; flex-direction: column; align-items: center; padding-top: 15px; pointer-events: none; background: transparent; }
.gpp-v2-wrapper:not(.gpp-rtl) .gpp-v2-sidebar { left: 0; right: auto; }
.gpp-v2-wrapper.gpp-rtl .gpp-v2-sidebar { right: 0; left: auto; }
.gpp-v2-wrapper:not(.gpp-rtl) .leaflet-left { left: 70px !important; }
.gpp-v2-wrapper.gpp-rtl .leaflet-right { right: 70px !important; }

/* Icons/Popups */
.gpp-menu-item { pointer-events: auto; width: 40px; height: 40px; border-radius: 50%; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.3); transition: transform 0.2s; border: 1px solid rgba(255,255,255,0.2); background: #fff; }
.gpp-menu-item:hover { transform: scale(1.1); }
.gpp-menu-item img { width: 24px; height: 24px; object-fit: contain; }
.gpp-menu-item .dashicons { font-size: 20px; width: 20px; height: 20px; color: inherit; }
.gpp-v2-submenu-bubble { position: absolute; width: 220px; background: white; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 1001; overflow: hidden; display: none; }
.gpp-bubble-header { padding: 10px 15px; font-weight: bold; font-size: 14px; }
.gpp-bubble-content { padding: 10px 0; max-height: 250px; overflow-y: auto; }
.gpp-sub-row { display: flex; align-items: center; padding: 8px 15px; font-size: 13px; cursor: pointer; color: #333; transition: background 0.1s; }
.gpp-sub-row:hover { background: #f9f9f9; }
.gpp-sub-row span { flex: 1; }
.gpp-v2-wrapper.gpp-rtl .gpp-sub-row { flex-direction: row-reverse; text-align: right; }
.gpp-v2-wrapper.gpp-rtl .gpp-sub-row input { margin-right: 0; margin-left: 10px; }
.gpp-v2-wrapper:not(.gpp-rtl) .gpp-sub-row input { margin-right: 10px; margin-left: 0; }
.gpp-empty-subs { font-size: 12px; color: #999; text-align: center; padding: 15px; }
.gpp-v2-popup { font-family: sans-serif; min-width: 200px; }
.gpp-v2-wrapper.gpp-rtl .gpp-v2-popup { direction: rtl; text-align: right; }
.gpp-v2-popup h3 { margin: 5px 0 8px 0; font-size: 15px; font-weight: 600; }
.gpp-v2-popup img, .gpp-v2-popup video, .gpp-v2-popup iframe { width: 100%; border-radius: 4px; margin-bottom: 8px; display: block; }
.gpp-v2-popup iframe { height: 150px; border:none; }
.gpp-store-row { font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.gpp-v2-wrapper.gpp-rtl .gpp-store-row { flex-direction: row-reverse; }




/* High specificity selector for RTL Toggle Alignment */
.gpp-v2-wrapper.gpp-rtl.gpp-sidebar-expanded .gpp-v2-sidebar .gpp-sidebar-toggle {
    align-self: flex-start !important; /* Forces the item to the Left (Start) */
    margin-left: 15px !important;      /* Adds spacing from the left edge */
    margin-right: auto;                /* Removes right-side spacing constraints */
}


/* Force the map to break out of the theme container */
.gpp-v2-wrapper.alignfull {
    width: 100vw;              /* Force width to 100% of viewport */
    position: relative;        /* Reset position context */
    left: 50%;                 /* Move center to middle of screen */
    right: 50%;                
    margin-left: -50vw !important;  /* Pull left edge to screen edge */
    margin-right: -50vw !important; /* Pull right edge to screen edge */
    max-width: 100vw !important;    /* Override any theme max-width */
}

/* --- MODE 1: FULL WIDTH (Edge-to-Edge) --- */
/* This forces the map to ignore the theme's container padding and touch the screen edges */
.gpp-v2-wrapper[data-map-mode="full"] {
    width: 100vw;               /* Force strictly 100% of viewport width */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;  /* Pull to left edge */
    margin-right: -50vw !important; /* Pull to right edge */
    border-radius: 0;           /* Full width usually looks best with sharp corners */
}

/* --- MODE 2: BOXED (Constrained) --- */
/* This keeps the map inside the theme's text column, aligned with your paragraphs */
.gpp-v2-wrapper[data-map-mode="boxed"] {
    width: 100%;                /* Fill the available container space only */
    margin-left: 0;
    margin-right: 0;
    border-radius: 8px;         /* Rounded corners look better when boxed */
    overflow: hidden;           /* Clean edges */
}


.gpp-sub-container {
    border-top: none !important;
}


/* --- SAFETY FIX (Crucial) --- */
/* This prevents the "Full Width" mode from creating a horizontal scrollbar */
body {
    overflow-x: hidden; 
}





