/* Contest cart drawer — resources/views/website/partials/cart-drawer.blade.php + js/ptg-cart.js */

/* ---------- Triggers ---------- */
.ptg-cart-trigger {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.header-area-1-inner .header-right__cart-badge[hidden] { display: none; }
.ptg-cart-trigger.is-bump .header-right__cart-badge { animation: ptg-cart-bump 0.45s ease; }
@keyframes ptg-cart-bump { 40% { transform: scale(1.45); } }

.ptg-cart-add {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: auto;
  margin-right: 8px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ptg-cart-add .material-symbols-outlined { font-size: 20px; }
.ptg-cart-add:hover { border-color: var(--secondary); background: #fdf6f3; color: var(--secondary); }
.ptg-cart-add.is-added { border-color: #16a34a; background: #ecfdf3; color: #15803d; }
.ptg-cart-add.is-busy { pointer-events: none; opacity: 0.6; }
.ptg-cart-add--full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: auto;
  min-height: 50px;
  margin: 0;
  padding: 0 18px;
  border-radius: 6px;
  font-family: var(--font_mona);
  font-size: 15px;
  font-weight: 600;
}
.courses2__footer .ptg-cart-add--full { width: auto; margin-left: auto; margin-right: 10px; }

/* ---------- Drawer shell ---------- */
.ptg-cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100040;
  background: rgba(15, 23, 34, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ptg-cart-backdrop.is-open { opacity: 1; }
.ptg-cart {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100045;
  display: flex;
  flex-direction: column;
  width: min(460px, 100vw);
  background: var(--white);
  color: var(--primary);
  font-family: var(--font_mona);
  box-shadow: -24px 0 60px rgba(15, 23, 34, 0.22);
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  visibility: hidden;
}
.ptg-cart.is-open { transform: none; visibility: visible; }
body.ptg-cart-locked { overflow: hidden; }

.ptg-cart__head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.ptg-cart__bar { display: flex; align-items: center; gap: 10px; }
.ptg-cart__heading { flex: 1; min-width: 0; }
.ptg-cart__kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--secondary); }
.ptg-cart__title { margin: 2px 0 0; font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--primary); }
.ptg-cart__icon-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--bg2);
  color: var(--primary);
  cursor: pointer;
}
.ptg-cart__icon-btn:hover { background: #efe8e1; }
.ptg-cart button:focus { outline: none; }
.ptg-cart button:focus-visible,
.ptg-cart a:focus-visible,
.ptg-cart select:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
.ptg-cart__icon-btn[hidden] { display: none; }

/* Steps */
.ptg-cart__steps { display: flex; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.ptg-cart__steps li {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}
.ptg-cart__steps li:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 2px;
  margin-right: 4px;
  border-radius: 2px;
  background: var(--border);
}
.ptg-cart__dot {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg2);
  color: var(--text2);
  transition: background 0.2s ease, color 0.2s ease;
}
.ptg-cart__dot .material-symbols-outlined { font-size: 16px; }
.ptg-cart__steps li.is-current { color: var(--primary); }
.ptg-cart__steps li.is-current .ptg-cart__dot { background: var(--secondary); color: var(--white); box-shadow: 0 0 0 4px rgba(252, 163, 17, 0.18); }
.ptg-cart__steps li.is-done .ptg-cart__dot { background: #16a34a; color: var(--white); }
.ptg-cart__steps li.is-done::after { background: #16a34a; }
.ptg-cart.is-finished .ptg-cart__steps { display: none; }

/* Body */
.ptg-cart__body { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px; background: #fcfbf9; }
.ptg-cart__pane[hidden] { display: none; }
.ptg-cart__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(252, 251, 249, 0.7);
}
.ptg-cart__loading[hidden] { display: none; }
.ptg-cart__spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(252, 163, 17, 0.25);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: ptg-cart-spin 0.7s linear infinite;
}
@keyframes ptg-cart-spin { to { transform: rotate(360deg); } }

/* Items */
.ptg-cart__list { display: grid; gap: 12px; }
.ptg-cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  transition: border-color 0.2s ease;
}
.ptg-cart-item.is-blocked { border-color: #fca5a5; background: #fffafa; }
.ptg-cart-item.is-joined { border-color: #86efac; }
.ptg-cart-item__thumb { width: 76px; height: 76px; overflow: hidden; border-radius: 12px; background: var(--bg2); }
.ptg-cart-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ptg-cart-item__thumb img.is-fallback { object-fit: contain; padding: 14px; }
.ptg-cart-item__body { min-width: 0; padding-right: 26px; }
.ptg-cart-item__type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(252, 163, 17, 0.12);
  color: #c2410c;
  font-size: 11px;
  font-weight: 600;
}
.ptg-cart-item__name { display: block; margin: 4px 0 2px; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--primary); text-decoration: none; }
.ptg-cart-item__name:hover { color: var(--secondary); }
.ptg-cart-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--text2); }
.ptg-cart-item__price { font-size: 15px; font-weight: 700; color: var(--primary); }
.ptg-cart-item__price.is-free { color: #15803d; }
.ptg-cart-item__price.is-muted { font-size: 13px; font-weight: 600; color: var(--text2); }
.ptg-cart-item__remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
}
.ptg-cart-item__remove:hover { background: #fee2e2; color: #b91c1c; }
.ptg-cart-item__remove .material-symbols-outlined { font-size: 18px; }
.ptg-cart-item__msg { display: flex; gap: 6px; margin: 8px 0 0; font-size: 12px; line-height: 1.45; }
.ptg-cart-item__msg .material-symbols-outlined { font-size: 16px; }
.ptg-cart-item.is-blocked .ptg-cart-item__msg { color: #b91c1c; }
.ptg-cart-item.is-joined .ptg-cart-item__msg { color: #15803d; }
.ptg-cart-item__select {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--primary);
  font-family: var(--font_mona);
  font-size: 13px;
}
.ptg-cart-item__select.is-needed { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.15); }

.ptg-cart__empty { padding: 50px 10px; text-align: center; }
.ptg-cart__empty[hidden] { display: none; }
.ptg-cart__empty-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: rgba(252, 163, 17, 0.12);
  color: var(--secondary);
  font-size: 34px;
}
.ptg-cart__empty h3 { margin: 0 0 6px; font-size: 19px; font-weight: 600; color: var(--primary); }
.ptg-cart__empty p { max-width: 280px; margin: 0 auto 18px; color: var(--text2); }

/* Billing form */
.ptg-cart__hint { margin: 0 0 14px; font-size: 13px; color: var(--text2); }
.ptg-cart__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ptg-field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; color: var(--primary); }
.ptg-field--full { grid-column: 1 / -1; }
.ptg-field em { font-style: normal; font-weight: 500; color: var(--text2); }
.ptg-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--primary);
  font-family: var(--font_mona);
  font-size: 14px;
  font-weight: 400;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ptg-field input:focus { outline: 0; border-color: var(--secondary); box-shadow: 0 0 0 4px rgba(252, 163, 17, 0.15); }
.ptg-field.is-invalid input { border-color: #ef4444; }
.ptg-field__error { font-size: 12px; font-weight: 500; color: #b91c1c; }

/* Payment step */
.ptg-cart__card { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--white); }
.ptg-cart__card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ptg-cart__card-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--primary); }
.ptg-cart__card-head span { font-size: 12px; color: var(--text2); }
.ptg-cart__mini { margin: 0; padding: 0; list-style: none; }
.ptg-cart__mini li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; color: var(--text2); }
.ptg-cart__mini li strong { flex-shrink: 0; color: var(--primary); font-weight: 600; }
.ptg-cart__address { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text2); }
.ptg-cart__address-line { display: block; }
.ptg-cart__address-line:first-child { font-weight: 600; color: var(--primary); }
.ptg-cart__link { padding: 0; border: 0; background: none; color: var(--secondary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ptg-cart__section-title { margin: 18px 0 10px; font-size: 13px; font-weight: 600; color: var(--primary); }
.ptg-cart__methods { display: grid; gap: 10px; }
.ptg-method {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.ptg-method input { position: absolute; opacity: 0; pointer-events: none; }
.ptg-method:has(input:focus-visible) { outline: 2px solid var(--secondary); outline-offset: 2px; }
.ptg-method__icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--bg2); font-size: 21px; }
.ptg-method__copy { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 3px; }
.ptg-method__copy img { display: block; height: 22px; width: auto; max-width: 120px; object-fit: contain; }
.ptg-method__name { font-size: 15px; font-weight: 600; }
.ptg-method__hint { font-size: 12px; color: var(--text2); }
.ptg-method__radio { position: relative; width: 22px; height: 22px; flex-shrink: 0; border: 2px solid rgba(20, 33, 61, 0.25); border-radius: 50%; }
.ptg-method__radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--secondary); transform: scale(0); transition: transform 0.2s ease; }
.ptg-method.is-active { border-color: var(--secondary); background: #fdf6f3; box-shadow: 0 8px 20px rgba(252, 163, 17, 0.14); }
.ptg-method.is-active .ptg-method__icon { background: var(--secondary); color: var(--white); }
.ptg-method.is-active .ptg-method__radio { border-color: var(--secondary); }
.ptg-method.is-active .ptg-method__radio::after { transform: scale(1); }
.ptg-cart__sandbox { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff8e6; color: #8a5a00; font-size: 13px; }
.ptg-cart__sandbox[hidden] { display: none; }
.ptg-cart__sandbox .material-symbols-outlined { font-size: 18px; }

/* Done */
.ptg-cart__done { padding: 26px 6px; text-align: center; }
.ptg-cart__done-icon {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 28px;
  background: #16a34a;
  color: var(--white);
  font-size: 42px;
  box-shadow: 0 16px 36px rgba(22, 163, 74, 0.3);
  animation: ptg-cart-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes ptg-cart-pop { from { transform: scale(0.4); opacity: 0; } }
.ptg-cart__done h3 { margin: 0 0 6px; font-size: 24px; font-weight: 700; color: var(--primary); }
.ptg-cart__done p { margin: 0 0 18px; color: var(--text2); }
.ptg-cart__done-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; text-align: left; }
.ptg-cart__done-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.ptg-cart__done-list a:hover { border-color: var(--secondary); }
.ptg-cart__done-list small { display: block; font-weight: 500; color: var(--text2); }
.ptg-cart__done-list .material-symbols-outlined { color: var(--secondary); }

/* Footer */
.ptg-cart__foot { padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--white); box-shadow: 0 -10px 24px rgba(20, 33, 61, 0.05); }
.ptg-cart__totals { margin: 0 0 12px; }
.ptg-cart__totals[hidden] { display: none; }
.ptg-cart__totals div { display: flex; justify-content: space-between; padding: 2px 0; font-size: 14px; color: var(--text2); }
.ptg-cart__totals dt { font-weight: 500; }
.ptg-cart__totals dd { margin: 0; }
.ptg-cart__totals .is-total { margin-top: 6px; padding-top: 8px; border-top: 1px dashed rgba(20, 33, 61, 0.2); color: var(--primary); }
.ptg-cart__totals .is-total dt { font-weight: 600; }
.ptg-cart__totals .is-total dd { font-size: 20px; font-weight: 700; }
.ptg-cart__notice { display: flex; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #fff1f0; color: #b42318; font-size: 13px; }
.ptg-cart__notice[hidden] { display: none; }
.ptg-cart__notice.is-info { background: #eef6ff; color: #1d4ed8; }
.ptg-cart__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font_mona);
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(20, 33, 61, 0.22);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.ptg-cart__cta:hover { background: #26384d; }
.ptg-cart__cta:active { transform: scale(0.99); }
.ptg-cart__cta:disabled { background: #c5cbd3; box-shadow: none; cursor: not-allowed; }
.ptg-cart__cta.is-busy { pointer-events: none; opacity: 0.85; }
.ptg-cart__cta.is-center { justify-content: center; }
.ptg-cart__cta-amount { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 14px; }
.ptg-cart__cta-amount:empty { display: none; }
.ptg-cart__secondary,
.ptg-cart__ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.ptg-cart__ghost { display: inline-flex; width: auto; padding: 0 22px; }
.ptg-cart__secondary[hidden] { display: none; }
.ptg-cart__secondary:hover,
.ptg-cart__ghost:hover { background: var(--bg2); color: var(--primary); }
.ptg-cart__trust { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0; font-size: 12px; color: var(--text2); }
.ptg-cart__trust .material-symbols-outlined { font-size: 15px; color: #15803d; }
.ptg-cart__trust a { color: var(--primary); font-weight: 600; text-decoration: underline; }

/* Toast */
.ptg-cart-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100050;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--primary);
  color: var(--white);
  font-family: var(--font_mona);
  font-size: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 34, 0.3);
  transform: translateX(-50%);
}
.ptg-cart-toast[hidden] { display: none; }
.ptg-cart-toast.is-error { background: #b42318; }

@media (max-width: 575px) {
  .ptg-cart__head { padding: 14px 16px 12px; }
  .ptg-cart__body { padding: 14px 16px; }
  .ptg-cart__foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .ptg-cart__form { grid-template-columns: 1fr; }
  .ptg-cart__steps li { font-size: 12px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .ptg-cart, .ptg-cart-backdrop, .ptg-cart__done-icon { transition: none; animation: none; }
}
