/**
 * Marketplace foncier — extension charte Kawadema Marketplace
 */

.fm-page {
    background: linear-gradient(180deg, var(--gray-50, #f9fafb) 0%, #fff 240px);
}

.fm-main {
    min-height: calc(100vh - 72px);
}

/* Header extensions */
.fm-logo {
    gap: 0.5rem;
}

.fm-logo-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    margin-left: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-500, #1f3a5f) 0%, #2d5a8a 100%);
    border-radius: var(--radius-full, 9999px);
    vertical-align: middle;
}

.fm-header-tagline {
    flex: 1;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600, #4b5563);
    padding: 0 1rem;
}

.fm-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fm-header-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700, #374151);
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md, 0.5rem);
    transition: background var(--transition-fast, 150ms ease);
}

.fm-header-link:hover {
    background: var(--gray-100, #f3f4f6);
    color: var(--primary-500, #1f3a5f);
}

.fm-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-500, #1f3a5f) 0%, #2d5a8a 100%);
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
    transition: transform var(--transition-fast, 150ms ease), box-shadow var(--transition-fast, 150ms ease);
    position: relative;
}

.fm-cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    color: #fff;
}

.fm-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-500, #1f3a5f);
    background: #fbbf24;
    border-radius: var(--radius-full, 9999px);
}

.fm-flash-wrap {
    padding-top: 1rem;
}

.fm-flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg, 0.75rem);
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.fm-flash.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Hero */
.fm-hero {
    background: linear-gradient(135deg, var(--primary-500, #1f3a5f) 0%, #1e4d7b 45%, #163a5c 100%);
    color: #fff;
    padding: 1.75rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.fm-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(251, 191, 36, 0.15) 0%, transparent 45%);
    pointer-events: none;
}

.fm-hero .container {
    position: relative;
    z-index: 1;
}

.fm-hero h1 {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}

.fm-hero p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
    max-width: 42rem;
}

.fm-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.fm-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full, 9999px);
    font-size: 0.8rem;
    backdrop-filter: blur(8px);
}

.fm-stat-pill strong {
    font-weight: 800;
    color: #fbbf24;
}

/* Workspace */
.fm-workspace {
    padding: 1.25rem 0 2rem;
}

.fm-grid {
    display: grid;
    grid-template-columns: minmax(260px, 300px) 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 991px) {
    .fm-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.fm-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fm-card {
    background: #fff;
    border-radius: var(--radius-xl, 1rem);
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.08));
    overflow: hidden;
}

.fm-card__head {
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600, #4b5563);
    background: var(--gray-50, #f9fafb);
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.fm-card__body {
    padding: 1rem;
}

.fm-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    margin-bottom: 0.35rem;
}

.fm-field input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: var(--radius-md, 0.5rem);
    transition: border-color var(--transition-fast, 150ms ease), box-shadow var(--transition-fast, 150ms ease);
}

.fm-field input:focus {
    outline: none;
    border-color: var(--primary-500, #1f3a5f);
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.12);
}

.fm-ac-list {
    max-height: 200px;
    overflow: auto;
    margin-top: 0.35rem;
    border-radius: var(--radius-md, 0.5rem);
    border: 1px solid var(--gray-200, #e5e7eb);
}

.fm-ac-list button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    border: none;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    background: #fff;
    cursor: pointer;
}

.fm-ac-list button:hover {
    background: var(--gray-50, #f9fafb);
}

.fm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md, 0.5rem);
    cursor: pointer;
    transition: all var(--transition-fast, 150ms ease);
}

.fm-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-500, #1f3a5f), #2d5a8a);
    box-shadow: var(--shadow-sm);
}

.fm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.fm-btn-ghost {
    color: var(--gray-700, #374151);
    background: #fff;
    border: 1px solid var(--gray-300, #d1d5db);
    margin-top: 0.5rem;
}

.fm-btn-ghost:hover {
    background: var(--gray-50, #f9fafb);
}

/* Legend */
.fm-legend {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.fm-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--gray-600, #4b5563);
}

.fm-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Map stage */
.fm-map-stage {
    position: relative;
    min-height: min(72vh, 720px);
    border-radius: var(--radius-xl, 1rem);
    overflow: hidden;
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    background: var(--gray-200, #e5e7eb);
}

.fm-map {
    height: min(72vh, 720px);
    min-height: 420px;
    width: 100%;
    z-index: 1;
}

.fm-map-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.fm-map-loading.is-active {
    opacity: 1;
    pointer-events: auto;
}

.fm-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid var(--gray-200, #e5e7eb);
    border-top-color: var(--primary-500, #1f3a5f);
    border-radius: 50%;
    animation: fm-spin 0.7s linear infinite;
}

@keyframes fm-spin {
    to { transform: rotate(360deg); }
}

.fm-map-loading p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700, #374151);
}

/* Context panel */
.fm-context-panel {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: min(360px, calc(100% - 1.5rem));
    z-index: 15;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-xl, 1rem);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-2xl, 0 25px 50px -12px rgba(0, 0, 0, 0.2));
    transform: translateX(calc(100% + 1rem));
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    pointer-events: none;
}

.fm-context-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.fm-context-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.fm-context-close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: var(--radius-full, 9999px);
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-600, #4b5563);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.fm-context-close:hover {
    background: var(--gray-200, #e5e7eb);
}

.fm-context-panel__body {
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

.fm-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full, 9999px);
    margin-bottom: 0.35rem;
}

.fm-type-badge--site { background: #dbeafe; color: #1d4ed8; }
.fm-type-badge--subdivision { background: #ede9fe; color: #6d28d9; }
.fm-type-badge--block { background: #cffafe; color: #0e7490; }
.fm-type-badge--parcel { background: #fef3c7; color: #b45309; }
.fm-type-badge--sale { background: #fee2e2; color: #b91c1c; }
.fm-type-badge--cession { background: #dbeafe; color: #1d4ed8; }

.fm-context-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gray-900, #111827);
    margin: 0;
    line-height: 1.3;
}

.fm-context-chain {
    font-size: 0.78rem;
    color: var(--gray-500, #6b7280);
    margin: 0.35rem 0 0;
    line-height: 1.4;
}

.fm-context-meta {
    display: grid;
    gap: 0.65rem;
    margin: 1rem 0;
}

.fm-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.82rem;
    padding: 0.5rem 0.65rem;
    background: var(--gray-50, #f9fafb);
    border-radius: var(--radius-md, 0.5rem);
}

.fm-meta-row span:first-child {
    color: var(--gray-500, #6b7280);
}

.fm-meta-row strong {
    color: var(--gray-900, #111827);
    text-align: right;
}

.fm-price-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 800;
    color: #b45309;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-lg, 0.75rem);
}

.fm-context-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.fm-context-actions .fm-btn-sale {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    padding: 0.7rem 1rem;
    font-weight: 700;
    border-radius: var(--radius-md, 0.5rem);
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.fm-context-actions form {
    margin: 0;
}

.fm-context-actions .fm-btn-cart {
    width: 100%;
    padding: 0.65rem;
    font-weight: 600;
    border: 2px solid var(--primary-500, #1f3a5f);
    color: var(--primary-500, #1f3a5f);
    background: #fff;
    border-radius: var(--radius-md, 0.5rem);
    cursor: pointer;
}

.fm-context-skeleton .fm-sk-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: fm-shimmer 1.2s infinite;
    margin-bottom: 0.65rem;
}

.fm-context-skeleton .fm-sk-line:nth-child(1) { width: 40%; }
.fm-context-skeleton .fm-sk-line:nth-child(2) { width: 85%; height: 18px; }
.fm-context-skeleton .fm-sk-line:nth-child(3) { width: 70%; }
.fm-context-skeleton .fm-sk-line:nth-child(4) { width: 100%; height: 48px; margin-top: 1rem; }

@keyframes fm-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.fm-context-hierarchy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.fm-hierarchy-chip {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    background: var(--gray-100, #f3f4f6);
    border-radius: var(--radius-full, 9999px);
    color: var(--gray-600, #4b5563);
}

/* Leaflet popup minimal (fallback mobile) */
.fm-popup-mini {
    font-size: 0.8rem;
    min-width: 140px;
}

.fm-popup-mini strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Detail / cart pages */
.fm-page-hero-sm {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
    background: #fff;
}

.fm-breadcrumb {
    font-size: 0.8rem;
    color: var(--gray-500, #6b7280);
    margin-bottom: 0.35rem;
}

.fm-breadcrumb a {
    color: var(--primary-500, #1f3a5f);
    text-decoration: none;
}

.fm-detail-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    padding: 1.5rem 0 2.5rem;
}

@media (max-width: 991px) {
    .fm-detail-grid {
        grid-template-columns: 1fr;
    }
}

.fm-detail-card {
    background: #fff;
    border-radius: var(--radius-xl, 1rem);
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
    overflow: hidden;
}

.fm-detail-card__head {
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--gray-50, #f9fafb);
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.fm-detail-card__body {
    padding: 1.15rem;
}

.fm-sticky-buy {
    position: sticky;
    top: 88px;
}

.fm-buy-box {
    background: #fff;
    border-radius: var(--radius-xl, 1rem);
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: var(--shadow-lg);
    padding: 1.25rem;
}

.fm-buy-box .fm-price-tag {
    width: 100%;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.15rem;
}

.fm-buy-box .fm-btn-primary {
    margin-top: 0.5rem;
}

/* Lot detail page */
.fm-detail-page {
    background: var(--gray-50, #f9fafb);
}

.fm-detail-hero {
    background: linear-gradient(180deg, #fff 0%, var(--gray-50, #f9fafb) 100%);
}

.fm-detail-hero__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.fm-detail-hero__title {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 800;
    margin: 0.35rem 0 0;
    color: var(--gray-900, #111827);
}

.fm-detail-hero__chain {
    font-size: 0.85rem;
    color: var(--gray-500, #6b7280);
    margin: 0.35rem 0 0;
}

.fm-detail-hero__price .fm-price-tag {
    font-size: 1.15rem;
    padding: 0.65rem 1rem;
}

.fm-detail-map-stage {
    background: #fff;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
    padding: 1rem 0 1.5rem;
    margin-bottom: 0.5rem;
}

.fm-detail-map-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.fm-detail-map-head h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--gray-800, #1f2937);
}

.fm-legend--map {
    margin: 0;
}

.fm-detail-map {
    height: min(52vh, 520px) !important;
    min-height: 360px !important;
    width: 100%;
    border-radius: var(--radius-xl, 1rem);
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.fm-detail-map-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--gray-50, #f9fafb);
    border-radius: var(--radius-xl, 1rem);
    border: 1px dashed var(--gray-300, #d1d5db);
    color: var(--gray-500, #6b7280);
}

.fm-detail-map-empty i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.fm-detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    padding: 1.25rem 0 2.5rem;
    align-items: start;
}

.fm-detail-main {
    min-width: 0;
}

.fm-detail-aside {
    position: sticky;
    top: 88px;
}

.fm-buy-box--detail .fm-buy-hint {
    font-size: 0.8rem;
    color: var(--gray-500, #6b7280);
    margin: 0 0 1rem;
    line-height: 1.45;
}

.fm-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.fm-info-cell--full {
    grid-column: 1 / -1;
}

.fm-info-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500, #6b7280);
    margin-bottom: 0.2rem;
}

.fm-coords-table {
    width: 100%;
    font-size: 0.82rem;
    border-collapse: collapse;
}

.fm-coords-table th,
.fm-coords-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
    text-align: left;
}

.fm-coords-table th {
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    background: var(--gray-50, #f9fafb);
}

.fm-detail-documents {
    margin-top: 0;
}

.fm-doc-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--gray-500, #6b7280);
}

.fm-doc-empty i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.45;
}

.fm-doc-section + .fm-doc-section {
    border-top: 1px solid var(--gray-200, #e5e7eb);
}

.fm-doc-section__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: var(--gray-50, #f9fafb);
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.fm-doc-section__head h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--gray-900, #111827);
}

.fm-doc-section__head p {
    font-size: 0.78rem;
    color: var(--gray-500, #6b7280);
    margin: 0.25rem 0 0;
}

.fm-doc-count {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-full, 9999px);
    color: var(--primary-500, #1f3a5f);
}

.fm-doc-list {
    display: flex;
    flex-direction: column;
}

.fm-doc-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.fm-doc-item:last-child {
    border-bottom: none;
}

.fm-doc-item__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #b45309;
    border-radius: var(--radius-md, 0.5rem);
    font-size: 1.1rem;
}

.fm-doc-item__cat {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary-500, #1f3a5f);
}

.fm-doc-item__body h4 {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0.15rem 0 0.5rem;
    color: var(--gray-900, #111827);
}

.fm-doc-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0;
    font-size: 0.78rem;
}

.fm-doc-item__meta > div {
    display: flex;
    gap: 0.35rem;
}

.fm-doc-item__meta dt {
    color: var(--gray-500, #6b7280);
    font-weight: 500;
    margin: 0;
}

.fm-doc-item__meta dd {
    margin: 0;
    font-weight: 600;
    color: var(--gray-800, #1f2937);
}

.fm-doc-item__notes {
    flex: 1 1 100%;
}

@media (max-width: 991px) {
    .fm-detail-layout {
        grid-template-columns: 1fr;
    }

    .fm-detail-aside {
        position: static;
        order: -1;
    }

    .fm-info-grid {
        grid-template-columns: 1fr;
    }

    .fm-detail-map {
        min-height: 280px !important;
        height: 45vh !important;
    }
}

.fm-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.fm-empty-state i {
    font-size: 2.5rem;
    color: var(--gray-300, #d1d5db);
    margin-bottom: 1rem;
}

/* Cart page */
.fm-cart-wrap {
    max-width: 720px;
    padding: 1.5rem 0 2.5rem;
}

.fm-cart-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.fm-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-xl, 1rem);
    box-shadow: var(--shadow-sm);
}

.fm-cart-item__actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

.fm-btn-danger {
    color: #b91c1c;
    background: #fff;
    border: 1px solid #fecaca;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-md, 0.5rem);
    cursor: pointer;
}

.fm-btn-danger:hover {
    background: #fef2f2;
}

.fm-inquiry-card {
    margin-bottom: 0;
}

.fm-inquiry-form {
    display: grid;
    gap: 0.75rem;
}

.fm-inquiry-form textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: var(--radius-md, 0.5rem);
    resize: vertical;
    font-family: inherit;
}

.fm-inquiry-form textarea:focus {
    outline: none;
    border-color: var(--primary-500, #1f3a5f);
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.12);
}

/* Confirmation */
.fm-success-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 2rem 0 3rem;
}

.fm-success-card {
    text-align: center;
    max-width: 480px;
    padding: 2rem 1.5rem;
    background: #fff;
    border-radius: var(--radius-xl, 1rem);
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: var(--shadow-lg);
}

.fm-success-icon {
    font-size: 3rem;
    color: #059669;
    margin-bottom: 1rem;
}

/* Leaflet popup override */
.fm-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: var(--radius-md, 0.5rem);
    box-shadow: var(--shadow-md);
}

.fm-hero--compact {
    padding: 1.35rem 0 1.5rem;
}

/* Catalog slider */
.fm-catalog {
    padding: 1.25rem 0 2.5rem;
}

/* Listings grid (after filter) */
.fm-listings-section {
    position: relative;
    margin-top: 1.25rem;
}

.fm-listings-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fm-listings-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--gray-900, #111827);
}

.fm-listings-count {
    font-size: 0.85rem;
    color: var(--gray-500, #6b7280);
}

.fm-listings-count strong {
    color: var(--primary-500, #1f3a5f);
}

.fm-listings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 0;
}

.fm-listings-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1400px) {
    .fm-listings-grid,
    .fm-listings-grid--4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .fm-listings-grid,
    .fm-listings-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .fm-listings-grid,
    .fm-listings-grid--4 {
        grid-template-columns: 1fr;
    }
}

.fm-listings-loading--grid {
    border-radius: var(--radius-xl, 1rem);
    min-height: 200px;
}

.fm-listing-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl, 1rem);
    border: 1px solid var(--gray-200, #e5e7eb);
    background: #fff;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.fm-listing-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.fm-empty-state--grid {
    grid-column: 1 / -1;
    padding: 3rem 1.5rem;
    text-align: center;
}

/* Catalog slider - deprecated listing track, keep loading spinner */
.fm-slider-section {
    position: relative;
    margin-bottom: 1rem;
}

.fm-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.fm-slider-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    color: var(--gray-900, #111827);
}

.fm-slider-nav-group {
    display: flex;
    gap: 0.5rem;
}

.fm-slider-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: var(--radius-full, 9999px);
    background: #fff;
    color: var(--gray-700, #374151);
    cursor: pointer;
    transition: all 150ms ease;
}

.fm-slider-btn:hover {
    border-color: var(--primary-500, #1f3a5f);
    color: var(--primary-500, #1f3a5f);
}

.fm-listings-track-wrap {
    position: relative;
}

.fm-listings-track {
    display: none;
}

.fm-listings-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.65);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border-radius: var(--radius-xl, 1rem);
}

.fm-listings-loading.is-active {
    opacity: 1;
    pointer-events: auto;
}

.fm-listing-card__map-wrap {
    position: relative;
    height: 200px;
    background: var(--gray-100, #f3f4f6);
}

.fm-listing-mini-map {
    height: 200px !important;
    min-height: 200px !important;
    width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    z-index: 1;
}

.fm-listing-mini-map .leaflet-control-container {
    display: none;
}

.fm-listing-card__body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.fm-listing-card__chain {
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
    margin: 0;
    line-height: 1.35;
}

.fm-context-hierarchy--sm {
    margin-top: 0.15rem;
}

.fm-context-hierarchy--sm .fm-hierarchy-chip {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
}

.fm-listing-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    font-size: 0.75rem;
    color: var(--gray-600, #4b5563);
    margin-top: 0.25rem;
}

.fm-price-inline {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #b45309 !important;
}

.fm-listing-card__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.65rem;
}

.fm-listing-card__actions form {
    margin: 0;
}

.fm-btn--sm {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    width: auto;
    display: inline-flex;
}

.fm-btn-cart.fm-btn--sm {
    width: 2.5rem;
    padding: 0.5rem;
    justify-content: center;
}

.fm-empty-state--inline {
    flex: 1;
    min-width: 100%;
    padding: 2.5rem 1rem;
}

/* Horizontal filter bar */
.fm-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.75rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-xl, 1rem);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.85rem;
}

.fm-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 120px;
    flex: 1 1 140px;
    position: relative;
}

.fm-filter-field--grow {
    flex: 2 1 200px;
}

.fm-filter-field--locality {
    flex: 2 1 220px;
}

.fm-filter-field--range {
    flex: 1.5 1 200px;
}

.fm-filter-field label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500, #6b7280);
    margin: 0;
}

.fm-filter-field input,
.fm-filter-field select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: var(--radius-md, 0.5rem);
    background: #fff;
}

.fm-filter-field input:focus,
.fm-filter-field select:focus {
    outline: none;
    border-color: var(--primary-500, #1f3a5f);
    box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.1);
}

.fm-filter-range {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.fm-filter-range input {
    flex: 1;
    min-width: 0;
}

.fm-filter-range span {
    color: var(--gray-400, #9ca3af);
    font-size: 0.75rem;
}

.fm-filter-reset {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--gray-50, #f9fafb);
    color: var(--gray-600, #4b5563);
    cursor: pointer;
    align-self: flex-end;
}

.fm-filter-reset:hover {
    background: var(--gray-100, #f3f4f6);
    color: var(--primary-500, #1f3a5f);
}

.fm-ac-list--drop {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 30;
    margin-top: 0.25rem;
    box-shadow: var(--shadow-lg);
}

.fm-legend--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

@media (max-width: 768px) {
    .fm-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .fm-filter-field,
    .fm-filter-field--grow,
    .fm-filter-field--locality,
    .fm-filter-field--range {
        flex: 1 1 100%;
        min-width: 0;
    }

    .fm-filter-reset {
        width: 100%;
        height: auto;
        padding: 0.55rem;
    }
}

@media (max-width: 640px) {
    .fm-cart-item {
        flex-direction: column;
    }

    .fm-cart-item__actions {
        flex-direction: row;
        width: 100%;
    }

    .fm-context-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 55%;
        border-radius: var(--radius-xl, 1rem) var(--radius-xl, 1rem) 0 0;
        transform: translateY(100%);
    }

    .fm-context-panel.is-open {
        transform: translateY(0);
    }
}

/* --- Homepage sections --- */
.fm-commitment-section {
    padding: 1.75rem 0 0.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.fm-commitment-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.fm-commitment-item {
    text-align: center;
    padding: 1rem 0.75rem;
}

.fm-commitment-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.65rem;
    border-radius: 12px;
    background: var(--primary-50, #eff6ff);
    color: var(--primary-600, #1f3a5f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.fm-commitment-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--gray-900, #111827);
}

.fm-commitment-text {
    font-size: 0.8rem;
    color: var(--gray-600, #4b5563);
    margin: 0;
    line-height: 1.45;
}

.fm-section-head {
    margin-bottom: 1rem;
}

.fm-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--gray-900, #111827);
}

.fm-section-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500, #6b7280);
    margin: 0.25rem 0 0;
}

.fm-top-zones-section,
.fm-recent-section,
.fm-offerings-map-section {
    padding: 2rem 0;
}

.fm-top-zones-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.fm-top-zone-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: var(--radius-xl, 1rem);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.fm-top-zone-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.fm-top-zone-card__map {
    height: 120px;
    background: #f1f5f9;
    position: relative;
}

.fm-zone-mini-map {
    width: 100%;
    height: 120px;
}

.fm-top-zone-card__map-fallback {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gray-400, #9ca3af);
}

.fm-top-zone-card__body {
    padding: 0.75rem 0.85rem 0.9rem;
}

.fm-top-zone-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.fm-top-zone-card__chain {
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
    margin: 0 0 0.5rem;
    line-height: 1.35;
}

.fm-top-zone-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-600, #4b5563);
}

.fm-pagination {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
}

.fm-pagination__list {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fm-pagination__btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    color: var(--gray-700, #374151);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.fm-pagination__btn:hover:not(:disabled):not(.is-active) {
    border-color: var(--primary-300, #93c5fd);
    color: var(--primary-700, #1e3a5f);
}

.fm-pagination__btn.is-active {
    background: var(--primary-600, #1f3a5f);
    border-color: var(--primary-600, #1f3a5f);
    color: #fff;
}

.fm-pagination__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fm-pagination__ellipsis {
    padding: 0 0.25rem;
    color: var(--gray-400, #9ca3af);
}

.fm-offerings-map-legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.fm-offerings-map-wrap {
    border-radius: var(--radius-xl, 1rem);
    overflow: hidden;
    border: 1px solid var(--gray-200, #e5e7eb);
    box-shadow: var(--shadow-md);
}

.fm-offerings-map {
    width: 100%;
    height: 420px;
    background: #e2e8f0;
}

.fm-offerings-map-stats {
    margin-top: 0.65rem;
    text-align: center;
}

.fm-footer {
    margin-top: 1rem;
}

@media (max-width: 1100px) {
    .fm-commitment-grid,
    .fm-top-zones-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .fm-commitment-grid,
    .fm-top-zones-grid {
        grid-template-columns: 1fr;
    }

    .fm-offerings-map {
        height: 300px;
    }
}
