/* Overlay */
.osc-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #00000026;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 998;
  }
  
  /* Side‑cart container (ouverture depuis la droite) */
  .osc-sidecart {
    font-family: 'Inter', sans-serif;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 8px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
  }

  .admin-bar .osc-sidecart {
    height: calc(100% - 32px);
    top: 32px;
  }

  .osc-open .osc-overlay {
    opacity: 1;
    visibility: visible;
  }
  .osc-open .osc-sidecart {
    transform: translateX(0);
  }

  .osc-cart-list {
    overflow: auto;
    overflow-x: hidden;
  }

  .osc-content {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .osc-main-cart-container {
    overflow-x: auto;
    height: 100%;
  }
  
  /* Close button */
  .osc-top {
    display: flex;
    align-items: center;
    padding: 20px 20px 0 20px;
  }

  .top-grid svg {
    display: block;
    margin-bottom: 10px;
  }

  .osc-close svg {
    height: 30px;
    width: fit-content;
    cursor: pointer;
    transition: .3s all;
  }

  .osc-close svg:hover {
    opacity: .7;
  }
  
  /* Empty message */
  .osc-empty {
    padding: 20px;
    text-align: center;
  }

  .osc-content.cart-empty {
    align-items: center;
    justify-content: center;
  }

  .cart-empty .osc-main-cart-container {
    display: none;
  }
  
  /* Cart list & items */
  .osc-cart-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
  }

  .osc-cart-list li {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
  }

  .mid-grid {
    display: flex;
    gap: 20px;
  }

  .osc-remove-item {
    cursor: pointer;
  }
  
  /* Vignette produit */
  .mid-grid .illu {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    text-align: center;
    background: #f9f9f9;
  }

  .mid-grid .illu img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    height: 100%;
  }
  
  /* Description */
  .mid-grid .description {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* En-tête du produit (nom + label) */
  .osc-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .osc-item-name {
    font-family: "EB Garamond", Sans-serif;
    color: var(--e-global-color-primary);
    font-style: italic;
    font-weight: 500;
    font-size: 19px;
    line-height: 19px;
  }
  
  /* Label Goodies */
  .osc-item-label {
    font-family: "Inter", sans-serif;
    color: #fff;
    font-size: 9px;
    font-weight: 400;
    text-transform: uppercase;
    margin-top: 2px;
    background: var(--e-global-color-primary);
    padding: 5px 10px;
    border-radius: 20px;
  }

  /* Description du produit */
  .osc-item-description {
    font-family: "Inter", sans-serif;
    color: var(--e-a-dark-color-txt);
    font-size: 11px;
    line-height: 1.4;
    margin-top: 6px;
    opacity: 0.9;
  }
  
  .osc-item-subtotal {
    margin-left: 0.5rem;
  }
  
  /* Contrôle quantité −/＋ */
  .osc-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ececee;
    border-radius: 5px;
    overflow: hidden;
    max-width: 70px;
    min-width: 70px;
    max-height: 20px;
  }
  .osc-qty-btn {
    background-color: transparent!important;
    color: var(--e-global-color-primary)!important;
    font-size: 13px!important;
    padding: 5px !important;
    font-weight: normal!important;
    border: 0;
}
  .osc-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .osc-qty-btn:disabled:hover {
    background-color: transparent !important;
  }
  input.osc-quantity-input {
    border: 0!important;
    font-size: 11px;
    color: var(--e-global-color-primary)!important;
    padding: 0!important;
  }

  /* Prix d'un produit */
  .mid-grid .pricing {
    font-size: 14px;
    text-align: right;
    color: var(--e-global-color-secondary);
  }

  .mid-grid .pricing .woocommerce-Price-amount {
    font-family: "El Messiri", Sans-serif;
    font-size: 16px;
    font-weight: 600;
  }

  /* champ qty (readonly) */
  .osc-quantity-input {
    width: 2.5rem;
    text-align: center;
    border: none;
    outline: none;
    font-size: 20px;
    background: transparent;
  }

  .osc-quantity-input::-webkit-outer-spin-button,
  .osc-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Chrome */
    margin: 0;
  }
  
  /* Checkout container (total + bouton) */
  .osc-checkout-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eceeec;
    width: 100%;
    bottom: 0;
  }

  .osc-checkout-container .total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .osc-checkout-container .title-total {
    color: var(--e-global-color-primary);
    font-weight: 600;
    font-size: 14px;
  }

  .osc-checkout-container .osc-total-price {
    font-family: 'El Messiri';
    color: var(--e-global-color-primary);
    font-weight: bold;
  }

  /* Bundles */
  .osc-cart-children {
    padding: 0;
    list-style: none;
  }

  .osc-cart-children li {
    border: 0;
    padding: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    position: relative;
  }

  .osc-cart-children .illu {
    height: 40px;
    width: 60px;
  }

  .osc-cart-children .osc-item-name {
    color: var(--e-global-color-secondary);
    font-size: 15px;
    font-weight: 400;
    opacity: 0.8;
  }

  .osc-cart-children .mid-grid {
    gap: 12px;
  }

  /* Checkout button */
  #osc-checkout-button {
    border: none;
    cursor: pointer;
    width: 100%;
    position: relative;
  }

  #osc-checkout-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  /* Spinner styling */
  #osc-checkout-button.loading {
    color: transparent;
  }
  #osc-checkout-button.loading::after {
    content: "";
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px; height: 16px;
    margin-top: -8px; margin-left: -8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: osc-spinner 0.6s linear infinite;
  }
  @keyframes osc-spinner {
    to { transform: rotate(360deg); }
  }
  
/* Spinner pour le bouton Ajouter au panier */
.single_add_to_cart_button.loading,
.add_to_cart_button.ajax_add_to_cart.loading {
  color: transparent !important;
  position: relative;
}
.single_add_to_cart_button.loading::after,
.add_to_cart_button.ajax_add_to_cart.loading::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px; height: 16px;
  margin-top: -8px; margin-left: -8px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: osc-spinner 0.6s linear infinite;
}

/* Bouton panier SVG */
.optimistic-cart-button {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--osc-svg-color, currentColor); /* Variable CSS pour la couleur du SVG */
}
/* Couleur du SVG = text-color courant */
.optimistic-cart-button svg path {
  fill: currentColor;
}

.optimistic-cart-button .header-cart-count {
  font-style: normal;
  font-size: 16px!important;
  line-height: 21px;
  font-family: "EB Garamond", Sans-serif;
  min-width: 21px;
  height: 21px;
  font-weight: 600;
  position: absolute !important;
  top: -3px;
  right: -8px;
}

/* Cercle rouge derrière le chiffre */
.cart-count-bg {
  fill: var(--osc-count-bg-color, #e74c3c); /* Variable CSS pour le background */
}
/* Texte blanc centré */
.cart-count-text {
  fill: var(--osc-count-text-color, #fff); /* Variable CSS pour le texte */
  font-size: 10px;
  font-family: sans-serif;
  pointer-events: none;
}

/* Style pour le compteur header-cart-count */
.header-cart-count {
  background-color: var(--osc-count-bg-color, #e74c3c) !important;
  color: var(--osc-count-text-color, #ffffff) !important;
  border-radius: 50% !important;
  display: inline-block !important;
  min-width: 20px !important;
  height: 20px !important;
  line-height: 20px !important;
  text-align: center !important;
  font-size: 12px !important;
  position: relative !important;
}

/* Gestion du panier vide */
.osc-empty-full {
  display: none;
  padding: 20px;
  text-align: center;
  font-size: 16px;
  color: var(--e-global-color-secondary);
}

.osc-content.cart-empty .osc-empty-full {
  display: block;
}

.osc-content.cart-empty .osc-cart-list,
.osc-content.cart-empty #osc-progress-container,
.osc-content.cart-empty .osc-checkout-container {
  display: none;
}

/* Styles pour l'élément virtuel du panier */
.osc-cart-item-virtual {
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

.osc-cart-item-virtual .osc-item-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

.osc-cart-item-virtual .osc-item-name {
  color: #999;
}

.osc-cart-item-virtual .osc-item-subtotal {
  color: #999;
}

.osc-cart-item-virtual .osc-qty-control {
  opacity: 0.5;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Animation de transition */
.osc-cart-item {
  transition: all 0.3s ease-out;
  will-change: transform, opacity;
}

.osc-cart-item.osc-cart-item-virtual {
  will-change: transform, opacity;
}

/* Animation de rotation pour le spinner de suppression */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Quand le panier est vide */
.osc-content.cart-empty .osc-top{
  position: absolute;
  top: 0;
  left: 0;
}