/* ===== VARIABLES & RESET ===== */
:root {
  --primary-dark: #1a120b;
  --primary-brown: #3c2a21;
  --accent-orange: #f4a261;
  --accent-red: #e76f51;
  --accent-light: #ffd8b1;
  --light-beige: #d5cea3;
  --off-white: #e5e5cb;
  --dark-brown: #2c1f14;
  --success: #198754;
  --error: #dc3545;
  --warning: #ffc107;
  --info: #3498db;
  
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'Space Grotesk', var(--font-primary);
  
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
  --border-radius: 10px;
  --section-glow: 0 0 15px rgba(244, 162, 97, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  background: linear-gradient(135deg, var(--primary-brown) 0%, var(--primary-dark) 100%);
  background-attachment: fixed;
  color: var(--off-white);
  line-height: 1.65;
  min-height: 100vh;
  padding: 130px 0 40px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to right, var(--primary-dark), var(--dark-brown));
  border-bottom: 2px solid var(--accent-orange);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: 1.5rem 0;
  text-align: center;
  backdrop-filter: blur(4px);
}

.title {
  font-family: var(--font-secondary);
  font-size: clamp(1.8rem, 5vw, 2.2rem);
  color: var(--accent-orange);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.subtitle {
  color: var(--light-beige);
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  opacity: 0.95;
  font-weight: 500;
}

/* ===== LAYOUT CONTAINERS ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.card {
  background: rgba(44, 31, 20, 0.92);
  backdrop-filter: blur(6px);
  border-radius: var(--border-radius);
  border: 1px solid rgba(244, 162, 97, 0.25);
  box-shadow: var(--shadow-md);
  padding: 2.2rem;
  margin: 1.5rem auto;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(244, 162, 97, 0.1), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), var(--section-glow);
  border-color: rgba(244, 162, 97, 0.4);
}

.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ===== LOGIN SECTION ===== */
#login-section {
  max-width: 500px;
  margin: 2rem auto;
}

.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  margin-top: 1.8rem;
}

.form input {
  padding: 1rem 1.4rem;
  border: none;
  border-radius: var(--border-radius);
  background: rgba(229, 229, 203, 0.97);
  color: var(--primary-dark);
  font-family: var(--font-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  font-size: 1.05rem;
  border: 1px solid rgba(44, 31, 20, 0.1);
}

.form input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(244, 162, 97, 0.5);
  background: rgba(255, 255, 255, 1);
}

.form button {
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-red) 100%);
  color: var(--primary-dark);
  border: none;
  border-radius: var(--border-radius);
  padding: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
  margin-top: 0.5rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.form button:hover,
.form button:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, #f5a86e 0%, #e97c5f 100%);
}

.error-message {
  color: var(--error);
  margin-top: 1.2rem;
  font-weight: 600;
  text-align: center;
  padding: 0.8rem;
  background: rgba(220, 53, 69, 0.15);
  border-radius: 8px;
  border-left: 3px solid var(--error);
}

/* ===== DASHBOARD NAVIGATION ===== */
.main-nav {
  background: rgba(26, 18, 11, 0.95);
  border-radius: var(--border-radius);
  padding: 0.8rem;
  margin-bottom: 1.8rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(244, 162, 97, 0.15);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--light-beige);
  text-decoration: none;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--accent-orange);
  transition: all var(--transition);
  transform: translateX(-50%);
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--primary-dark);
  background: var(--accent-orange);
}

.main-nav a.active::after,
.main-nav a:hover::after {
  width: calc(100% - 2rem);
}

/* ===== DASHBOARD CONTENT ===== */
.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.8rem;
  margin-bottom: 1.8rem;
}

.status-box {
  background: linear-gradient(145deg, var(--primary-dark), var(--dark-brown));
  border-radius: var(--border-radius);
  padding: 1.7rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(244, 162, 97, 0.15);
  position: relative;
  overflow: hidden;
}

.status-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--accent-orange);
}

.status-box h3 {
  color: var(--accent-light);
  margin-bottom: 1.2rem;
  font-family: var(--font-secondary);
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}

#atlas-status {
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  display: inline-block;
  min-width: 180px;
  text-align: center;
}

.success {
  background: rgba(25, 135, 84, 0.25);
  color: #c3f0d9;
  box-shadow: 0 0 10px rgba(25, 135, 84, 0.2);
}

.error {
  background: rgba(220, 53, 69, 0.25);
  color: #ffc7cc;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.2);
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.8rem;
  background: rgba(26, 18, 11, 0.75);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(244, 162, 97, 0.1);
}

.logout-button {
  background: transparent;
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

.logout-button:hover,
.logout-button:focus {
  background: var(--accent-orange);
  color: var(--primary-dark);
  box-shadow: 0 0 10px rgba(244, 162, 97, 0.3);
}

/* ===== DOCUMENTATION SECTION ===== */
.dashboard-doc {
  background: rgba(28, 23, 18, 0.65);
  border-radius: var(--border-radius);
  padding: 1.8rem;
  border-left: 4px solid var(--accent-orange);
}

.dashboard-doc h3 {
  color: var(--accent-orange);
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.field-list {
  list-style: none;
  margin: 1.8rem 0;
}

.field-list li {
  padding: 1rem;
  border-bottom: 1px solid rgba(244, 162, 97, 0.2);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: background-color 0.2s;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: rgba(44, 31, 20, 0.4);
}

.field-list li:hover {
  background: rgba(244, 162, 97, 0.15);
}

.field-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.field-list strong {
  color: var(--accent-light);
  font-weight: 600;
}

#allowed-countries {
  font-weight: 700;
  color: var(--accent-orange);
  margin-left: 5px;
  background: rgba(244, 162, 97, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.doc-alert {
  background: rgba(255, 193, 7, 0.2);
  padding: 1.4rem;
  border-radius: var(--border-radius);
  margin: 1.8rem 0;
  border-left: 3px solid var(--warning);
  font-weight: 500;
}

.goto-products {
  color: var(--accent-orange);
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  display: inline-block;
}

.goto-products::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-orange);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}

.goto-products:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.doc-contact {
  margin-top: 1.8rem;
  font-style: italic;
  color: var(--light-beige);
  border-top: 1px solid rgba(244, 162, 97, 0.2);
  padding-top: 1.2rem;
}

.doc-contact a {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 500;
}

.doc-contact a:hover {
  text-decoration: underline;
}

/* ===== PRODUCTS SECTION ===== */
#mapping-container {
  margin-top: 1.8rem;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 2.5rem;
  min-height: 250px;
  flex-direction: column;
  color: var(--light-beige);
  font-size: 1.1rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--accent-orange);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#products-section table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.8rem;
  background: rgba(44, 31, 20, 0.95);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#products-section th {
  background: var(--primary-dark);
  color: var(--accent-orange);
  font-weight: 700;
  padding: 1.2rem;
  text-align: left;
  position: sticky;
  top: 0;
}

#products-section td {
  padding: 1.1rem;
  border-bottom: 1px solid rgba(244, 162, 97, 0.15);
  vertical-align: middle;
}

#products-section tr:last-child td {
  border-bottom: none;
}

#products-section select {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  background: var(--off-white);
  color: var(--primary-dark);
  border: 1px solid rgba(44, 31, 20, 0.2);
  font-family: var(--font-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

#products-section select:focus {
  box-shadow: 0 0 0 3px rgba(244, 162, 97, 0.4);
}

#save-mapping {
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-red) 100%);
  color: var(--primary-dark);
  border: none;
  padding: 1rem 2.2rem;
  font-weight: 700;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  margin-top: 1.8rem;
  font-size: 1.05rem;
  display: block;
  margin: 1.8rem auto 0 auto;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

#save-mapping:hover,
#save-mapping:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, #f5a86e 0%, #e97c5f 100%);
}

/* ===== ORDERS SECTION ===== */
#orders-section table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.8rem;
  background: rgba(44, 31, 20, 0.95);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#orders-section th {
  background: var(--primary-dark);
  color: var(--accent-orange);
  font-weight: 700;
  padding: 1.2rem;
  text-align: left;
  position: sticky;
  top: 0;
}

#orders-section td {
  padding: 1.1rem;
  border-bottom: 1px solid rgba(244, 162, 97, 0.15);
}

#orders-section tr:last-child td {
  border-bottom: none;
}

.badge {
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.badge.success {
  background: rgba(25, 135, 84, 0.25);
  color: #c3f0d9;
}

.badge.pending {
  background: rgba(255, 193, 7, 0.25);
  color: #fff8e1;
}

.badge.failed {
  background: rgba(220, 53, 69, 0.25);
  color: #ffc7cc;
}

.resync-btn, .detail-btn {
  background: transparent;
  border: 1px solid var(--accent-orange);
  color: var(--accent-light);
  cursor: pointer;
  font-size: 0.9rem;
  margin: 0.3rem 0.3rem 0 0;
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  transition: all var(--transition);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.resync-btn:hover, .resync-btn:focus, 
.detail-btn:hover, .detail-btn:focus {
  background: var(--accent-orange);
  color: var(--primary-dark);
}

/* ===== ORDER MODAL ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--dark-brown);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 650px;
  padding: 2.5rem;
  position: relative;
  animation: modalFadeIn 0.3s ease-in-out;
  border: 1px solid var(--accent-orange);
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  font-size: 2.2rem;
  color: var(--accent-orange);
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--accent-light);
  background: rgba(244, 162, 97, 0.1);
}

#modal-body {
  padding: 1.2rem 0;
  line-height: 1.8;
  font-size: 1.05rem;
}

#modal-body > div {
  margin-bottom: 1.2rem;
}

#modal-body strong {
  color: var(--accent-light);
  display: inline-block;
  min-width: 120px;
  font-weight: 600;
}

/* ===== TOASTS ===== */
#toast-container {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.toast {
  padding: 14px 22px;
  border-radius: var(--border-radius);
  font-weight: 600;
  color: #fff;
  animation: fadein 0.3s, fadeout 0.5s 3s;
  box-shadow: var(--shadow-md);
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast::before {
  font-size: 1.4rem;
}

.toast.success { 
  background: rgba(25, 135, 84, 0.9);
  border-left: 4px solid #c3f0d9;
}
.toast.error   { 
  background: rgba(220, 53, 69, 0.9);
  border-left: 4px solid #ffc7cc;
}
.toast.info    { 
  background: rgba(52, 152, 219, 0.9);
  border-left: 4px solid #cce6ff;
}
.toast.warn    { 
  background: rgba(255, 193, 7, 0.9);
  color: #333;
  border-left: 4px solid #fff8e1;
}

@keyframes fadein {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeout {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
  .status-cards {
    grid-template-columns: 1fr;
  }
  
  .header {
    padding: 1.3rem 0;
  }
  
  .card {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 115px;
  }
  
  .card {
    padding: 1.7rem;
  }
  
  .main-nav ul {
    gap: 0.6rem;
  }
  
  .main-nav a {
    padding: 0.7rem 1.1rem;
    font-size: 0.92rem;
  }
  
  #orders-section table, 
  #products-section table {
    display: block;
    overflow-x: auto;
    font-size: 0.95rem;
  }
  
  .user-info {
    flex-direction: column;
    gap: 1.2rem;
    text-align: center;
  }
  
  .logout-button {
    width: 100%;
  }
}

@media (max-width: 576px) {
  body {
    padding-top: 105px;
  }
  
  .card {
    padding: 1.5rem;
    margin: 1.2rem auto;
  }
  
  .form input, 
  .form button {
    padding: 0.9rem;
  }
  
  .modal-content {
    padding: 1.8rem;
    width: 95%;
  }
  
  #toast-container {
    width: 95%;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }
  
  .toast {
    min-width: 0;
    width: 100%;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 2px;
}

a:focus,
button:focus,
input:focus,
select:focus {
  outline: 3px solid var(--accent-orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}
.error-message:empty {
  display: none;
}

.mt-1 { margin-top: 0.6rem; }
.mt-2 { margin-top: 1.2rem; }
.mt-3 { margin-top: 1.8rem; }
.mb-1 { margin-bottom: 0.6rem; }
.mb-2 { margin-bottom: 1.2rem; }
.mb-3 { margin-bottom: 1.8rem; }

.modal-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-around;
}

.confirm-btn {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
  color: var(--primary-dark);
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
  margin: 0 0.8rem;
  box-shadow: var(--shadow-sm);
  min-width: 100px;
}

.confirm-btn:hover,
.confirm-btn:focus {
  background: linear-gradient(135deg, #f5a86e, #e97c5f);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.confirm-btn.cancel {
  background: transparent;
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
}

.confirm-btn.cancel:hover {
  background: var(--accent-orange);
  color: var(--primary-dark);
}

#orders-section td:nth-child(5),
#orders-section th:nth-child(5) {
  width: 320px;
  max-width: 320px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#sync-products-btn {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
  color: var(--primary-dark);
  border: none;
  padding: 1rem 2rem;
  font-weight: 700;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1.5rem;
}

#sync-products-btn:hover,
#sync-products-btn:focus {
  background: linear-gradient(135deg, #f5a86e, #e97c5f);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.footer {
  margin-top: auto; /* Ajouté */
  padding: 2rem 0;
  text-align: center;
  font-size: 0.95rem;
  background: rgba(26, 18, 11, 0.9);
  color: var(--light-beige);
  border-top: 1px solid rgba(244, 162, 97, 0.2);
  width: 100%;
}

.footer-content a {
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.footer-content a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 85vh;
}

/* ===== LANGUAGE SELECTOR ===== */
.lang-switch {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 1100;
}

#lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(244, 162, 97, 0.6);
  background: rgba(26, 18, 11, 0.55);
  color: var(--accent-light);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(2px);
}

#lang-toggle:hover,
#lang-toggle:focus-visible {
  background: rgba(244, 162, 97, 0.15);
  color: var(--off-white);
  box-shadow: var(--shadow-md);
  border-color: rgba(244, 162, 97, 0.9);
}

#lang-toggle .chev {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition);
  margin-left: 2px;
}

.lang-switch.open #lang-toggle .chev {
  transform: rotate(-135deg);
}

/* Dropdown */
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  padding: 8px;
  background: rgba(44, 31, 20, 0.98);
  border: 1px solid rgba(244, 162, 97, 0.25);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
  list-style: none;
  animation: langMenuPop 0.18s ease-out;
}

.lang-menu[hidden] { display: none; }

.lang-menu li + li { margin-top: 6px; }

.lang-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.6rem 0.8rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--off-white);
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  text-align: left;
}

.lang-menu button:hover,
.lang-menu button:focus-visible {
  background: rgba(244, 162, 97, 0.15);
  color: var(--accent-light);
  transform: translateY(-1px);
}

.lang-menu button[aria-current="true"] {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* Petit badge optionnel pour le code langue */
.lang-badge {
  font-size: 0.8rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(26, 18, 11, 0.6);
  border: 1px solid rgba(255,255,255,0.12);
}

/* Animation */
@keyframes langMenuPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive placement */
@media (max-width: 576px) {
  .lang-switch {
    top: 10px;
    right: 10px;
  }
  #lang-toggle {
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
  }
  .lang-menu {
    min-width: 180px;
  }
}