/* ==========================================================================
   Variables globales : couleurs, polices, tailles
   ========================================================================== */
:root {
  --color-primary: #005f73;
  --color-primary-rgb: 0, 95, 115;

  --color-secondary: #e0f2f1;
  --color-accent: #0a9396;
  --color-accent-light: #94d2bd;
  --color-text: #1a1a1a;
  --color-muted: #555;
  --color-bg: #fdfdfc;
  --color-caramel: #a67c52;

  --white: #fff;
  --LightGray: #eee;
  --black: #000;
  --red: #c0392b;
  --shadow: rgba(0, 0, 0, 0.2);
  --overlay: rgba(255, 255, 255, 0.85);
  --font-main: 'Poppins', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  --radius: 8px;
  --transition: 0.3s ease-in-out;
}

/* ==========================================================================
   Réglages de base
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*,*::before,*::after { box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
}  

html[lang="ar"] body {
  direction: rtl;
  font-family: var(--font-ar);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#site-header {
    width: 100%;
    position: relative; 
    z-index: 2500;
    background-color: var(--white);
    transition: height 0.4s ease; 
    box-shadow: 0 2px 10px var(--shadow);
}

#site-header.scrolled {
    position: fixed; 
    top: 0;
    left: 0;
    right: 0;
    height: 90px; 
    overflow: hidden;
    transform: none; 
    transition: height 0.4s ease; 
}

#site-header.scrolled .top-header {
    transform: translateY(-100%); 
    transition: transform 0.4s ease;
}

#site-header.scrolled .main-header-row {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3000; 
    transform: none; 
    box-shadow: 0 3px 12px var(--shadow);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px; 
    padding: 0.5rem 2.25rem; 
    background: var(--white);
    position: relative; 
    z-index: 20; 
    transition: transform 0.4s ease; 
    box-shadow: none; 
}

.top-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.main-header-row {
    position: relative; 
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 2.25rem;
    background: var(--white);
    z-index: 2500;
    transition: top 0.4s ease, box-shadow 0.3s ease;
}

.main-header-row .second-logo {
    display: none; 
    opacity: 0;
    transition: opacity 0.4s ease;
    order: 1; 
}

.main-header-row .main-nav {
  margin-left: auto;  
  margin-right: auto;
}

#site-header.scrolled .main-header-row .main-nav {
  margin-left: 0; 
  margin-right: 0;
  margin-inline-start: auto;
  order: 2; 
}

#site-header.scrolled .main-header-row .second-logo {
  display: flex;
  opacity: 1;
}

.top-logo img {
  height: 60px;
  width: auto;
}

.ministere-logo {
  height: 48px;
  width: auto;
  cursor: pointer;
}

.flag-tn {
  height: 48px;
  width: auto;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  color: var(--color-accent);
  transition: transform 0.12s ease, color 0.2s ease;
}
.icon-btn:active { transform: scale(0.98); }
.icon-btn:hover { color: var(--color-accent-light); }

.search-wrap {
  display: block;
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 0.22s ease, opacity 0.22s ease;
}

.search-wrap.visible {
  pointer-events: auto;
  height: 44px;
  opacity: 1;
}

#search-website-input {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-muted);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-main);
  font-size: 1rem;
  outline: none;
  border-radius: 0;
  color: var(--color-text);
}

.second-logo img {
  height: 60px;
  width: auto;
  flex-shrink: 0; 
  min-width: 0; 
  max-width: none;
  margin-left: 0.75rem;
  margin-right: 0.75rem;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  min-height: 70px;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  background-color: var(--color-accent);
  color: var(--white);
  font-weight: 700;
}

.burger { 
  display: none;
  background: none; 
  border: none; 
  font-size: 1.8rem; 
  color: var(--color-primary);
  cursor: pointer; 
  z-index: 1101; 
} 

.mobile-controls {
  display: none;
}

.main-nav.open ~ .burger,
.burger.active {
  color: var(--white);
}

.icon-btn, .search-icon { outline: none; }
#search-website-input:focus { box-shadow: 0 0 0 3px rgba(10,147,150,0.08); border-color: var(--color-accent); }

.section {
  padding: 2.5rem 1.8rem;
}

.section-text > *:not(:last-child) {
  margin-bottom: 1.5rem;
}

.section-text ul {
  margin-bottom: 1.5rem;
}

.section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.section-text h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.section-text h3 {
  display: block;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.section-text p {
  color: var(--color-muted);
  margin-bottom: 1.2rem;
  text-align: justify;
}

.split {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  justify-content: center;
  text-align: left;
  max-width: 1200px;
  margin: auto;
}

.split img {
    flex-basis: 50%;
    max-width:50%;
    flex: 0 0 50%; 
    width: 100%;
    height: auto;
    object-fit: cover;
    box-shadow: 0 4px 8px var(--shadow);
}

.text-content {
    flex-basis: 50%; 
    max-width: 50%; 
    flex: 0 1 50%; 
    display: flex;
    flex-direction: column; 
    justify-content: center;
    gap: 1rem; 
    box-sizing: border-box;
    padding: 0.7rem 0.7rem;
    text-align: justify;
}

.text-content h2 {
  font-size: 1.8rem;
  color: var(--color-primary);
  margin: 0 0 0.7rem 0;
  text-align: center;
}

.text-content h4 {
  font-size: 1.rem;
  color: var(--color-muted);
  margin: 0 0 0.7rem 0;
  text-align: center;
}

html[lang="ar"] .split {
  flex-direction: row-reverse;
  text-align: right;
}

html[lang="ar"] .split .section-text {
  margin-left: 0;
  margin-right: 0;
}

html[lang="ar"] .split img {
    flex-basis: 50%;
    max-width: 50%;
    flex: 0 0 50%; 
}

html[lang="ar"] .split .section-text > *:not(:last-child) {
  margin-bottom: 1.5rem;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  color: var(--color-primary);
  margin-bottom: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.section-wrapper h2 {
  text-align: center;
  font-size: 1.6rem; 
  margin: 1.8rem 0 1.25rem;
  color: var(--color-primary);
  font-weight: 600;
}

.section-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.spacer {
  height: 80px;
  background: transparent;
}

.collab-wrapper {
  margin: 0; 
  padding: 0;
  box-sizing: border-box;
  width: 100%;
}

.statistics.section,
.collab-section {
  background-color: var(--color-primary);
  padding: 2.5rem 1.25rem;
}

.statistics.section h2,
.collab-section h2,
.collab-title,
.statistics-title {
  color: var(--white) !important;
  text-align: center;
  margin-bottom: 3rem;
}

.stats-row,
.collab-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10rem;
  flex-wrap: nowrap;
  padding: 0 1rem;
}

.stat,
.collab {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 200px;
}

.stat i {
  font-size: 3rem;
  color: var(--color-accent-light);
  margin-bottom: 0.5rem;
}

.stat h2 {
  text-align: center;
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 2rem;
}

.stat h3 {
  font-size: 1.4rem;
  margin: 0.3rem 0;
  color: var(--white);
}

.stat p {
  font-size: 1rem;
  color: var(--LightGray)
}

.collab p {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--LightGray)
}

.collab img {
  height: 180px;
  width: auto;
}

.slider {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.slides {
  position: relative;
  height: 100%;
}

.slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.overlay-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--white);
  text-align: center;
  pointer-events: none;
  max-width: 100vw;
  user-select: none;
  z-index: 10;
}

.overlay-text h1,
.overlay-text p {
  text-shadow: 0.05rem 0.05rem 1px color-mix(in srgb, var(--color-primary) 90%, transparent);
}

.overlay-text h1 {
  font-size: 3rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-text p {
  font-size: 1.5rem;
  margin: 0;
}

.contact-wrapper {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.8rem;
  align-items: flex-start;
}

.map-container {
  flex: 0 0 40%;
  height: 500px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.contact-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form select {
  padding: 0.75rem 1rem;
  color: var(--color-muted);
  border: 1px solid var(--color-secondary);
  font-size: 1rem !important;
  line-height: 1.5 !important;
  background-color: var(--white);
  transition: border 0.3s, box-shadow 0.3s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-repeat: no-repeat;
  background-size: 0.75rem 0.75rem;
}

.contact-form select:focus {
  color: var(--color-text);
  border-color: var(--color-muted);
  outline: none;
}

.contact-form select:invalid {
  color: var(--color-muted) !important;
}

.contact-form select:valid {
  color: var(--color-text) !important;
}

.contact-form select option {
  display: block !important; 
  visibility: visible !important;
  height: auto !important;
  line-height: 1.5 !important;
  color: var(--color-text) !important; 
  background-color: var(--white) !important; 
  font-size: 1rem !important;
  padding: 0 !important; 
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-secondary);
  font-size: 1rem;
  background-color: var(--white);
  transition: border 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  color: var(--color-text);
  border-color: var(--color-muted);
  outline: none;
}

.contact-form textarea {
  min-height: 100px;
  resize: vertical;
}

.contact-form button {
  align-self: flex-start;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-caramel);
  color: var(--white);
  font-size: 1rem;
  min-width: 180px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
}

.contact-form button:hover {
  background-color: var(--color-caramel);
  font-weight: bold;
}

html[lang="ar"]
.contact-form select,
html[lang="ar"] 
.contact-form input,
html[lang="ar"] 
.contact-form textarea {
  font-family: var(--font-ar) !important;
  direction: rtl;
  text-align: right;
}

html[lang="ar"] 
.contact-form select::placeholder,
html[lang="ar"]
.contact-form input::placeholder,
html[lang="ar"] 
.contact-form textarea::placeholder {
  font-family: var(--font-ar) !important;
  direction: rtl;
  text-align: right;
}

html[lang="ar"] 
.contact-form button {
  font-family: var(--font-ar) !important;
  direction: rtl;
  text-align: center;
}

html[lang="fr"]
.contact-form select,
html[lang="fr"] 
.contact-form input,
html[lang="fr"] 
.contact-form textarea {
  font-family: var(--font-main) !important;
  direction: ltr;
  text-align: left;
}

html[lang="fr"] 
.contact-form select::placeholder,
html[lang="fr"]
.contact-form input::placeholder,
html[lang="fr"] 
.contact-form textarea::placeholder {
  font-family: var(--font-main) !important;
  direction: ltr;
  text-align: left;
}

html[lang="fr"] 
.contact-form button {
  font-family: var(--font-main) !important;
  direction: ltr;
  text-align: center;
}

html[lang="fr"] .contact-form select {
  background-position: right 0.75rem center;
  padding-inline-end: 2.5rem;
  padding-inline-start: 1rem;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" stroke="%23005f73" stroke-width="2"><path d="M2 4l4 4 4-4"/></svg>');
}

html[lang="ar"] .contact-form select {
  background-position: left 0.75rem center;
  padding-inline-start: 2.5rem;
  padding-inline-end: 1rem;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" stroke="%23005f73" stroke-width="2"><path d="M10 4l-4 4-4-4"/></svg>');
}

.contact-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.contact-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: all;
}

.overlay-content {
  background: var(--white);
  padding: 1.8rem 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  max-width: 400px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.overlay-content p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  color: var(--color-muted);
}

.overlay-content button {
  background: var(--color-primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.6rem;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

.overlay-content button:hover {
  background: var(--color-accent-light);
}

@keyframes fadeIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#organisation {
  overflow: hidden;
}

#organisation img {
  max-width: none !important;
  height: 900px !important;
  width: 50% !important;
  object-fit: cover;
  box-shadow: 0 4px 8px var(--shadow);
  display: block;
}

#chiffres {
  padding: 2.5rem 1.8rem;
}

#chiffres .split {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 2.5rem;
  max-width: 1200px;
  margin: auto;
}

#chiffres .section-text {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.6rem 1.25rem;
  margin: 2.5rem 3.2rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.product {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.product:hover {
  transform: translateY(-5px);
}

.product.highlight {
  outline: 3px solid var(--color-primary);
  background-color: rgba(var(--color-primary-rgb), 0.3);
  transition: background-color 0.6s ease;
}

.product img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 0.7rem;
}

.product h3 {
  margin: 0.7rem 0 0.35rem 0;
  color: var(--color-primary);
  font-weight: 700;
}

.product .category {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.product .details {
  font-size: 0.85rem;
  color: var(--color-text);
  margin-bottom: 0.7rem;
}

.product .price {
  font-weight: 700;
  color: var(--color-accent);
  font-size: 1rem;
}

html[lang="fr"] .product img {
  width: 100%;
  height: auto;
}

html[lang="ar"] .product img {
  width: 100%;
  height: auto;
}

html[lang="ar"] .product-grid {
  direction: rtl;
}

.filter-search-container {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 1.25rem auto;
  padding: 0.7rem;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
}

.filter-container {
  flex: 1 1 45%;
  max-width: 48%;
  min-width: 200px;
  height: auto;
}

.search-container {
  flex: 1 1 45%;
  max-width: 48%;
  min-width: 250px;
  height: auto;
}

#search-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border: 1px solid var(--color-primary);
  box-sizing: border-box;
  font-family: var(--font-main);
}

#category-filter {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border: 1px solid var(--color-primary);
  box-sizing: border-box;
  font-family: var(--font-main);
}

.filter-search-container,
#search-input,
#category-filter {
  font-family: var(--font-main);
}

html[lang="ar"] .filter-search-container,
html[lang="ar"] #search-input,
html[lang="ar"] #category-filter {
  direction: rtl;
  font-family: var(--font-ar);
  text-align: right;
}

.grid-centres {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
  margin: 0 auto 3.2rem;
  max-width: 1400px;
  padding: 0 1.25rem;
}

.centre-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
  padding: 1.25rem;
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: center;
}

.centre-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px var(--shadow);
}

.centre-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.centre-card p {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 0.35rem;
}

.simulateur,
.centres-wrapper {
  flex: 1 1 45%;
  max-width: 48%;
  min-width: 200px;
  height: auto;
  margin: 0 auto;
  text-align: center;
}

.appel-section {
  padding: 2.5rem 1.8rem;
}

.appel-section .split {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 2.5rem;
  max-width: 1200px;
  margin: auto;
}

.appel-section .section-text {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.table-container {
  max-width: 1000px;
  margin: 0 auto 3.2rem;
  padding: 0 1rem;
  overflow-x: auto;
}

.avis-vente-table,
.consultation-table,
.appels-table,
.sim-table,
.quotas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.avis-vente-table thead,
.consultation-table thead,
.appels-table thead,
.sim-table thead,
.quotas-table thead {
  background-color: var(--color-secondary);
  color: var(--color-primary);
}

.avis-vente-table th,
.avis-vente-table td,
.consultation-table th,
.consultation-table td,
.appels-table th,
.appels-table td,
.sim-table th,
.sim-table td,
.quotas-table th,
.quotas-table td {
  padding: 0.7rem;
  border: 1px solid var(--color-accent-light);
  text-align: center;
}

.avis-vente-table tbody tr:nth-child(even),
.consultation-table tbody tr:nth-child(even),
.appels-table tbody tr:nth-child(even),
.sim-table tbody tr:nth-child(even),
.quotas-table tbody tr:nth-child(even) {
  background: var(--color-bg);
}

.avis-vente-table tbody tr:hover,
.consultation-table tbody tr:hover,
.appels-table tbody tr:hover,
.sim-table tbody tr:hover,
.quotas-table tbody tr:hover {
  background: var(--color-accent-light);
  color: var(--white);
}

.quotas-table tbody tr:not(.non-soumis-row):hover td:nth-child(n+4) {
  background: var(--white) !important;
  color: var(--color-text) !important;
}

.quotas-table tbody tr:not(.non-soumis-row):nth-child(even):hover td:nth-child(n+4) {
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
}

.quotas-table tbody tr.non-soumis-row:hover td:nth-child(n+3) {
  background: var(--white) !important;
  color: var(--color-text) !important;
}

.quotas-table tbody tr.non-soumis-row:nth-child(even):hover td:nth-child(n+3) {
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
}

.avis-vente-table tbody th,
.consultation-table tbody th,
.appels-table tbody th {
  background-color: var(--color-secondary);
  color: var(--color-primary);
  font-weight: 600;
  width: 35%;
  padding: 0.7rem;
}

.sim-table th:first-child, .sim-table td:first-child {
  width: 3.2rem;
}

.qte-input,
.qte-supp-input {
  height: 1.8rem;
  border: 1px solid var(--color-accent-light);
  padding: 0.35rem;
  font-size: 1rem;
}

.centre-select {
  text-align: center;
  margin: 1.25rem auto;
  padding: 0.7rem;
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
}

.centre-select label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
}

.centre-select select {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border: 1px solid var(--color-accent-light);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-main);
  color: var(--color-text);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.centre-select select:hover {
  border-color: var(--color-accent);
}

.centre-select select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,123,255,0.2);
}

html[lang="ar"] .centre-select select {
  font-family: var(--font-ar);
  text-align: right;
}

.centre-select option {
  font-size: 1rem;
  font-family: inherit;
}

.actu-article {
  max-width: 900px;
  margin: 0 auto 5rem auto;
  font-family: var(--font-main);
}

.actu-article.rtl {
  direction: rtl;
  font-family: var(--font-ar);
}

.actu-article .actu-image {
  width: 100%;
  height: auto;
  margin-bottom: 3.2rem;
  box-shadow: 0 4px 8px var(--shadow);
}

.actu-article .actu-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 3.2rem;
}

#actu-title {
  max-width: 900px;
  margin: 2.5rem auto 2.5rem auto;
}

.actu-article .actu-resume {
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 3.2rem;
  text-align: justify;
}

.actu-article .actu-contenu {
  font-size: 1rem;
  color: var(--color-muted);
  margin-bottom: 3.2rem;
  line-height: 1.7;
  text-align: justify;
}

.actu-article .actu-contenu li {
  margin-inline-start: 1rem;
  margin-inline-end: 0;
  list-style-position: inside;
}

.actu-article .actu-contenu ul {
  margin-bottom: 1.25rem;
  margin-top: 1.25rem;
}

.actu-article .actu-fichier {
  margin-bottom: 2.5rem;
  margin-top: 2.5rem;
}

.actu-article .actu-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1.25rem;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.actu-article.rtl .actu-footer {
  justify-content: flex-start;
}

.actu-article .actu-footer i {
  margin-right: 0.35rem;
}

.resume-bloc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  gap: 0.7rem;
  flex-wrap: nowrap;
}

.resume {
  flex: 1;
  font-size: 0.9rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lien-suite {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--color-primary);
  text-decoration: none;
  cursor:pointer;
}

.lien-suite:hover {
  text-decoration: underline;
  color: var(--color-accent);
}

.actu-fichier a,
.fichier a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}

.actu-fichier a:hover {
  text-decoration: underline;
  color: var(--color-accent);
}

.fichier a:hover {
  color: var(--white);
}

.actu-fichier i,
.fichier i {
  margin-right: 0.35rem;
  font-size: 0.9rem;
}

.actu-share {
  cursor: pointer; 
}

.share-preview-float {
  position: absolute;
  z-index: 9999;
  background: var(--color-bg);
  color: var(--text-color);
  font-family: var(--font-family, 'Poppins', sans-serif);
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0.75rem;
  min-width: 250px;
  max-width: 320px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.share-preview-float .preview-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.share-preview-float .preview-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
}

.share-preview-float .preview-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
}

.share-preview-float .preview-text {
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.3;
}

.share-preview-float .preview-links {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.share-preview-float .preview-links a {
  color: var(--color-primary);
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.share-preview-float .preview-links a:hover {
  color: var(--color-accent);
}

#secteur-section {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2.5rem;
  margin-top: 2.5rem;
}

#secteur-content {
  flex: 1 1 50%;
  min-width: 400px;
  display: flex;
  flex-direction: column;
}

#map-secteur {
  flex: 1 1 50%;
  min-width: 400px;
  width: 100%;
  height: auto;
  min-height: 600px;
  background: transparent;
  overflow: hidden;
}

.secteur-block {
  padding: 2.5rem 1.8rem;
  background: transparent;
}

.secteur-text > *:not(:last-child) {
  margin-bottom: 1.5rem;
}

#secteur-content h3 {
  display: block;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  font-weight: 600;
}

#secteur-content > .secteur-block:first-child {
  margin-top: 0;
  padding-top: 0;
}

#secteur-content h2:first-child,
#secteur-content h3:first-child {
  margin-top: 0;
}

.secteur-text ul {
  margin-bottom: 1.2rem;
}

.secteur-text h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.secteur-content-text {
  margin-bottom: 1.2rem;
  text-align: justify;
  line-height: 1.7;
}

.gov-label span {
  display: inline-block;
  color: var(--white);         
  font-weight: 700;
  font-size: 1.2rem;
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s, transform 0.6s;
}

.gov-label span.visible {
  opacity: 1;
  transform: translateY(-20px);
}

html[lang="ar"] .gov-label span {
  font-family: var(--font-ar);
  font-size: 1.4rem;
}

.leaflet-popup-content {
  font-family: var(--font-main);
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
}

html[lang="ar"] .leaflet-popup-content {
  font-family: var(--font-ar);
  text-align: center;
}

.leaflet-popup-content-wrapper {
  background-color: rgba(var(--color-primary-rgb), 0.8);
  color: var(--white);
  padding: 0.4rem 0.7rem;
}

.leaflet-popup-tip {
  background-color: rgba(var(--color-primary-rgb), 0.9);
}

#rse-container {
  max-width: 900px;
  margin: 2.5rem auto 2.5rem auto;
}

#rse-intro {
  text-align: justify;
}

html[lang="ar"] #rse-intro {
  text-align: justify;
}

.rse-group-title,
.rse-group-title h2 {
  text-align: center;
  font-size: 1.6rem;
  margin: 0.7rem 0 3.2rem;
  color: var(--color-primary);
  font-weight: 600;
  padding-bottom: 0.5rem;
}

#rse-container li {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  text-align: justify;
}

.rse-item {
  text-align: justify;
}

.rse-item li {
  text-align: justify;
}

.rse-item ul ul {
  margin-inline-start: 1rem;
  margin-inline-end: 0;
  list-style-position: inside;
}

.rse-item li > ul {
  margin-top: 1rem;
}

.rse-item img {
  display: block;
  margin: 0 auto;
  max-width: 100% !important;
  height: auto;
  object-fit: contain;
}

.industrie-container {
  width: 100%;
  margin: 0;
  padding: 0;
}

.intro-screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: justify;
  padding: 3rem 1rem;
}

.phase-block {
  position: relative;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.phase-block.visible {
  opacity: 1;
  transform: translateY(0);
}

.phase-block img,
.phase-block picture {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain;
}

.phase-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100% !important;
  background: var(--overlay);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.4s ease; 
  z-index: 10;
  pointer-events: none;
}

.phase-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.phase-overlay h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
  text-align: center;
}

.phase-overlay ul {
  list-style: disc inside; 
  max-width: 70%;
  margin: 0 auto;
  padding: 1rem;
  text-align: justify;
}

.phase-overlay li {
  font-size: 1rem;
  margin-inline-start: 0.2rem;
  text-align: justify;
}

.phase-overlay p {
  font-size: 1rem;
  text-align: center;
  margin: 0 auto;
  text-align: justify;
}

.phase-nav {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: auto;
}

.phase-nav i {
  font-size: 2rem;
  margin: 0 1rem;
  color: var(--color-primary);
  cursor: pointer;
  transition: transform 0.3s;
}

.phase-nav i:hover {
  transform: scale(1.2);
}

.close-phase {
  position: absolute;
  top: 25%;
  right: 25%;
  font-size: 2.2rem;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1000;
}

.block-wrapper { margin-bottom: 3.2rem; }
.block-title {
    font-size:1.3rem;
    font-weight:600;
    margin-bottom: 1.25rem;
    display:flex;
    align-items:center;
    gap: 0.5rem;
    color:var(--color-primary);
}

#albums-block .album-images-container { margin-bottom: 0.35rem; }

.album-date {
  font-size: 1rem;
  color:var(--color-muted);
  margin-bottom: 1.25rem;
}

#actu-album-container {
  max-width: 900px;
  margin: 0 auto 3.2rem auto; 
}

.albums-grid, .gallery-grid, .album-images-grid {
    display:grid;
    gap: 0.75rem;
    grid-template-columns:repeat(4,1fr);
}

.grid-item {
  position: relative;
  width: 100%;
  padding-top: 75%;
  overflow: hidden;
  background: var(--color-bg);
  cursor: pointer;
}

.grid-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grid-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--color-text);
  background: var(--overlay);
  opacity: 0;
  transition: opacity 0.3s;
  padding: 0.7rem;
}

.grid-item:hover .grid-item-overlay {
  opacity: 1;
}

.grid-item-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.7rem;
}

.grid-album-date {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.grid-item:hover .grid-item-title{ opacity:1; }

.videos-grid{
    display:grid;
    gap: 0.75rem;
    grid-template-columns:repeat(3,1fr);
}

.video-item{ position:relative; cursor:pointer; border:1px solid var(--LightGray); }

.video-frame-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.video-frame-wrapper iframe {
  position: relative;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-title{ text-align:center; margin-bottom: 0.7rem; margin-top: 0.7rem; font-size:0.85rem; }

.pubs-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.pub-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--LightGray);
  padding: 0.5rem 0.7rem;
}

.pub-meta {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.pub-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.pub-date {
  font-size: 0.9rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.pub-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pub-icon a {
  color: var(--color-primary);
  font-size: 1.8rem;
  text-decoration: none;
}

.pub-icon a:hover {
  color: var(--color-accent);
}

[dir="rtl"] .pub-item { text-align: right; }
[dir="ltr"] .pub-item { text-align: left;}

.lightbox{
    position:fixed;
    inset:0;
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:9999;
    background: var(--overlay);
    cursor:default;
}
.lightbox.hidden{ display:none; }

#lightbox-content {
    width: 90vw;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lightbox-content img,
#lightbox-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close-btn {
    position:absolute;
    top: 1.25rem;
    right: 1.5rem;
    font-size: 2rem;
    background:none;
    border:none;
    color:var(--color-primary);
    cursor:pointer;
    z-index:1000;
}

.close-btn:hover {
    color:var(--color-accent)
}

.lightbox-left, .lightbox-right{
    position:absolute; top:0; bottom:0;
    width:50%;
    cursor:pointer;
    z-index:900;
}
.lightbox-left{ left:0; }
.lightbox-right{ right:0; }

.dynamic-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; 
    z-index: 1000; 
    display: none; 
    justify-content: center; 
    align-items: center; 
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    transform: none;
}

.dynamic-search-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.search-results-container {
    width: 90%;
    max-width: 700px; 
    max-height: 90vh; 
    min-height: auto;
    background-color: var(--overlay);
    padding: 1.8rem 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 2.5rem var(--shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto; 
    box-sizing: border-box; 
}

.search-results-container .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    left: auto;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
}

.search-results-container[dir="rtl"] .close-btn {
    right: auto;
    left: 1rem;
}

#close-search-overlay:hover {
    color: var(--red);
}

#search-results-title {
    margin: 0 0 1.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid var(--color-accent);
    text-align: inherit;
}

#search-query-display {
    font-weight: 700;
    color: var(--color-primary);
}

#search-overlay-input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    padding: 0.5rem 2rem;
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: var(--color-text);
}

.search-wrap[dir="rtl"] #search-overlay-input {
    padding: 0.5rem 0.75rem 0.5rem 2.2rem;
}

#overlay-search-input-wrap {
    margin-bottom: 1.8rem;
    border-bottom: 2px solid var(--color-primary);
}

.search-result-item {
    display: block;
    padding: 1rem 0.7rem;
    border-bottom: 1px solid var(--color-accent-light);
    text-decoration: none;
    color: var(--color-text);
    transition: background-color 0.2s, padding-left 0.2s;
}

.search-result-item:hover {
    background-color: var(--color-accent-light);
    padding-left: 1.25rem; 
}

.result-category {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.3rem;
    letter-spacing: 0.5px;
}

.result-title {
    font-size: 1rem;
    margin: 0 0 0.4rem 0;
    color: var(--color-text);
    line-height: 1.3;
}

.result-excerpt {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin: 0;
}

.btn-group-responsive {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 1.25rem auto;
  padding: 0.7rem;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
}

.principal-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  border: none;
  min-width: 250px;
  height: auto;
  background: var(--color-primary);
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font-main);
  box-sizing: border-box;
}

.principal-btn:hover {
  background: var(--color-secondary);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.consulter-btn,
.consulter-actu-btn {
  max-width: 160px;
  margin: 0 auto;
}

html[lang="ar"] .principal-btn {
  font-family: var(--font-ar) !important;
  text-align: center;
  direction: rtl;
}

html[lang="fr"] .principal-btn {
  font-family: var(--font-main) !important;
}

.internal-menu {
  margin: 1.8rem 0;
  text-align: center;
}

.internal-menu ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 3.2rem;
  padding: 0;
  margin: 0;
}

.internal-menu li {
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0.35rem;
  color: var(--text-color);
  border-bottom: 0.35rem solid transparent;
  transition: all 0.3s ease;
}

.internal-menu li:hover {
  color: var(--color-primary);
  border-bottom: 0.35rem solid var(--color-primary);
}

.internal-menu li.active {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom: 0.35rem solid var(--color-primary);
}

#breadcrumb-container {
  box-sizing: border-box;
  max-width: 80%;
}

.breadcrumb {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  font-size: 0.95rem;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--color-muted);
  cursor: pointer;
  transition: color 0.2s;
  flex-shrink: 0; 
}

.breadcrumb a:hover {
  color: var(--color-accent-light);
  font-weight: bold;
}

.breadcrumb span {
  display: flex;
  align-items: center;
  color: var(--color-muted);
  flex-shrink: 0;
}

.breadcrumb .breadcrumb-caret {
  margin: 0 0.4rem;
  font-size: 0.85rem;
  color: var(--color-accent);
  flex-shrink: 0;
}

.breadcrumb .breadcrumb-active {
  font-weight: 500;
  color: var(--color-primary);
  font-weight: bold !important;
  cursor: default;
  flex-shrink: 1;
  min-width: 0;
  text-overflow: ellipsis;
  overflow: hidden;
}

footer {
  background-color: var(--color-primary);
  color: var(--white);
  padding: 0; 
  font-size: 1rem;
}

.footer-wrapper {
  max-width: 1400px;
  margin: auto;
}

.footer-sanitaire-wrapper {
  background-color: var(--color-primary); 
  padding: 2.5rem 1.25rem;  
  text-align: center;
}

.footer-sanitaire-wrapper p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 1rem; 
    border-bottom: 2px solid var(--color-accent);
    width: 75%; 
    margin: 0 auto; 
    white-space: nowrap;
    padding-bottom: 1.25rem; 
}

.sanitaite-icon {
  color: var(--color-secondary);
  font-size: 2rem; 
  margin-right: 1.8rem; 
}

.footer-grid {
  display: flex;
  align-items: center; 
  justify-content: space-between;
  padding: 1.25rem 1.25rem; 
  gap: 1.8rem; 
}

.footer-block {
    flex: 1 1 300px; 
    display: flex;
    flex-direction: column;
}

.footer-brand-section {
    justify-content: center; 
    align-items: center;
    gap: 1.6rem; 
}

.footer-copyright-block {
    display: flex; 
    flex-direction: column;
    height: 100%;
    justify-content: center !important;
    align-items: center; 
    text-align: center;
}

.footer-copy {
    font-size: 0.9rem;
    opacity: 0.9; 
    white-space: nowrap; 
}

.footer-logo img {
  max-height: 120px; 
  filter: brightness(0) invert(1); 
}

.social-links {
    display: flex;
    gap: 1.25rem;
}

.social-icon {
  font-size: 1.5rem; 
  color: var(--color-accent);
}

.social-icon:hover {
  color: var(--white);
}

.footer-contact {
    justify-content: center; 
    align-items: center;
    padding-left: 1.5rem; 
    padding-right: 1.5rem;
}

.footer-contact address {
    font-style: normal;
    line-height: 1.7;
    text-align: left; 
    width: 100%;
    white-space: nowrap;
}

.footer-contact p {
    align-items: flex-start; 
    margin: 0 0 0.7rem 0;
    position: relative;
}

.footer-icon {
  color: var(--color-accent-light); 
  font-size: 1.8rem; 
  vertical-align: middle;
  position: absolute;
  top: 0;
  left: -4rem;
  width: 1.8rem; 
  text-align: center;
  flex-shrink: 0;
}

.error-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%; 
    z-index: 1000;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 0.7rem 1.25rem; 
    background: var(--white); 
    box-shadow: 0 2px 0.4rem var(--shadow);
    height: 80px; 
}

.error-header-logo img {
    max-height: 60px;
    max-width: 60px;
}

.error-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--color-primary);
    color: var(--white);
    padding: 1.25rem 0;
    box-shadow: 0 -2px 0.4rem var(--shadow);
}

.error-footer-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0 auto;
    text-align: center;
}

.error-footer-logo img {
    max-height: 50px;
    display: block;
}

.section-wrapper.error-layout {
    margin: 0; 
    max-width: none; 
    padding: 0; 
    padding-bottom: 70px; 
    min-height: calc(100vh - 80px); 
    display: flex;
    align-items: center; 
    justify-content: center;
    width: 100%;
}

.main-content {
    flex: none; 
    min-height: auto; 
    width: 90%;
    padding: 2rem 1rem;
    text-align: center;
}

[dir="rtl"] .footer-brand-section,
[dir="rtl"] .footer-copyright-block {
    justify-content: center; 
    align-items: center; 
    text-align: center;
}

[dir="rtl"] .sanitaite-icon {
    margin-right: 0; 
    margin-left: 1.2rem; 
}

[dir="rtl"] .footer-contact address {
    text-align: right;
}

[dir="rtl"] .footer-contact p {
    direction: rtl; 
}

[dir="rtl"] .footer-icon {
    left: auto;
    right: -4rem;
    margin-right: 0; 
    margin-left: 0; 
}

[dir="rtl"] .footer-copyright-block {
    text-align: center; 
}

@media (max-width: 768px) {

  #site-header {
    width: 100%;
  }

  .top-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.7rem 1.25rem;
    height: 80px;
    width: 100%;
  }

  .top-left {
    display: none !important;
  }

  .top-right {
    display: flex;
    flex: 1;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    gap: 0.5rem;
  }
  
  .mobile-controls {
        display: flex; 
        align-items: center;
        gap: 0.75rem; 
  }

  #lang-switch,
  #search-website-input {
      display: none;
  }

  .main-header-row {
        padding: 0.7rem 1.25rem;
        justify-content: space-between;
  }
    
  #site-header.scrolled {
        position: fixed; 
        top: 0;
        left: 0;
        right: 0;
        height: 80px;
        overflow: hidden; 
        transform: none; 
  }

  #site-header.scrolled .top-header {
        transform: translateY(-100%);
        transition: transform 0.4s ease;
  }

  #site-header.scrolled .main-header-row {
        position: absolute; 
        top: 0;
        left: 0;
        right: 0;
        z-index: 3000; 
        transform: none; 
  }

  .main-header-row .second-logo {
        display: flex;
        opacity: 1;
        order: 1;
  }
    
  .burger {
    display: block;
    position: relative;
    z-index: 1201;
  }

  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center; 
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1200;
  }

  .main-nav.open {
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav ul {
    background: var(--color-primary);
    padding: 2.5rem 0;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    min-width: 100%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    text-align: center;
  }

  .main-nav li {
    width: 100%;
    height: 100%;
  }

  .main-nav a {
    color: var(--white);
    font-weight: 500;
    padding: 0.5rem 0.7rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 70px;
    transition: background-color 0.3s ease;
    text-decoration: none;
  }

  .main-nav a:hover {
    background-color: var(--color-accent);
  }

  .main-nav a.active {
    background-color: var(--color-primary);
  }

  .second-logo img { height: 60px; width: auto; }
  .ministere-logo { height: 36px; width: auto; }
  .flag-tn { height: 36px; width: auto; }
  .main-nav a { font-size: 1.1rem;  }
  .search-wrap, #search-container { max-width: 300px; width: 86%; }

  html[lang="ar"] .main-nav a {
    font-size: 1.3rem;
  }

  html[lang="fr"] .main-nav a {
    font-size: 1.2rem;
  }

  .split {
    flex-direction: column !important; 
    gap: 1.5rem;
  }

  .split img {
    order: -1;
    flex: 0 0 auto !important;
    max-width: none !important;
    width: 100% !important; 
    height: auto;
    margin: 0; 
  }

  .text-content {
    order: 0;
    flex: 0 0 auto !important;
    max-width: none !important;
    width: 100% !important; 
    padding: 0.7rem; 

  }

  .contact-wrapper {
    flex-direction: column !important;
    gap: 1.25rem;
  }

  .map-container {
    width: 100% !important;
    height: 100% !important;
  }

  .contact-form {
    width: 100% !important;
  }

  .product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem 0.7rem !important;
    margin: 1.8rem 0.35rem !important;
    max-width: 100% !important;
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
  }

  .stats-row,
  .collab-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    justify-items: center !important;
    gap: 1.25rem !important;
  }

  .stat,
  .collab {
    flex: 0 0 45% !important;
    max-width: 45% !important;
    text-align: center;
  }

  .collab img {
    height: 120px;
    width: auto;
  }

  .stat p {
    font-size: 0.9rem;
  }

  html[lang="ar"] .stat p {
    font-size: 1rem;
  }

  html[lang="ar"] .overlay-text h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100vw;
  }

  html[lang="fr"] .overlay-text h1 {
    white-space: normal;
    word-wrap: break-word;
  }

  .overlay-text h1 {
    font-size: 2rem;
  }

  .overlay-text p {
    font-size: 1rem;
  }

  .slider {
    width: 100%;
    height: 40vh;
  }

  #organisation {
    flex-direction: column !important;
  }

  #organisation img {
    order: -1;
    width: 100% !important;
    height: 100% !important;
  }

  #chiffres .split {
    gap: 1rem;
  }

  .rse-item {
    flex-direction: column;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
    text-align: justify;
  }

  .rse-item .text-content {
    order: 0;
    width: 100% !important;
    padding: 0.7rem;
  }

  #rse-container li,
  .rse-item li {
    margin-inline-start: 1rem; 
    margin-inline-end: 0;
    list-style-position: inside;
  }

  .rse-item img {
    max-width: 100% !important; 
  }

  .filter-search-container {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    margin: 0.7rem 0.7rem;
    width: calc(100% - 20px);
    max-width: 100%;
  }

  .filter-container,
  .search-container {
    width: 100%;
    min-width: 100%;
  }

  .section-title {
    font-size: 2rem;
  }

  .section-wrapper h2 {
    font-size: 1.4rem;
  }

  .grid-centres {
    grid-template-columns: 1fr;
  }

  .centre-select {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    margin: 0.7rem 0.7rem;
    width: calc(100% - 20px);
    max-width: 100%; 
  }

  .actu-article .actu-title {
    font-size: 1.8rem;
  }

  .actu-article .actu-resume,
  .actu-article .actu-contenu {
    font-size: 1rem;
  }

  .actu-article .actu-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }

  .share-preview-float {
    min-width: 200px;
    max-width: 90vw;
    padding: 0.7rem;
  }

  .share-preview-float .preview-title {
    font-size: 0.95rem;
  }

  .share-preview-float .preview-text {
    font-size: 0.85rem;
  }

  .phase-block img {
    height: auto;
    max-height: 100%;
  }
  
  .phase-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    background: var(--overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
  }

  .phase-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .phase-overlay h2 {
    font-size: 1.4rem;
  }

  .phase-overlay ul {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
  }

  .phase-overlay li {
    font-size: 1rem;
    margin-inline-start: 0.7rem;
  }

  .close-phase {
    top: 1rem;
    right: 1rem;
    transform: none;
  }

  .albums-grid, .gallery-grid, .album-images-grid { 
    grid-template-columns:repeat(2,1fr); 
  }

  #actu-album-container {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-top: 2.5rem;
        margin-bottom: 2.5rem;
  }

  .videos-grid{ 
    gap: 1.25rem; 
    grid-template-columns:1fr; 
  } 
    
  .search-wrap.overlay-input-mode {
        display: flex; 
        height: 44px;
        opacity: 1;
        pointer-events: auto;
  }

  .search-wrap.overlay-input-mode .search-icon {
    align-self: center;
    color: var(--color-accent);
    font-size: 1.5rem;
  }

  .search-results-container {
        align-self: flex-start;
        margin-top: 20vh; 
        max-height: 80vh;
        padding-top: 1.25rem; 
  }

  .search-wrap:not(.overlay-input-mode) {
    display: none !important;
  }

  .dynamic-search-overlay {
        transform: scale(0.95);
        transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .dynamic-search-overlay.is-active {
        transform: scale(1);
  }

  .btn-group-responsive {
    display: block;
    width: 100%;
    max-width: 100%;         
    margin: 0;               
    padding: 0 1.25rem;
    box-sizing: border-box;
  }

  .simulateur,
  .centres-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem 0;
  }

  .principal-btn {
    width: 100%;
    box-sizing: border-box;
  }

  .internal-menu ul {
    gap: 0.7rem;
    flex-wrap: nowrap !important;
  }

  .internal-menu li {
    font-size: 1rem;
    padding: 0.35rem 0;
  }

  #medias-menu ul {
    gap: 1.6rem;
    flex-wrap: nowrap !important;
  }

  html[lang="fr"] #rse-menu .internal-menu li {
    font-size: 0.8rem;
  }

  #breadcrumb-container {
    padding: 1.6rem 1.6rem !important;
    margin: 1.25rem auto !important;
  }

  .breadcrumb {
    font-size: 0.85rem;
    gap: 0.4rem;
  }


    .footer-wrapper {
        max-width: 100%; 
        padding: 0 1rem; 
        margin: auto;
    }

    .footer-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2.5rem 0;
        gap: 2.5rem;
    }
    
    .footer-block {
        width: 100%; 
        max-width: 350px;
        flex: none; 
    }
    
    .footer-brand-section {
        align-items: center; 
        text-align: center;
    }

    .footer-copyright-block {
        align-items: center;
        text-align: center;
    }
    
    .footer-copy {
        font-size: 0.85rem;
        white-space: normal; 
    }

  .footer {
    font-size: 0.9rem;
  }

    .footer-sanitaire-wrapper {
        padding: 1.8rem 1rem;
    }
    
    .sanitaite-icon {
        margin-right: 1rem; 
        font-size: 1.5rem;
        flex-shrink: 0;
    }
        
    .footer-sanitaire-wrapper p {
        width: 100%;
        white-space: normal; 
        text-align: left; 
        padding-bottom: 1rem; 
    }
    
    [dir="rtl"] .footer-sanitaire-wrapper p {
        display: flex; 
        justify-content: flex-end;
        direction: rtl; 
        text-align: right;
    }
    
    [dir="rtl"] .sanitaite-icon {
        margin-right: 0;
        margin-left: 1rem; 
    }

    .footer-contact {
        align-items: center;
        padding: 0; 
        text-align: center;
        max-width: 300px; 
    }
    
    .footer-contact address {
        font-size: 0.9rem;
        line-height: 1.6;
        white-space: normal; 
        width: 100%;
        text-align: left; 
    }

    .footer-contact p {
        position: relative; 
        padding-left: 4rem; 
        margin-bottom: 0.5rem;
        direction: ltr; 
    }

    .footer-icon {
        font-size: 1.5rem;
        position: absolute;
        top: 0;
        left: 0; 
        width: 1.8rem; 
        text-align: center;
    }

  [dir="rtl"] .footer-contact address {
      text-align: right; 
  }

  [dir="rtl"] .footer-contact p {
      padding-right: 4rem; 
      padding-left: 0;
      direction: rtl; 
  }

  [dir="rtl"] .footer-icon {
      position: absolute;
      top: 0;
      right: 0.5rem;
      left: auto; 
      width: 1.8rem; 
      text-align: center;
  }

  [dir="rtl"] .footer-brand-section,
  [dir="rtl"] .footer-contact,
  [dir="rtl"] .footer-copyright-block {
        align-items: center; 
        text-align: center;
  }
}

@media (max-width: 1024px) {
  .top-logo img { height: 48px; width: auto; }
  .second-logo img { height: 60px; width: auto; }
  .ministere-logo { height: 36px; width: auto; }
  .flag-tn { height: 36px; width: auto; }
  .main-nav a { font-size: 0.9rem; padding: 0.5rem 0.7rem; }
  .search-wrap, #search-container { max-width: 540px; width: 86%; }

  .grid-centres {
    grid-template-columns: repeat(2, 1fr);
  }

  #secteur-section {
    flex-direction: column;
  }

  #map-secteur {
    height: 600px;
  }

  #secteur-section h2 {
    font-size: 1.6rem;
    text-align: center ! important;
  }
}

@media(min-width:769px) {
    .search-wrap.overlay-input-mode {
        display: none !important;
        height: 0 !important;
        opacity: 0 !important;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}