:root {
    --gm-bg: #f5f3ee;
    --gm-surface: #ffffff;
    --gm-surface-alt: #f0ede6;
    --gm-text-primary: #1a1814;
    --gm-text-secondary: #6b6760;
    --gm-text-muted: #9c9890;
    --gm-accent: #2d5a3d;
    --gm-accent-light: #e8f0eb;
    --gm-accent-hover: #234830;
    --gm-border: rgba(26,24,20,0.10);
    --gm-border-strong: rgba(26,24,20,0.18);
    --gm-pin-default: #2d5a3d;
    --gm-pin-active: #e85d26;
    --gm-sidebar-w: 380px;
    --gm-header-h: 72px;
}

.gm-wrap {
    font-family: 'DM Sans', sans-serif;
    background: var(--gm-bg);
    color: var(--gm-text-primary);
    position: relative;
}

/* Header */
.gm-header {
    height: var(--gm-header-h);
    background: var(--gm-surface);
    border-bottom: 1px solid var(--gm-border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
}
.gm-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
    color: var(--gm-accent);
    margin-right: auto;
}
.gm-postcode-instructions {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gm-text-secondary);
    margin-right: 0.5rem;
    white-space: nowrap;
}
.gm-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gm-bg);
    border: 1px solid var(--gm-border-strong);
    border-radius: 8px;
    padding: 6px 8px 6px 14px;
    flex: 0 1 340px;
}
.gm-search-wrap input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--gm-text-primary);
    flex: 1;
}
.gm-search-wrap input::placeholder { color: var(--gm-text-muted); }
.gm-search-btn {
    background: var(--gm-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.gm-search-btn:hover { background: var(--gm-accent-hover); }
.gm-results-label {
    font-size: 0.8rem;
    color: var(--gm-text-muted);
    white-space: nowrap;
}

/* Layout */
.gm-layout {
    display: grid;
    grid-template-columns: var(--gm-sidebar-w) 1fr;
    height: calc(100vh - var(--gm-header-h));
}

/* Sidebar */
.gm-sidebar {
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
    border-right: 1px solid var(--gm-border);
    background: var(--gm-bg);
    scroll-behavior: smooth;
}
.gm-sidebar::-webkit-scrollbar { width: 4px; }
.gm-sidebar::-webkit-scrollbar-track { background: transparent; }
.gm-sidebar::-webkit-scrollbar-thumb { background: var(--gm-border-strong); border-radius: 2px; }
.gm-sidebar-heading {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gm-text-muted);
    margin-bottom: 1rem;
    padding-left: 2px;
}
@media(min-width:768px) {
    #gm-cards {
        padding-bottom: 100vh;
    }
}

/* Card */
.gm-card {
    background: var(--gm-surface);
    border: 1px solid var(--gm-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
}
.gm-card:hover {
    border-color: var(--gm-border-strong);
    transform: translateY(-1px);
}
.gm-card.active { border-color: var(--gm-pin-active); box-shadow: 0 0 0 3px rgba(232,93,38,0.12); }
.gm-card.active .gm-card-index { background: var(--gm-pin-active); }
.gm-card-img { width: 100%; height: 160px; object-fit: cover; display: block; }
.gm-card-img-placeholder {
    width: 100%; height: 160px;
    background: linear-gradient(135deg, #e8f0eb 0%, #c8dace 100%);
    display: flex; align-items: center; justify-content: center;
}
.gm-card-img-placeholder svg { opacity: 0.35; }
.gm-card-body { padding: 1rem 1rem 1.1rem; }
.gm-card-index {
    position: absolute; top: 10px; left: 10px;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--gm-pin-default); color: #fff;
    font-size: 0.7rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.gm-card-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.gm-card-address { font-size: 0.8rem; color: var(--gm-text-secondary); margin-bottom: 10px; line-height: 1.4; }
.gm-card-distance {
    display: inline-block;
    font-size: 0.72rem; font-weight: 500;
    background: var(--gm-accent-light); color: var(--gm-accent);
    border-radius: 4px; padding: 2px 8px;
}
.gm-card-link {
    display: inline-block; margin-top: 8px;
    font-size: 0.8rem; color: var(--gm-accent); font-weight: 500;
    text-decoration: none; border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}
.gm-card-link:hover { border-color: var(--gm-accent); }

/* Map */
.gm-map-col { position: relative; }
#gm-map { width: 100%; height: 100%; }

/* Loading */
.gm-loading {
    position: absolute; inset: 0;
    background: rgba(245,243,238,0.85);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 500; gap: 12px;
    backdrop-filter: blur(2px);
}
.gm-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--gm-border-strong);
    border-top-color: var(--gm-accent);
    border-radius: 50%;
    animation: gm-spin 0.7s linear infinite;
}
@keyframes gm-spin { to { transform: rotate(360deg); } }
.gm-loading-text { font-size: 0.85rem; color: var(--gm-text-secondary); }

/* Leaflet popup */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 4px 24px rgba(0,0,0,0.13);
}
.leaflet-popup-content { margin: 12px 14px; }
.gm-popup-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.gm-popup-sub { font-size: 0.78rem; color: #6b6760; margin-bottom: 6px; }
.gm-popup-link { font-size: 0.78rem; color: #2d5a3d; font-weight: 500; }

/* Responsive */
@media (max-width: 768px) {
    .gm-layout { grid-template-columns: 1fr; grid-template-rows: auto 50vh; }
    .gm-search-wrap { flex: 1; }
    .gm-results-label { display: none; }
    .gm-header { padding: 0 1rem; gap: 8px; }
    .gm-logo { font-size: 1.1rem; }
}
