/* Mini-panier du header (bouton « Certifier » quand le panier n'est pas vide).
   Chargé depuis include/php/header.php, logique dans include/js/cart-badge.js. */

header .hcart {
  position: relative;
  display: flex;
  align-items: center;
}

.hcart-menu {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 360px;
  padding: 16px;
  box-sizing: border-box;
  background: #262626;
  border: 1px solid #363636;
  border-radius: 8px;
  box-shadow: 0 10px 10px 3px rgba(0, 0, 0, .3);
  color: #A3A3A3;
  text-transform: none;
  letter-spacing: normal;
  font-family: Inter, sans-serif;
  z-index: 999999;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}

.hcart-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 46px;
  width: 14px;
  height: 14px;
  background: #262626;
  border-left: 1px solid #363636;
  border-top: 1px solid #363636;
  border-radius: 3px 0 0 0;
  transform: rotate(45deg);
}

.hcart.open .hcart-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.hcart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #FAFAFA;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.hcart-count {
  font-size: 13px;
  font-weight: 500;
  color: #A3A3A3;
}

.hcart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 262px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.hcart-list.is-scroll {
  -webkit-mask-image: linear-gradient(#000 80%, transparent);
  mask-image: linear-gradient(#000 80%, transparent);
}

.hcart-list.is-scroll.at-end {
  -webkit-mask-image: none;
  mask-image: none;
}

.hcart-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #333;
}

.hcart-list li:first-child {
  border-top: 0;
}

.hcart-thumb {
  flex: 0 0 30px;
  width: 30px;
  height: 42px;
  border-radius: 3px;
  background: #1A1A1A;
  overflow: hidden;
}

.hcart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hcart-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hcart-name {
  color: #FAFAFA;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hcart-set {
  font-size: 12px;
  color: #8A8A8A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hcart-more {
  font-size: 13px;
  color: #A3A3A3;
  padding: 6px 0 0;
}

.hcart-more:empty {
  display: none;
}

.hcart-hint {
  margin: 12px 0 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #8A8A8A;
}

.hcart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hcart-pay,
.hcart-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}

.hcart-pay {
  background: #FFD179;
  border: 1px solid #FFD179;
  color: #121212;
}

.hcart-pay:hover {
  background: #FFDC99;
}

.hcart-pay[disabled] {
  opacity: .6;
  cursor: wait;
}

.hcart-add {
  background: transparent;
  border: 1px solid #4A4A4A;
  color: #EEE;
}

.hcart-add:hover {
  background: #1E1E1E;
  border-color: #EEE;
}

@media screen and (max-width: 600px) {
  .hcart-menu {
    position: fixed;
    top: var(--hcart-top, 70px);
    left: 12px;
    right: 12px;
    width: auto;
  }
  .hcart-menu::before {
    right: var(--hcart-arrow, 90px);
  }
}

/* séparateurs (même trait que les dropdowns « Découvrir PCC » / « Services ») */
header .hcart-menu .separator {
  max-width: 100%;
  margin: 0;
}
.hcart-head + .separator {
  margin-bottom: 4px;
}
.hcart-more + .separator {
  margin-top: 6px;
}

/* bouton croix : retirer une carte du panier */
.hcart-info {
  flex: 1 1 auto;
}
.hcart-rm {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #8A8A8A;
  cursor: pointer;
  transition: color .2s, background-color .2s, border-color .2s;
}
.hcart-rm:hover,
.hcart-rm:focus-visible {
  color: #FAFAFA;
  background: #1E1E1E;
  border-color: #4A4A4A;
  outline: none;
}
