@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --purple: #454287;
  --stage: #a7a7a8;
  --black: #0a0a0a;
  --muted: #777;
  --font: "Source Sans 3", "Source Sans Pro", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.status-bar,
.browser-bar {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: #f5f5f5;
  color: var(--black);
  font-family: var(--font);
}

body {
  display: flex;
  justify-content: center;
}

.phone-page {
  position: relative;
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  background: #fff;
  overflow-x: hidden;
}

.top-shell {
  position: relative;
  top: 0;
  z-index: 10;
  background: #fff;
}

.status-bar {
  height: 0;
  padding: 0 38px 0 45px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  background: #eee;
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
}

.browser-bar {
  height: 82px;
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  background: #eee;
}

.icon-button,
.more-button,
.language,
.zoom,
.side-arrow,
.buttonicon,
.nav-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.brand-area {
  height: 92px;
  display: grid;
  grid-template-columns: 92px 1fr 70px;
  align-items: center;
  padding: 10px 0 6px;
  background: #fff;
}

.check-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin-left: 19px;
}

.brand-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  transform: translateY(-2px);
}

.brand-logos img {
  flex-shrink: 1;
}

.brand-logos img:first-child {
  width: 137px;
  height: auto;
}

.brand-logos img:last-child {
  width: 112px;
  height: auto;
}

.brand-logos span {
  font-size: 9px;
  font-weight: 700;
}

.language {
  position: relative;
  justify-self: start;
  width: 68px;
  height: 46px;
  padding: 0 22px 0 8px;
  border: 1px solid #cfcfcf !important;
  border-radius: 7px;
  font-size: 23px;
  font-weight: 800;
  color: #000 !important;
  -webkit-text-fill-color: #000;
  background: #fff !important;
  cursor: default;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.language::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 5px 0 5px;
  border-color: #666 transparent transparent transparent;
  transform: translateY(-35%);
  pointer-events: none;
}

.tabs {
  height: 58px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  background: #fff;
  overflow: hidden;
}

.tabs a {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #050505;
  text-decoration: none;
  font-size: 21px;
  font-weight: 700;
  min-width: 0;
}

.tabs a.active::after {
  content: "";
  position: absolute;
  left: 19%;
  right: 19%;
  bottom: 4px;
  height: 4px;
  background: #000;
}

/* ========== Shared stage ========== */
.purple-stage,
.page-stage {
  position: relative;
  padding: 18px 9px 88px;
  min-height: calc(100vh - 150px);
  background-color: var(--stage);
  background-image: url("../image/fond.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.certificate-card,
.info-card,
.content-panel {
  width: calc(100% - 20px);
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 10px #0000001a;
  overflow: hidden;
}

.rule,
.hr-styled {
  height: 1px;
  border: 0;
  background: #e5e5e5;
  width: 100%;
  margin: 5px 0;
}

h1,
.cvl-title {
  margin: 7px 0 5px;
  text-align: center;
  font-size: 23px;
  line-height: 1.1;
  font-weight: 700;
}

.document-preview {
  position: relative;
  width: min(250px, 58vw);
  margin: 18px auto 30px;
}

.document-preview img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 292 / 422;
  object-fit: cover;
  object-position: top center;
}

.zoom {
  position: absolute;
  top: 2px;
  right: 10px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #3c3a3d;
  cursor: default;
}

.zoom::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 13px;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
}

.zoom::after {
  content: "";
  position: absolute;
  top: 34px;
  left: 33px;
  width: 17px;
  height: 4px;
  border-radius: 4px;
  background: #fff;
  transform: rotate(45deg);
  transform-origin: left center;
}

.content {
  padding: 0 10px;
  max-width: 100%;
  font-size: 16px;
  line-height: 1.35;
  min-width: 0;
}

.intro {
  margin: 0 0 16px;
  text-align: justify;
  overflow-wrap: break-word;
}

ul.product-list {
  margin: 2px 7px;
  padding-left: 10px;
}

ul.product-list li {
  list-style-position: inside;
  margin: 0 0 8px;
  padding-left: 0;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.country {
  margin: 24px 0 20px;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.country strong {
  font-weight: 700;
}

.actions {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.actions a,
.actions button {
  width: min(100%, 250px);
  max-width: 100%;
  min-height: 48px;
  padding: 15px 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.15;
  text-align: center;
  font-family: inherit;
  border: 0;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.actions a:hover,
.actions button:hover {
  background: #333;
}

.actions button {
  cursor: default;
}

/* ========== Info tabs (Pourquoi / Qui / Quand) ========== */
.info-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 420px;
  padding: 16px 16px 28px;
}

.org-logo {
  display: block;
  width: min(200px, 70%);
  height: auto;
  margin: 8px auto 18px;
  object-fit: contain;
}

.info-body {
  width: 100%;
  padding: 0 10px;
  font-size: 15px;
  line-height: 1.45;
  text-align: justify;
  color: #111;
}

.info-body p {
  margin: 7px 0;
}

.info-body a {
  color: #4271b8;
  font-weight: 700;
  text-decoration: none !important;
  -webkit-text-decoration-line: none;
  text-decoration-line: none;
  border-bottom: 0;
}

.info-body a:link,
.info-body a:visited,
.info-body a:hover,
.info-body a:active {
  text-decoration: none !important;
  -webkit-text-decoration-line: none;
  text-decoration-line: none;
}

.info-body strong {
  font-weight: 700;
}

.video-container {
  width: 100%;
  text-align: center;
  margin: 20px 0 8px;
}

.video-container video {
  width: 100%;
  max-width: 300px;
  height: auto;
  border: 2px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 8px #0003;
  background: #000;
}

/* ========== Quand historique ========== */
.historique {
  width: 100%;
  padding: 8px 6px 0;
}

.historique-ligne {
  display: grid;
  grid-template-columns: 120px 1fr;
  column-gap: 16px;
  align-items: start;
  margin-bottom: 10px;
}

.col-date {
  font-weight: 700;
  color: #000;
  font-size: 16px;
}

.col-text {
  color: #999;
  font-size: 14px;
  line-height: 1.35;
}

/* ========== Où map ========== */
.where-stage {
  padding: 16px;
  align-items: stretch;
  min-height: calc(100vh - 150px);
}

.where-panel {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px;
  background: #fff;
  box-shadow: 0 4px 10px #0000001a;
  border-radius: 0;
  overflow: visible;
}

.map-container {
  position: relative;
  width: 100%;
  background: #ddd;
  border-radius: 8px;
  overflow: visible;
  box-shadow: 0 4px 10px #0000001a;
}

#map {
  height: calc(100vh - 190px);
  min-height: 480px;
  width: 100%;
  border-radius: 8px;
  z-index: 1;
  background: #ddd;
}

/* Leaflet +/- zoom controls (match reference) */
.leaflet-control-zoom {
  border: 2px solid rgba(0, 0, 0, 0.2) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  margin: 12px 0 0 12px !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #000 !important;
  background: #fff !important;
  text-decoration: none !important;
  display: block !important;
  text-align: center !important;
}

.leaflet-control-zoom a:hover {
  background: #f4f4f4 !important;
  color: #000 !important;
}

.leaflet-control-zoom-in {
  border-bottom: 1px solid #ccc !important;
  border-top-left-radius: 2px !important;
  border-top-right-radius: 2px !important;
}

.leaflet-control-zoom-out {
  border-bottom-left-radius: 2px !important;
  border-bottom-right-radius: 2px !important;
}

.leaflet-control-attribution {
  font-size: 10px !important;
}

.leaflet-marker-icon {
  border: 0 !important;
  background: transparent !important;
}

.leaflet-popup-content {
  margin: 10px 14px 10px 12px;
  line-height: 1.35;
  font-size: 13px;
}

.leaflet-popup-content strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.category-bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  padding: 7px 10px;
  border-radius: 8px;
  z-index: 1000;
  width: 170px;
  height: 40px;
}

.category-info {
  text-align: center;
  cursor: pointer;
  position: relative;
  width: 150px;
}

.category-info h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.nav-btn {
  position: absolute;
  bottom: 1px;
  width: 30px;
  height: 40px;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px #0000004d;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
  z-index: 1001;
}

.prev-btn {
  left: -48px;
}

.next-btn {
  right: -48px;
}

.nav-btn:hover {
  background: #fff;
  color: #000;
  transform: scale(1.1);
}

.nav-btn[hidden] {
  display: none !important;
}

.address-list {
  position: absolute;
  bottom: 35px;
  left: -7%;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  z-index: 1000;
  padding: 15px;
  box-shadow: 0 4px 10px #0003;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 8px;
  width: 170px;
  font-family: var(--font);
}

.address-list[hidden] {
  display: none !important;
}

.address-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.address-list li {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.address-list li:last-child {
  border-bottom: none;
}

.itemname {
  display: block;
  color: #010101;
  font-weight: 700;
  font-size: 14px;
}

.itemadress {
  display: block;
  font-size: 13px;
  color: #9b9999;
  margin-top: 4px;
  line-height: 1.3;
}

/* ========== Side arrows ========== */
.side-arrow {
  position: fixed;
  top: 50%;
  width: 34px;
  height: 70px;
  z-index: 9;
  transform: translateY(-50%);
  display: block;
  text-decoration: none;
}

.side-arrow.left {
  left: 0;
}

.side-arrow.right {
  right: 0;
}

.side-arrow::before,
.side-arrow::after {
  content: "";
  position: absolute;
  left: 14px;
  width: 5px;
  height: 38px;
  border-radius: 5px;
  background: #fff;
}

.side-arrow.left::before {
  top: 4px;
  transform: rotate(39deg);
}

.side-arrow.left::after {
  bottom: 4px;
  transform: rotate(-39deg);
}

.side-arrow.right::before {
  top: 4px;
  transform: rotate(-39deg);
}

.side-arrow.right::after {
  bottom: 4px;
  transform: rotate(39deg);
}

.side-arrow img {
  display: none;
}

.home-indicator {
  position: fixed;
  left: 50%;
  bottom: 18px;
  width: 196px;
  height: 6px;
  border-radius: 99px;
  background: #b9b9b9;
  transform: translateX(-50%);
  z-index: 20;
}

@media (max-width: 520px) {
  body {
    justify-content: center;
  }

  .phone-page {
    width: 100vw;
    max-width: none;
  }

  .brand-area {
    height: 72px;
    grid-template-columns: 46px minmax(0, 1fr) 48px;
    padding: 10px 0 6px;
  }

  .check-logo {
    margin-left: 11px;
    width: 28px;
    height: 28px;
  }

  .brand-logos {
    gap: 6px;
  }

  .brand-logos img:first-child {
    width: 88px;
  }

  .brand-logos img:last-child {
    width: 74px;
  }

  .language {
    width: 48px;
    height: 32px;
    padding: 0 16px 0 6px;
    font-size: 18px;
  }

  .language::after {
    right: 7px;
    border-left-width: 4px;
    border-right-width: 4px;
    border-top-width: 5px;
  }

  .tabs {
    height: 54px;
  }

  .tabs a {
    height: 48px;
    font-size: 17px;
  }

  .purple-stage,
  .page-stage {
    padding: 16px 12px 72px;
  }

  .certificate-card,
  .info-card,
  .content-panel {
    width: 100%;
    padding: 16px 14px 28px;
  }

  .document-preview {
    width: min(210px, 54vw);
    margin: 16px auto 26px;
  }

  .content {
    padding: 0 6px;
    font-size: 15px;
  }

  .intro {
    margin-bottom: 14px;
    text-align: left;
  }

  ul.product-list li {
    font-size: 15px;
  }

  .country {
    margin: 20px 0 16px;
    font-size: 15px;
  }

  .actions a,
  .actions button {
    width: 100%;
    max-width: 280px;
    min-height: 48px;
    font-size: 14px;
  }

  .info-card {
    min-height: 360px;
  }

  .info-body {
    padding: 0 4px;
    font-size: 14px;
  }

  .org-logo {
    width: min(180px, 72%);
  }

  .historique-ligne {
    grid-template-columns: 96px 1fr;
    column-gap: 10px;
  }

  .col-date {
    font-size: 14px;
  }

  .col-text {
    font-size: 13px;
  }

  #map {
    height: calc(100vh - 170px);
    min-height: 420px;
  }

  .leaflet-control-zoom a {
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    font-size: 20px !important;
  }

  .category-bar {
    width: 160px;
  }

  .prev-btn {
    left: -42px;
  }

  .next-btn {
    right: -42px;
  }

  .address-list {
    width: 160px;
    left: -4%;
  }
}

@media (min-width: 768px) {
  .tabs a {
    font-size: 16px;
    padding: 0 8px;
  }

  #map {
    height: 78vh;
  }

  .category-info h3 {
    font-size: 16px;
  }
}
