/* ===== RESET & ROOT ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary: #0a6ebd;
  --primary-dark: #084f8c;
  --primary-light: #e8f4fd;
  --accent: #f07a1a;
  --accent-dark: #d4610a;
  --success: #1a9e5c;
  --success-dark: #137a45;
  --danger: #d12121;
  --text-main: #1a1a2e;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg: #f8fafc;
  --bg-history: #f0f1f2;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.18);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-display: "Lora", Georgia, serif;
  --font-body: "Open Sans", sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  position: relative;
  background-color: var(--bg);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-weight: 400;
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
}

img {
  image-rendering: auto;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ===== HEADER ===== */
header {
  width: 100%;
  position: fixed;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  background: linear-gradient(135deg, #0a1628 0%, #0f2044 100%);
}

.principalheader {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 8px clamp(12px, 3vw, 48px);
  gap: clamp(8px, 2vw, 40px);
  color: white;
  transition:
    color var(--transition),
    border-color var(--transition);
}

.logo {
  width: clamp(80px, 9vw, 180px);
  height: auto;
  cursor: pointer;
  transition:
    transform var(--transition),
    opacity var(--transition);
  flex-shrink: 0;
}
.logo:hover {
  transform: scale(1.04);
  opacity: 0.9;
}

/* Search */
.barre-de-recherche {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  max-width: 480px;
  position: relative;
}

.barre-de-recherche img {
  width: clamp(14px, 1.4vw, 22px);
  aspect-ratio: 1/1;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.recherche {
  outline: none;
  border: none;
  text-align: center;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: white;
  font-family: var(--font-body);
  font-size: clamp(12px, 1vw, 15px);
  width: clamp(100px, 20vw, 200px);
  padding: 4px 0;
  transition:
    width 0.4s ease,
    border-color var(--transition),
    color var(--transition);
}
.recherche::placeholder {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition);
}
.recherche.debut {
  color: var(--text-main);
  border-color: var(--border);
}
.recherche.debut::placeholder {
  color: var(--text-light);
}
.recherche.active {
  width: clamp(100px, 25vw, 250px);
}
.recherche:focus {
  border-color: var(--primary);
}
.recherche.debut:focus {
  border-color: var(--primary);
}

/* Compte */
.compte {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}

.information {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  transition: background var(--transition);
}
.information:hover {
  background: rgba(255, 255, 255, 0.15);
}

.compte img {
  width: clamp(18px, 1.6vw, 26px);
  aspect-ratio: 1/1;
  transition: filter var(--transition);
}

.compte p {
  font-size: clamp(11px, 1.1vw, 15px);
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Filter bar */
.filter {
  width: 100%;
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px clamp(12px, 3vw, 48px);
  gap: 6px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  z-index: 99;
}

.item-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: white;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.item-filter:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.item-filter:active {
  transform: translateY(0);
}
.item-filter a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: clamp(10px, 1vw, 13px);
  letter-spacing: 0.01em;
}
.item-filter img {
  height: 14px;
  width: auto;
}

/* ===== HERO ===== */
.imggrand {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: white;
}

.imgdebut {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  display: block;
}

.imggrand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10, 30, 60, 0.72) 0%,
    rgba(0, 0, 0, 0.38) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.hero {
  position: absolute;
  z-index: 2;
  color: white;
  text-align: center;
  padding: clamp(24px, 5vw, 80px) clamp(16px, 5vw, 60px);
  max-width: 700px;
  animation: heroFadeIn 1.1s ease both;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 4.5vw, 62px);
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: clamp(13px, 1.5vw, 19px);
  margin: 0 0 28px;
  opacity: 0.92;
  font-weight: 400;
  line-height: 1.6;
}

.hero button {
  padding: 13px 32px;
  border: none;
  border-radius: 99px;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 700;
  font-family: var(--font-body);
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 6px 24px rgba(240, 122, 26, 0.4);
  letter-spacing: 0.03em;
}
.hero button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(240, 122, 26, 0.5);
}

/* ===== PRODUCT GRID ===== */
#list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(12px, 2vw, 24px);
  width: 100%;
  max-width: 1400px;
  margin: clamp(20px, 3vw, 40px) auto;
  padding: 0 clamp(12px, 3vw, 40px);
}

.image-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  width: calc(50% - 12px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  position: relative;
}
.image-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.image-item a {
  text-decoration: none;
  color: inherit;
  width: 100%;
  display: block;
  overflow: hidden;
  height: clamp(100px, 15vw, 200px);
}

.imgprt {
  width: 150px;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  padding: 5px;
  transition: transform 0.5s ease;
}
.image-item:hover .imgprt {
  transform: scale(1.1);
}

.text-wrapper {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px;
  gap: 5px;
}

.text-wrapper .text0 {
  font-size: clamp(14px, 1.5vw, 18px);
  color: #ffffff;
  background: var(--primary-dark);
  width: 100%;
  text-align: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(10, 110, 189, 0.25);
}

.text-wrapper .text1 {
  font-size: clamp(11px, 1vw, 14px);
  color: var(--text-main);
  width: 100%;
  font-weight: 600;
  line-height: 1.4;
}

.text-wrapper .text2 {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.text2 .quantite {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  transition: border-color var(--transition);
}
.quantite:hover {
  border-color: var(--primary);
}

.text2 .quantite .moins,
.text2 .quantite .plus {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  background: white;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  flex-shrink: 0;
  transition:
    background var(--transition),
    color var(--transition);
}
.text2 .quantite .moins:hover {
  background: #ffeaea;
  color: var(--danger);
}
.text2 .quantite .plus:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.text2 .quantite .tv {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  padding: 0 4px;
  gap: 3px;
}

.text2 .quantite .valeur {
  margin: 0;
  padding: 0;
  text-align: center;
  border: none;
  outline: none;
  font-weight: 700;
  font-size: clamp(11px, 1vw, 14px);
  width: 32px;
  min-width: 20px;
  color: var(--text-main);
}

.text2 .quantite .vlp {
  margin: 0;
  font-size: 0.78em;
  color: var(--text-light);
}

.text2 .commander {
  width: 100%;
  background: var(--success);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px 10px;
  transition:
    background var(--transition),
    transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  font-family: var(--font-body);
}
.text2 .commander:hover {
  background: var(--success-dark);
  transform: scale(1.02);
}
.text2 .commander:active {
  transform: scale(0.98);
}
.text2 .commander p {
  margin: 0;
  font-size: clamp(10px, 0.9vw, 13px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.text2 .commander::before {
  content: "🛒";
  font-size: 13px;
}

@media (min-width: 640px) {
  .image-item {
    width: calc(33.33% - 16px);
  }
}
@media (min-width: 1024px) {
  .image-item {
    width: calc(20% - 20px);
  }
}
@media (min-width: 1400px) {
  .image-item {
    width: calc(16.66% - 20px);
  }
}

/* ===== CART BUBBLE ===== */
.paniercorps {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  box-shadow: 0 4px 20px rgba(10, 110, 189, 0.45);
  z-index: 9999;
  user-select: none;
  padding: 6px;
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}
.paniercorps:hover {
  box-shadow: 0 8px 28px rgba(10, 110, 189, 0.55);
  transform: scale(1.06);
}
.paniercorps:active {
  cursor: grabbing;
}

.panier {
  pointer-events: none;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.paniercorps img {
  width: clamp(20px, 2.5vw, 30px);
  aspect-ratio: 1/1;
}

.paniercorps strong {
  font-weight: 800;
  font-family: var(--font-body);
  margin: 0;
  top: -2px;
  right: -2px;
  font-size: clamp(9px, 0.8vw, 12px);
  position: absolute;
  background: var(--accent);
  color: white;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

/* ===== CART PANEL (BPANIER) ===== */
.bpanier {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  z-index: 500;
  animation: fadeInOverlay 0.25s ease both;
}
@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.contpanier {
  position: fixed;
  top: 0;
  right: 0;
  background: white;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: clamp(280px, 420px, 92vw);
  box-shadow: var(--shadow-xl);
  animation: slideInPanel 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
  z-index: 501;
}
@keyframes slideInPanel {
  from {
    transform: translateX(100%);
    opacity: 0.5;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Cart header */
.tete {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.tete .pan,
.tete .historique {
  display: flex;
  width: 50%;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  cursor: pointer;
  padding: 14px 10px;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  color: var(--text-muted);
}
.tete .pan:hover,
.tete .historique:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.tete .pan.active,
.tete .historique.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  background: white;
}

.tete .logopanier,
.tete .logohistorique {
  display: flex;
  align-items: center;
  gap: 7px;
  width: auto;
}

.tete .logopanier img,
.tete .logohistorique img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tete .quantproduit,
.tete .quanthistorique {
  display: flex;
  align-items: center;
}

.tete p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.tete .pan strong,
.tete .historique p:last-child {
  background: var(--primary);
  color: white;
  border-radius: 99px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Cart body */
.corps {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  overflow-y: auto;
  flex: 1;
  height: 100%;
}

.scrollcorps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px;
}

/* Cart item */
.produitpanier {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow var(--transition);
  animation: slideInItem 0.3s ease both;
}
@keyframes slideInItem {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.produitpanier:hover {
  box-shadow: var(--shadow-md);
}

.teteproduitpanier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.ecritteteproduitpanier {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.contenueproduitpanier {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.produitpanier .imgprt {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.scrollcorps .quantite {
  display: flex;
  flex-direction: row;
  flex: 1;
  gap: 30px;
  padding: 0;
  height: 30px;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.scrollcorps .quantite .tv {
  display: flex;
  text-align: center;
  justify-content: center;
  gap: 10px;
  align-items: center;
}
.scrollcorps .quantite p {
  margin: 0;
}

.scrollcorps .totalproduitpanier {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 2px;
}

.scrollcorps .totalproduitpanier .detailtotalpanier {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
  font-size: 14px;
}

.scrollcorps .totalproduitpanier .detailtotalpanier::after {
  content: " Ar";
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}

#scrollcorpshistorique {
  gap: 30px;
}

.imgproduitpanier {
  width: 22px !important;
  height: 22px !important;
  aspect-ratio: 1/1;
  cursor: pointer;
  opacity: 0.45;
  transition:
    opacity var(--transition),
    transform var(--transition);
  flex-shrink: 0;
  border-radius: 4px;
  padding: 2px;
}
.imgproduitpanier:hover {
  opacity: 1;
  background: #ffeaea;
  transform: scale(1.1);
}

/* Panier footer */
.payement {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.payement-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 4px;
  border-top: 1px dashed var(--border);
}

.payement-total span:first-child {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.tot {
  font-size: 18px;
  font-weight: 800;
  color: var(--danger);
  margin: 0;
}
.tot::after {
  content: " Ar";
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.validpayement {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 14px rgba(26, 158, 92, 0.35);
}
.validpayement:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(26, 158, 92, 0.45);
}
.validpayement:disabled {
  background: var(--border);
  color: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Empty cart */
.pvide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(14px, 1.2vw, 18px);
  color: var(--text-light);
  pointer-events: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pvide::before {
  content: "🛒";
  font-size: 42px;
  opacity: 0.4;
}

/* ===== HISTORIQUE ===== */
.feuillefacture {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideInItem 0.3s ease both;
}

.produitfacture {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.produitfacture p {
  margin: 0;
  font-size: 16px;
}

.majeur {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.majeur .nomprfacture {
  font-weight: 600;
  font-size: 17px;
  color: var(--text-main);
}
.majeur .totalprixprfacture {
  font-weight: 700;
  color: var(--danger);
  font-size: 17px;
}

.mineur {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.tout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.texttotfacture {
  font-weight: 700;
  font-size: 17px;
  color: var(--text-main);
}
.totfacture {
  font-weight: 800;
  color: var(--danger);
  font-size: 15px;
}

/* Modal dialog */
.dialog {
  position: fixed;
  display: none;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 10px;
  background: rgba(10, 15, 30, 0.6);
  backdrop-filter: blur(6px);
  inset: 0;
  z-index: 600;
}

.inter {
  position: relative;
  display: flex;
  gap: 16px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow-xl);
  width: clamp(280px, 80vw, 800px);
  margin: auto;
  animation: modalPop 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.inter .close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 16px;
  transition: background var(--transition);
}
.inter .close:hover {
  background: var(--border);
}
.inter strong {
  white-space: nowrap;
}

.connexion-title,
.inscription-title {
  cursor: pointer;
  background: var(--text-main);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  width: 100%;
  transition: background var(--transition);
  font-weight: 600;
  font-size: 14px;
}
.connexion-title:hover,
.inscription-title:hover {
  background: var(--primary);
}
.connexion-title p,
.inscription-title p {
  margin: 0;
}

.connexion,
.inscription {
  max-height: 0;
  overflow: hidden;
  width: 100%;
  transition: max-height 0.45s ease;
}
.connexion.open,
.inscription.open {
  max-height: 400px;
}

/* Form elements */
.form-group {
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 4px;
  width: 100%;
  padding: 6px 0;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ===== FOOTER ===== */
.fin {
  margin-top: clamp(30px, 4vw, 80px);
  width: 100%;
  background: linear-gradient(135deg, #0a1628 0%, #0f2044 100%);
  color: white;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-around;
  padding: clamp(24px, 4vw, 56px) clamp(16px, 5vw, 64px);
  gap: clamp(16px, 3vw, 40px);
  flex-wrap: wrap;
}

.fin div {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
}

.fin strong {
  font-size: clamp(11px, 1.1vw, 15px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 700;
}

.fin .detail {
  gap: clamp(8px, 1.2vw, 20px);
  align-items: flex-start;
}
.fin .detail .num {
  flex-direction: column;
  align-items: flex-start;
}
.fin .detail .numero,
.fin .detail .whatsapp {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.fin .detail p,
.fin .location p {
  margin: 0 0 3px;
  font-size: clamp(10px, 0.9vw, 13px);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.fin .detail div,
.fin .location div {
  flex-direction: column;
  width: auto;
}

.fin .detail img,
.fin .location img {
  width: clamp(14px, 1.3vw, 20px);
  aspect-ratio: 1/1;
  opacity: 0.85;
  margin-top: 3px;
}

.fin .loc {
  gap: 8px;
  flex-direction: row;
  align-items: flex-start;
  cursor: pointer;
  transition: opacity var(--transition);
}
.fin .loc:hover {
  opacity: 0.8;
}

.fin .imgres {
  flex-direction: row;
  gap: 10px;
}
.fin .imgres img {
  width: clamp(28px, 2.5vw, 38px);
  aspect-ratio: 1/1;
  border-radius: 8px;
  cursor: pointer;
}

.fin .imgpayement {
  flex-direction: row;
  gap: clamp(8px, 1.5vw, 20px);
  align-items: center;
}

.fin .imgpayement div {
  background: white;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  width: auto;
  flex-direction: row;
}

.fin .imgpayement img {
  width: clamp(36px, 3.5vw, 56px);
  height: auto;
}

/* Footer mobile */
@media (max-width: 640px) {
  .fin {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .fin > div {
    width: 100%;
  }
}

/* Valeur contenteditable */
.valeur[contenteditable="true"]:focus {
  outline: none;
}

/* Loading popup */
#loading-popup {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.55);
  backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}
#loading-popup > div {
  background: white;
  padding: 20px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
}
#loading-popup > div::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Alt text fallback */
.alt-text {
  display: none;
  font-size: 100px;
  color: var(--text-light);
}

.phone-text,
.phone-btn,
.phone-input {
  font-size: clamp(10px, 2.5vw, 14px);
}
.phone-input {
  width: clamp(90px, 15vw, 110px);
  padding: 2px;
}
.phone-input[readonly] {
  opacity: 0.7;
}
.phone-btn {
  padding: 2px 5px;
  cursor: pointer;
}

/* Phone Account Form Elements */
#phone_display {
  display: flex;
  gap: 10px;
  align-items: center;
}
.phone-form {
  display: flex;
  gap: 5px;
  margin: 0;
  align-items: center;
  flex-direction: column;
}
#phone_edit_form {
  display: none;
}
.phone-text {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 10px;
  border-radius: 50px;
  font-size: clamp(10px, 2vw, 14px);
  font-weight: 500;
  box-shadow: 0 0 10px rgba(245, 245, 245, 0.5);
  white-space: nowrap;
  cursor: pointer;
}
.phone-text.editable {
  cursor: pointer;
  text-decoration: underline dotted;
}
.pin-input {
  width: 40px;
  text-align: center;
}
.pin-message-success {
  color: #a7f3d0;
  font-size: 13px;
  margin-top: 3px;
  font-weight: bold;
  text-align: center;
}
.pin-message-error {
  color: #ffcccc;
  font-size: 11px;
  margin-top: 3px;
  font-weight: bold;
  text-align: center;
}
.pin-message-info {
  color: #ffffff;
  font-size: 11px;
  margin-top: 3px;
  text-align: center;
}
.generated-pin {
  color: var(--danger);
  font-size: 13px;
  margin-top: 3px;
  font-weight: bold;
  text-align: center;
}

/* Bonus Badge */
.bonus-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: clamp(10px, 2vw, 14px);
  font-weight: 800;
  box-shadow: 0 0 10px rgba(240, 122, 26, 0.5);
  animation: pulseBonus 2s infinite ease-in-out;
  white-space: nowrap;
  cursor: pointer;
}
@keyframes pulseBonus {
  0% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(240, 122, 26, 0.4);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 16px rgba(240, 122, 26, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(240, 122, 26, 0.4);
  }
}

/* Bonus Modal */
#bonus_modal .connexion-title {
  margin-bottom: 10px;
}
#bonus_modal .bonus-desc {
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2px;
}
#bonus_modal form {
  width: 100%;
}
#bonus_modal input {
  text-align: center;
}
#bonus_modal .btn-primary {
  margin-top: 10px;
}

/* Bonus History */
.bonus-history {
  width: 100%;
  margin-top: 24px;
}
.bonus-history h4 {
  text-align: center;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-main);
}
.bonus-history table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.bonus-history thead tr {
  font-size: 14px;
  border-bottom: 1.5px solid var(--border);
  background: var(--primary-light);
  color: var(--text-muted);
}
.bonus-history th {
  background: var(--bg);
  font-size: 13px;
}
.bonus-history th,
.bonus-history td {
  text-align: center;
  padding: 8px;
}
.bonus-history th {
  font-weight: 600;
}
.bonus-history tbody tr:nth-child(even) {
  background: var(--bg-history);
}
.bonus-history tbody tr {
  border-bottom: 1px dashed var(--border);
}
.bonus-history td:first-child {
  color: var(--text-main);
}
.bonus-history td:last-child {
  color: var(--danger);
  font-weight: 700;
}
