/* ========= MODALE IMMERSIVE ========= */

.is-capsule-modal-open {
  overflow: hidden;
}

.capsule-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.capsule-modal.is-open {
  display: block;
}

.capsule-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
}

/* Dialog plus profond, verre md et blur md */
.capsule-modal__dialog {
  position: relative;
  margin: 4vh auto;
  width: min(1000px, calc(100% - 2rem));
  max-height: 92vh;
  border-radius: var(--cap-radius-lg, 16px);
  background: var(--glass-md, rgba(10,10,10,.65));
  backdrop-filter: var(--blur-md, blur(14px));
  -webkit-backdrop-filter: var(--blur-md, blur(14px));
  box-shadow: var(--cap-shadow-soft, 0 18px 40px rgba(0,0,0,.5));
  overflow: hidden;
  color: #fff;
}

/* Bouton de fermeture */
.capsule-modal__close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
}

.capsule-modal__close:hover {
  background: rgba(0,0,0,.75);
}

/* Contenu interne */
.capsule-modal__content {
  padding: var(--cap-pad-lg, 2rem);
  overflow: auto;
  max-height: 92vh;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,.35),
    rgba(0,0,0,.55)
  );
}

/* état chargement */
.capsule-modal.is-loading .capsule-modal__content {
  position: relative;
}

.capsule-modal.is-loading .capsule-modal__content::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(closest-side, rgba(255,255,255,.35), transparent) center/80px 80px no-repeat,
    rgba(0,0,0,.35);
  animation: capsulePulse 1.2s infinite ease-in-out;
}

@keyframes capsulePulse {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

/* ========= Corrections spécifiques au contenu Woo dans la modale ========= */

/* 1 - supprimer l'énorme image de tête du thème dans la modale */
#capsule-modal .featured-image.page-header-image-single,
#capsule-modal .page-header-image-single {
  display: none;
}

/* supprimer le gros espace haut lié au header thème */
#capsule-modal .inside-article {
  padding-top: 0;
}

/* 2 - limiter la taille de l'image principale produit dans la modale */
#capsule-modal .tyshara-product-image-large img {
  max-height: 60vh;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* 3 - améliorer la lisibilité des textes sur fond sombre */
#capsule-modal .entry-content,
#capsule-modal .woocommerce-standard-product,
#capsule-modal .tyshara-description {
  background: rgba(0,0,0,.45);
  border-radius: 14px;
  padding: 1.5rem;
}

/* éviter les blocs trop serrés */
#capsule-modal .tyshara-description {
  margin-top: 2rem;
}

/* couleur du texte et liens dans la modale */
#capsule-modal .entry-content,
#capsule-modal .entry-content p,
#capsule-modal .entry-content li,
#capsule-modal .tyshara-description,
#capsule-modal .tyshara-description p {
  color: #f7f5f3;
}

#capsule-modal a {
  color: #ffe6b8;
}

#capsule-modal a:hover {
  color: #fff3cf;
}

/* virer le fil d'Ariane dans la modale pour alléger */
#capsule-modal .woocommerce-breadcrumb {
  display: none;
}

/* messages Woo */
.capsule-modal .woocommerce-message,
.capsule-modal .woocommerce-error,
.capsule-modal .woocommerce-info {
  margin: 1rem 0;
}
/* Correctif bloc "Ajouter au panier" dans la modale */
#capsule-modal .tyshara-product-summary {
  background: rgba(255,252,246,.96); /* ton crème */
  border-radius: 18px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  color: #2b2220; /* texte foncé lisible */
}

/* Remettre une couleur lisible sur tout le texte du bloc */
#capsule-modal .tyshara-product-summary p,
#capsule-modal .tyshara-product-summary span,
#capsule-modal .tyshara-product-summary .price,
#capsule-modal .tyshara-product-summary .stock {
  color: #2b2220;
}

/* Micro-typo pour le prix et le stock */
#capsule-modal .tyshara-product-summary .price {
  font-size: 1.1rem;
  margin-bottom: .25rem;
}

#capsule-modal .tyshara-product-summary .stock {
  font-size: .95rem;
  opacity: .9;
  margin-bottom: 1rem;
}

/* Bouton "Ajouter au panier" dans la modale */
#capsule-modal .tyshara-product-summary .single_add_to_cart_button {
  width: 100%;
  margin-top: .75rem;
  border-radius: 999px;
  background: #403949;
  color: #fff;
  border: none;
}

#capsule-modal .tyshara-product-summary .single_add_to_cart_button:hover {
  background: #554f63;
}
