/* ===========================================================================
 * vw-cart-voucher.css
 * Restyle du bloc "Code promo" (cart-voucher) sur la page panier verywood.eu
 * Thème : hummingbird.
 * Objectif : s'intégrer au récap panier sombre (fond sombre, texte clair,
 * input visible, bouton "Appliquer" discret aligné avec la charte orange).
 * ========================================================================= */

/* ------- Accordion header "Code promo" ------- */
.cart-voucher__accordion {
  margin-top: 8px !important;
}

.cart-voucher__accordion-item,
.cart-voucher__accordion .accordion-item {
  background: transparent !important;
  border: none !important;
}

.cart-voucher__accordion-button {
  background: transparent !important;
  color: #ffffff !important;
  padding: 12px 0 !important;
  font-weight: 500 !important;
  font-size: 0.95rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}

.cart-voucher__accordion-button:not(.collapsed),
.cart-voucher__accordion-button:focus,
.cart-voucher__accordion-button:hover {
  background: transparent !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* Chevron : rend blanc sur fond sombre */
.cart-voucher__accordion-button::after {
  filter: invert(1) brightness(1.4) !important;
  opacity: 0.6;
}

/* ------- Zone pliée (accordion body) ------- */
.cart-voucher__accordion .accordion-body {
  background: transparent !important;
  padding: 4px 0 12px 0 !important;
}

/* ------- Form (input + bouton) ------- */
.cart-voucher__form {
  display: flex !important;
  gap: 8px !important;
  align-items: stretch !important;
  margin: 0 !important;
}

.cart-voucher__form .js-voucher-input,
.cart-voucher__form input[name="discount_name"] {
  flex: 1 1 auto !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  padding: 10px 14px !important;
  border-radius: 6px !important;
  font-size: 0.9rem !important;
  min-width: 0;
  transition: border-color .15s ease, background .15s ease;
}

.cart-voucher__form .js-voucher-input::placeholder,
.cart-voucher__form input[name="discount_name"]::placeholder {
  color: rgba(255, 255, 255, 0.45) !important;
  text-transform: none !important;
}

.cart-voucher__form .js-voucher-input:focus,
.cart-voucher__form input[name="discount_name"]:focus {
  background: rgba(255, 255, 255, 0.11) !important;
  border-color: rgba(255, 120, 0, 0.7) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(255, 120, 0, 0.12) !important;
}

/* ------- Bouton "Appliquer" ------- */
.cart-voucher__form .btn,
.cart-voucher__form button[type="submit"] {
  background: linear-gradient(135deg, #ff7a00, #ff9f45) !important;
  border: none !important;
  color: #ffffff !important;
  padding: 10px 18px !important;
  border-radius: 6px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.cart-voucher__form .btn:hover,
.cart-voucher__form button[type="submit"]:hover {
  background: linear-gradient(135deg, #e86d00, #ff9030) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 120, 0, 0.25);
}

.cart-voucher__form .btn:active,
.cart-voucher__form button[type="submit"]:active {
  transform: translateY(0);
}

/* ------- Messages d'erreur ------- */
.cart-voucher__error {
  margin-top: 8px !important;
  background: rgba(220, 53, 69, 0.15) !important;
  border: 1px solid rgba(220, 53, 69, 0.4) !important;
  color: #ff9a9a !important;
  padding: 8px 12px !important;
  font-size: 0.85rem !important;
}

/* ------- Liste des bons disponibles (si visible) ------- */
.cart-voucher__highlight {
  margin-top: 10px !important;
  color: rgba(255, 255, 255, 0.85);
}

.cart-voucher__code-value {
  background: rgba(255, 120, 0, 0.15) !important;
  color: #ff9f45 !important;
  border: 1px dashed rgba(255, 120, 0, 0.5) !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  font-family: monospace;
}

/* ------- Notifications globales (alerts) ------- */
/* Le header est sticky au-dessus du contenu. Sans ces règles, les alertes
 * (succès / erreur, ex. mauvais code promo) passent DERRIÈRE le menu : on ne
 * voit plus le texte ni le bouton de fermeture. On push les alerts au-dessus
 * du header et on garde une marge top pour qu'elles soient visibles. */
.notifications-container .alert,
.alert.alert-dismissible {
  position: relative !important;
  z-index: 1060 !important; /* > sticky header (~1020) et dropdown (~1030) */
  margin-top: calc(var(--vw-header-h, 120px) + 16px) !important;
  margin-bottom: 16px !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Le bouton X : toujours à droite via positionnement Bootstrap natif, visible */
.alert.alert-dismissible {
  padding-right: 3.5rem !important; /* laisser la place pour la croix */
}
.alert.alert-dismissible .btn-close {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  z-index: 2 !important;
  padding: 1.1rem 1.25rem !important;
  opacity: 0.8;
  background-color: transparent;
  /* icône X SVG blanche pour contraste sur fond rouge sombre */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1em;
  cursor: pointer;
}
.alert.alert-dismissible .btn-close:hover {
  opacity: 1;
}
