/* ══════════════════════════════════════════════════════════════════════
   ORDER SUMMARY — Revolutionary Feng-Shui Design System (.os-*)
   Movetan 2026 — The future of cart/checkout UX
   ══════════════════════════════════════════════════════════════════════ */

/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes os-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes os-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
@keyframes os-badge-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes os-total-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); color: #6ac045; }
  100% { transform: scale(1); }
}
@keyframes os-shine {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* ── Sticky wrapper ─────────────────────────────────────────────────── */
.os-sidebar-sticky {
  position: sticky;
  top: 90px;
  z-index: 10;
  align-self: flex-start;
}

/* ── Card ────────────────────────────────────────────────────────────── */
.os-card {
  border-radius: 16px;
  border: 1.5px solid #e8ece5;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
.os-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
}

/* ── Header ──────────────────────────────────────────────────────────── */
.os-header {
  position: relative;
  background: linear-gradient(135deg, #f8faf6 0%, #f0f7ec 100%);
  padding: 20px 24px 16px;
}
.os-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: #6ac045;
}
.os-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.os-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}
.os-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a2e;
  font-size: 14px;
}
.os-count-badge {
  min-width: 28px;
  height: 28px;
  border-radius: 14px;
  background: #1a1a2e;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  line-height: 1;
}
.os-count-badge.os-pulse {
  animation: os-badge-pulse 0.4s ease;
}

/* ── Event rows ──────────────────────────────────────────────────────── */
.os-events {
  padding: 8px 16px;
}
.os-event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: transparent;
  transition: background 0.2s ease;
  margin-bottom: 4px;
}
.os-event-row:hover {
  background: rgba(0, 0, 0, 0.02);
}
.os-event-thumb {
  width: 48px;
  min-width: 48px;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.os-event-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.os-event-info {
  flex: 1;
  min-width: 0;
}
.os-event-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  line-height: 1.3;
}
.os-event-meta {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.os-event-meta i {
  margin-right: 3px;
  font-size: 10px;
}
.os-event-amount {
  text-align: right;
  flex-shrink: 0;
}
.os-event-subtotal {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}
.os-event-currency {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Ticket lines (checkout only) ────────────────────────────────────── */
.os-ticket-lines {
  padding: 4px 12px 8px 72px;
}
.os-ticket-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #717171;
  padding: 2px 0;
}
.os-ticket-qty {
  color: #555;
  font-weight: 600;
  margin-right: 4px;
}
.os-ticket-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}
.os-ticket-price {
  flex-shrink: 0;
  font-weight: 500;
}

/* ── Discount badges ─────────────────────────────────────────────────── */
.os-discount-badge {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #fef3f2;
  color: #e74c3c;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  width: fit-content;
  animation: os-badge-in 0.3s ease;
}
.os-discount-badge i {
  font-size: 9px;
}
.os-event-original {
  text-decoration: line-through;
  color: #bbb;
  font-size: 12px;
  font-weight: 400;
  margin-right: 4px;
}

/* ── Dividers ────────────────────────────────────────────────────────── */
.os-divider {
  height: 1px;
  margin: 4px 24px;
  background: linear-gradient(90deg, transparent, #e0e0e0 30%, #e0e0e0 70%, transparent);
}

/* ── Promo section ───────────────────────────────────────────────────── */
.os-promo {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
}
.os-promo-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.os-promo-field {
  display: flex;
  gap: 8px;
}
.os-promo-input-wrap {
  flex: 1;
  position: relative;
}
.os-promo-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  font-size: 13px;
  pointer-events: none;
}
.os-promo-input {
  width: 100%;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 12px 10px 34px;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.os-promo-input:focus {
  border-color: #6ac045;
  box-shadow: 0 0 0 3px rgba(106, 192, 69, 0.12);
}
.os-promo-btn {
  border: none;
  background: #6ac045;
  color: #fff;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.os-promo-btn:hover {
  background: #5db03a;
  transform: translateY(-1px);
}
.os-promo-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border: 1px solid #c8e6c9;
}
.os-promo-applied-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #2e7d32;
}
.os-promo-applied-text i {
  font-size: 15px;
}
.os-promo-remove {
  cursor: pointer;
  color: #999;
  font-size: 14px;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.os-promo-remove:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
}
.os-promo-error {
  font-size: 12px;
  color: #e74c3c;
  margin-top: 6px;
  display: none;
}

/* ── Promo tags (multi-coupon) ────────────────────────────────────────── */
.os-promo-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.os-promo-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border: 1px solid #c8e6c9;
  font-size: 12px;
  font-weight: 500;
  color: #2e7d32;
  animation: os-badge-in 0.3s ease;
}
.os-promo-tag-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.os-promo-tag-code {
  font-weight: 700;
  flex-shrink: 0;
}
.os-promo-tag-event {
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.os-promo-tag-remove {
  cursor: pointer;
  color: #999;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.os-promo-tag-remove:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
}
.night-mode .os-promo-tag {
  background: linear-gradient(135deg, rgba(106,192,69,0.1), rgba(106,192,69,0.05));
  border-color: rgba(106,192,69,0.2);
  color: #8ed96a;
}
.night-mode .os-promo-tag-event { color: #6B7075; }
.night-mode .os-promo-tag-remove { color: #6B7075; }

/* ── Total ───────────────────────────────────────────────────────────── */
.os-total {
  padding: 16px 20px;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
}
.os-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.os-total-row:last-child {
  margin-bottom: 0;
}
.os-total-label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.os-total-amount {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
  display: inline-block;
}
.os-total-amount.os-total-flash {
  animation: os-total-pop 0.5s ease;
}
.os-total-currency {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  margin-left: 4px;
}
.os-total-discount-row {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.os-total-discount-label {
  font-size: 12px;
  font-weight: 600;
  color: #6ac045;
  display: flex;
  align-items: center;
  gap: 6px;
}
.os-total-discount-amount {
  font-size: 14px;
  font-weight: 700;
  color: #6ac045;
}

/* ── CTA Button ──────────────────────────────────────────────────────── */
.os-cta {
  padding: 0 20px 20px;
}
.os-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a1a2e, #12122a);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}
.os-checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(26, 26, 46, 0.3);
  color: #fff;
}
.os-checkout-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: none;
}
.os-checkout-btn:hover::after {
  animation: os-shine 0.6s ease;
}
.os-checkout-btn .os-arrow {
  transition: transform 0.2s;
}
.os-checkout-btn:hover .os-arrow {
  transform: translateX(4px);
}
.os-secure {
  text-align: center;
  padding: 8px 20px 16px;
  font-size: 11px;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.os-secure i {
  color: #999;
  font-size: 12px;
}

/* ── Mobile floating bar ─────────────────────────────────────────────── */
#os-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: #fff;
  border-top: 1px solid #e8ece5;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.3s ease;
}
#os-mobile-bar.os-bar-hidden {
  transform: translateY(100%);
}
/* FIX1 — prevent mobile bar from masking bottom content */
@media (max-width: 1199.98px) {
  body.cart-page .event-dt-block,
  body.cart-page .wrapper {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}
.os-bar-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.os-bar-count {
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  background: #1a1a2e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.os-bar-label {
  font-size: 12px;
  color: #888;
}
.os-bar-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ccc;
}
.os-bar-total {
  font-size: 17px;
  font-weight: 800;
  color: #1a1a1a;
}
.os-bar-btn {
  background: linear-gradient(135deg, #1a1a2e, #12122a);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transition: transform 0.15s;
  text-decoration: none;
}
.os-bar-btn:hover {
  transform: translateY(-1px);
  color: #fff;
}

/* ── Night mode ──────────────────────────────────────────────────────── */
.night-mode .os-card {
  background: #1A1D1F;
  border-color: #272B30;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.night-mode .os-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.night-mode .os-header {
  background: linear-gradient(135deg, #1e2226, #1A1D1F);
}
.night-mode .os-header-title { color: #E0E0E0; }
.night-mode .os-header-icon { background: rgba(255, 255, 255, 0.08); }
.night-mode .os-event-row { background: transparent; }
.night-mode .os-event-row:hover { background: rgba(255, 255, 255, 0.03); }
.night-mode .os-event-name { color: #E0E0E0; }
.night-mode .os-event-meta { color: #6B7075; }
.night-mode .os-event-subtotal { color: #fcfcfc; }
.night-mode .os-event-currency { color: #6B7075; }
.night-mode .os-event-original { color: #555; }
.night-mode .os-divider { background: linear-gradient(90deg, transparent, #272B30 30%, #272B30 70%, transparent); }
.night-mode .os-discount-badge { background: rgba(231,76,60,0.12); color: #ff7675; }
.night-mode .os-ticket-line { color: #6B7075; }
.night-mode .os-promo { border-top-color: #272B30; }
.night-mode .os-promo-label { color: #6B7075; }
.night-mode .os-promo-input {
  background: #22262A;
  border-color: #3a3f44;
  color: #E0E0E0;
}
.night-mode .os-promo-input:focus { border-color: #6ac045; }
.night-mode .os-promo-input-wrap i { color: #555; }
.night-mode .os-promo-applied {
  background: linear-gradient(135deg, rgba(106,192,69,0.1), rgba(106,192,69,0.05));
  border-color: rgba(106,192,69,0.2);
}
.night-mode .os-promo-applied-text { color: #8ed96a; }
.night-mode .os-promo-remove { color: #6B7075; }
.night-mode .os-total {
  background: #1e2126;
  border-top-color: #272B30;
}
.night-mode .os-total-label { color: #6B7075; }
.night-mode .os-total-amount { color: #fcfcfc; }
.night-mode .os-total-currency { color: #6B7075; }
.night-mode .os-secure { color: #555; }
.night-mode #os-mobile-bar {
  background: #1A1D1F;
  border-top-color: #272B30;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
.night-mode .os-bar-label { color: #6B7075; }
.night-mode .os-bar-total { color: #fcfcfc; }
.night-mode .os-bar-dot { background: #555; }
/* ── Night mode CTA buttons — violet Movétan ────────────────────────── */
.night-mode .os-qty-btn { color: #6c3ce3; }
.night-mode .os-count-badge { background: #6c3ce3; }
.night-mode .os-checkout-btn { background: linear-gradient(135deg, #6c3ce3, #5a2dcf); }
.night-mode .os-checkout-btn:hover { box-shadow: 0 6px 20px rgba(108,60,227,0.35); }
.night-mode .os-bar-badge { background: #6c3ce3; }
.night-mode .os-bar-btn { background: linear-gradient(135deg, #6c3ce3, #5a2dcf); }
.night-mode #submit-payment-btn { background: linear-gradient(135deg, #6c3ce3, #5a2dcf); }
.night-mode #submit-payment-btn:hover { box-shadow: 0 6px 20px rgba(108,60,227,0.35); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
  .os-sidebar-sticky {
    position: static;
  }
}
@media (min-width: 1200px) {
  #os-mobile-bar {
    display: none !important;
  }
}
@media (max-width: 991.98px) {
  .os-header { padding: 16px 20px 14px; }
  .os-events { padding: 6px 12px; }
  .os-event-row { padding: 10px; }
  .os-promo { padding: 10px 16px; }
  .os-total { padding: 14px 16px; }
  .os-cta { padding: 0 16px 16px; }
}
@media (max-width: 575.98px) {
  .os-event-thumb { width: 40px; min-width: 40px; }
  .os-event-name { font-size: 13px; }
  .os-event-subtotal { font-size: 14px; }
  .os-total-amount { font-size: 20px; }
  .os-checkout-btn { padding: 12px 20px; font-size: 14px; }
  .os-ticket-lines { padding-left: 64px; }
  #os-mobile-bar { padding: 8px 12px; gap: 10px; }
  .os-bar-total { font-size: 15px; }
  .os-bar-btn { padding: 8px 16px; font-size: 12px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #os-mobile-bar { padding: 6px 12px; }
  .os-bar-count { width: 20px; height: 20px; font-size: 11px; }
  .os-bar-total { font-size: 14px; }
  .os-bar-btn { padding: 6px 14px; font-size: 11px; }
}

/* ══════════════════════════════════════════════════════════════════════
   CHECKOUT — Responsive fixes (BUG 2b-2h audit Richard)
   ══════════════════════════════════════════════════════════════════════ */

/* ── BUG 2b : holder-badge écrasé sur mobile ──────────────────────── */
.holder-badge {
  flex-shrink: 0;
  min-width: 26px;
}

/* ── BUG 2c : accordion-button déborde sur mobile ─────────────────── */
.holder-accordion .accordion-button {
  overflow: hidden;
  gap: 8px;
}
.holder-accordion .accordion-button > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.holder-summary {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── BUG 2f : "Tous pour moi" wrap sur mobile ────────────────────── */
.checkout-block .bp-title {
  flex-wrap: wrap;
  gap: 8px;
}

/* ── BUG 2g : gap entre expiry/CVC ────────────────────────────────── */
.stripe-fields-row {
  gap: 12px;
}

/* ── BUG 2d + 2e : responsive mobile < 400px ─────────────────────── */
@media (max-width: 575.98px) {
  .holder-radio-group .btn-outline-primary {
    padding: 5px 12px;
    font-size: 0.8rem;
  }
  .btn-all-for-me {
    padding: 8px 14px;
    font-size: 12px;
  }
  .holder-accordion .accordion-body {
    padding: 12px;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   BUG 4 — Harmoniser design systems (.main-card checkout → .os-card)
   ══════════════════════════════════════════════════════════════════════ */
.checkout-block .main-card {
  border-radius: 16px;
  border: 1.5px solid #e8ece5;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
}
.checkout-block .main-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transform: none;
}
.checkout-block .bp-title {
  background: linear-gradient(135deg, #f8f9fa, #f5f5f5);
  border-radius: 16px 16px 0 0;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f0f0;
}
.checkout-block .bp-title h4 {
  font-size: 16px;
  font-weight: 700;
}

/* ── Bouton Payer — style .os-checkout-btn ─────────────────────────── */
#submit-payment-btn {
  border-radius: 12px;
  background: linear-gradient(135deg, #1a1a2e, #12122a);
  border: none;
  font-weight: 700;
  box-shadow: none;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
#submit-payment-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(26, 26, 46, 0.3);
}

/* ── Night mode checkout forms ─────────────────────────────────────── */
.night-mode .checkout-block .main-card {
  background: #1A1D1F;
  border-color: #272B30;
}
.night-mode .checkout-block .bp-title {
  background: linear-gradient(135deg, #1e2226, #1A1D1F);
  border-bottom-color: #272B30;
}
.night-mode .checkout-block .bp-title h4 {
  color: #E0E0E0;
}
