/* ==========================================================================
   Gestion des Façades - Frontend Styles
   ========================================================================== */

:root {
	--fm-primary: #1a3b5d;
	--fm-accent: #c99b3f;
	--fm-text: #222;
	--fm-bg-light: #f7f8fa;
	--fm-border: #e2e5e9;
	--fm-whatsapp: #25d366;
	--fm-radius: 6px;
}

.fm-btn {
	display: inline-block;
	padding: 10px 22px;
	border-radius: var(--fm-radius);
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all 0.2s ease;
}
.fm-btn-primary { background: var(--fm-primary); color: #fff; }
.fm-btn-primary:hover { background: #142e49; color: #fff; }
.fm-btn-outline { background: transparent; color: var(--fm-primary); border-color: var(--fm-primary); }
.fm-btn-outline:hover { background: var(--fm-primary); color: #fff; }
.fm-btn-whatsapp { background: var(--fm-whatsapp); color: #fff; }
.fm-btn-whatsapp:hover { background: #1ea952; color: #fff; }

/* Breadcrumb */
.fm-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; font-size: 0.9em; }
.fm-breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 6px; color: #999; }

/* Services grid */
.fm-services-grid { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
.fm-services-grid.fm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.fm-services-grid.fm-cols-4 { grid-template-columns: repeat(4, 1fr); }
.fm-service-card { border: 1px solid var(--fm-border); border-radius: var(--fm-radius); padding: 16px; background: #fff; }
.fm-service-card img { width: 100%; height: auto; border-radius: var(--fm-radius); }

@media (max-width: 900px) {
	.fm-services-grid, .fm-services-grid.fm-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.fm-services-grid, .fm-services-grid.fm-cols-2, .fm-services-grid.fm-cols-4 { grid-template-columns: 1fr; }
}

/* Quote form */
.fm-quote-form .fm-form-row { margin-bottom: 14px; }
.fm-quote-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.fm-quote-form input,
.fm-quote-form select,
.fm-quote-form textarea,
.fm-calculator input { width: 100%; padding: 10px; border: 1px solid var(--fm-border); border-radius: var(--fm-radius); box-sizing: border-box; }
.fm-quote-form textarea { min-height: 100px; }
.fm-form-message { margin-top: 12px; padding: 12px; border-radius: var(--fm-radius); }
.fm-form-message.success { background: #e6f7ec; color: #1b6b3a; }
.fm-form-message.error { background: #fdecec; color: #a8332a; }

/* Comparator */
.fm-comparator-table { width: 100%; border-collapse: collapse; }
.fm-comparator-table th, .fm-comparator-table td { border: 1px solid var(--fm-border); padding: 10px; text-align: center; }
.fm-comparator-table .fm-criteria-label { text-align: left; font-weight: 600; background: var(--fm-bg-light); }

/* Calculator */
.fm-calc-results table { width: 100%; margin-top: 14px; }
.fm-calc-results td { padding: 6px 0; border-bottom: 1px dashed var(--fm-border); }
.fm-calc-disclaimer { font-size: 0.85em; color: #777; }

/* Gallery */
.fm-gallery-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.fm-gallery-filters select { padding: 8px; border-radius: var(--fm-radius); border: 1px solid var(--fm-border); }
.fm-gallery-grid.fm-layout-masonry { column-count: 3; column-gap: 16px; }
.fm-gallery-grid.fm-layout-masonry .fm-gallery-item { break-inside: avoid; margin-bottom: 16px; }
.fm-gallery-item { position: relative; border-radius: var(--fm-radius); overflow: hidden; border: 1px solid var(--fm-border); }
.fm-gallery-item img { width: 100%; display: block; }
.fm-gallery-caption { padding: 8px 10px; }
.fm-before-after { position: relative; cursor: pointer; }
.fm-ba-label { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff; padding: 2px 8px; border-radius: 3px; font-size: 0.75em; }

@media (max-width: 900px) {
	.fm-gallery-grid.fm-layout-masonry { column-count: 2; }
}
@media (max-width: 600px) {
	.fm-gallery-grid.fm-layout-masonry { column-count: 1; }
}

/* Lightbox */
.fm-lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 99999; }
.fm-lightbox-overlay img { max-width: 90%; max-height: 90%; }
.fm-lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 32px; cursor: pointer; }

/* Before / After slider */
.fm-before-after-viewer .fm-ba-slider { position: relative; width: 100%; padding-top: 56%; background-size: cover; background-position: center; }

/* FAQ */
.fm-faq-item { border-bottom: 1px solid var(--fm-border); padding: 10px 0; }
.fm-faq-q { cursor: pointer; margin: 0; }
.fm-faq-a { display: none; padding-top: 8px; }
.fm-faq-item.fm-open .fm-faq-a { display: block; }

/* Search */
.fm-search-wrapper { position: relative; margin-bottom: 24px; }
.fm-search-input { width: 100%; padding: 12px; border-radius: var(--fm-radius); border: 1px solid var(--fm-border); }
.fm-search-results { position: absolute; z-index: 10; background: #fff; width: 100%; border: 1px solid var(--fm-border); border-top: none; max-height: 300px; overflow-y: auto; }
.fm-search-list { list-style: none; margin: 0; padding: 0; }
.fm-search-list li a { display: block; padding: 10px; text-decoration: none; color: var(--fm-text); }
.fm-search-list li a:hover { background: var(--fm-bg-light); }
.fm-search-type { font-size: 0.75em; color: var(--fm-accent); text-transform: uppercase; margin-right: 6px; }

/* Testimonial */
.fm-testimonial { border-left: 4px solid var(--fm-accent); padding: 16px 20px; background: var(--fm-bg-light); font-style: italic; }

/* Language FAB */
.fm-lang-fab { position: fixed; bottom: 24px; left: 24px; z-index: 9999; font-family: sans-serif; }
.fm-lang-fab-toggle { width: 48px; height: 48px; border-radius: 50%; background: var(--fm-primary); color: #fff; border: none; font-size: 20px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.fm-lang-fab-options { display: none; flex-direction: column; gap: 6px; margin-bottom: 8px; position: absolute; bottom: 56px; left: 0; }
.fm-lang-fab.fm-open .fm-lang-fab-options { display: flex; }
.fm-lang-option { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--fm-border); background: #fff; cursor: pointer; font-weight: 600; }
.fm-lang-option.fm-active { background: var(--fm-accent); color: #fff; }

/* RTL support for Arabic */
html[dir="rtl"] body { font-family: 'Cairo', sans-serif; }
html[dir="rtl"] .fm-breadcrumb li:not(:last-child)::after { content: "\\"; margin-right: 6px; margin-left: 0; }
html[dir="rtl"] .fm-comparator-table .fm-criteria-label { text-align: right; }
html[dir="rtl"] .fm-search-list li a { text-align: right; }
html[dir="rtl"] .fm-lang-fab { left: auto; right: 24px; }
html[dir="rtl"] .fm-lang-fab-options { left: auto; right: 0; }
