/* =========================================================================
   CBA WORLD — MODAL / CART DRAWER / CHECKOUT / TOAST
   ========================================================================= */

/* ---- PRODUCT MODAL ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(4,0,9,.78);
  backdrop-filter: blur(8px);
}
.modal-box {
  position: relative; width: 100%; max-width: 920px; max-height: 92vh; overflow: auto;
  display: grid; grid-template-columns: 1.1fr 1fr;
  background: linear-gradient(180deg, #150826, #0a0414);
  border: 1px solid rgba(176,38,255,.3);
  border-radius: 10px;
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.8);
  animation: slideUp .4s cubic-bezier(.2,.7,.2,1);
}
@media (max-width: 720px) { .modal-box { grid-template-columns: 1fr; } }

.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 6;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(8,2,16,.7); border: 1px solid rgba(176,38,255,.3); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--ac); color: #0b0012; }

.modal-media {
  position: relative; min-height: 320px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(176,38,255,.2), transparent 62%);
  padding: 30px;
}
.modal-media .glow {
  position: absolute; width: 60%; height: 60%; border-radius: 50%;
  background: radial-gradient(circle, var(--ac), transparent 68%);
  filter: blur(34px); opacity: .4;
}
.modal-media img { position: relative; max-width: 100%; max-height: 420px; object-fit: contain; filter: drop-shadow(0 20px 36px rgba(0,0,0,.6)); }

.face-toggle {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 5px;
  background: rgba(8,2,16,.7); border: 1px solid rgba(176,38,255,.25); border-radius: 3px;
}
.face-toggle button {
  padding: 8px 16px; font-size: 11px; letter-spacing: .16em; font-weight: 600;
  border: none; border-radius: 2px; background: transparent; color: #cdbbe0;
  transition: all .2s ease;
}
.face-toggle button.active { background: var(--ac); color: #0b0012; }

.modal-details { padding: clamp(26px,4vw,40px); display: flex; flex-direction: column; border-left: 1px solid rgba(176,38,255,.16); }
@media (max-width: 720px) { .modal-details { border-left: none; border-top: 1px solid rgba(176,38,255,.16); } }
.modal-details h3 { font-size: clamp(26px,3.4vw,40px); line-height: .96; margin: 10px 0 6px; }
.modal-sub { font-size: 13px; color: var(--text-dimmer); font-style: italic; }
.modal-price { font-family: var(--f-display); font-size: 26px; margin-top: 16px; color: #fff; }
.modal-price.soon { color: #8a7ba0; font-size: 18px; }

.opt-block { margin-top: 24px; }
.opt-label { font-size: 11px; letter-spacing: .2em; color: #cdbbe0; margin-bottom: 10px; }
.opt-label .val { color: #fff; }

.swatch-row { display: flex; gap: 10px; }
.swatch-row button { width: 30px; height: 30px; border-radius: 50%; transition: transform .15s ease; }
.swatch-row button:hover { transform: scale(1.1); }

.size-row { display: flex; gap: 10px; flex-wrap: wrap; }
.size-row button {
  min-width: 48px; padding: 12px 14px; font-size: 13px; font-weight: 600; letter-spacing: .06em;
  border-radius: 2px; background: transparent; border: 1px solid rgba(176,38,255,.3); color: #d9c9ee;
  transition: all .15s ease;
}
.size-row button.active { background: var(--ac); border-color: var(--ac); color: #0b0012; }
.size-row.shake { animation: shake .4s; }

.modal-add-btn {
  margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 17px;
  background: var(--ac); color: #0b0012;
  font-weight: 700; font-size: 12px; letter-spacing: .2em;
  border: none; border-radius: 2px;
  box-shadow: 0 12px 40px -8px var(--ac);
  transition: transform .2s ease;
}
.modal-add-btn:hover { transform: translateY(-2px); }

.notify-row { display: flex; gap: 8px; flex-wrap: wrap; }
.notify-row input { flex: 1; min-width: 180px; }

.modal-meta { display: flex; gap: 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(176,38,255,.12); font-size: 11px; color: var(--text-faint); }

/* ---- CART DRAWER ---- */
.cart-backdrop { position: fixed; inset: 0; z-index: 600; background: rgba(4,0,9,.7); backdrop-filter: blur(6px); }
.cart-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #140725, #09030f);
  border-left: 1px solid rgba(176,38,255,.3);
  box-shadow: -30px 0 80px -20px rgba(0,0,0,.7);
  animation: drawerIn .4s cubic-bezier(.2,.7,.2,1);
}
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid rgba(176,38,255,.16); }
.cart-head span.title { font-family: var(--f-display); font-size: 22px; letter-spacing: .04em; }
.cart-close { width: 34px; height: 34px; border-radius: 50%; background: rgba(8,2,16,.7); border: 1px solid rgba(176,38,255,.3); color: #fff; display: flex; align-items: center; justify-content: center; }
.cart-close:hover { background: var(--ac); color: #0b0012; }

.cart-body { flex: 1; overflow: auto; padding: 14px 24px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; gap: 14px; padding: 40px 0; }
.cart-empty p { color: var(--text-dimmer); font-size: 14px; }

.cart-line { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(176,38,255,.1); }
.cart-line-img {
  width: 66px; height: 66px; flex: none; border-radius: 4px;
  background: radial-gradient(circle, rgba(176,38,255,.22), transparent 70%);
  display: flex; align-items: center; justify-content: center;
}
.cart-line-img img { max-width: 90%; max-height: 90%; object-fit: contain; }
.cart-line-body { flex: 1; min-width: 0; }
.cart-line-body .name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3; }
.cart-line-body .meta { font-size: 11px; color: var(--text-dimmer); margin-top: 3px; }
.cart-line-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cart-line-row .price { font-family: var(--f-display); font-size: 15px; }
.cart-line-row .remove { font-size: 10px; letter-spacing: .14em; color: var(--text-dimmer); background: none; border: none; text-decoration: underline; }
.cart-line-row .remove:hover { color: var(--ac2); }

.cart-summary { padding: 20px 24px; border-top: 1px solid rgba(176,38,255,.2); background: rgba(8,2,16,.5); }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.cart-summary-row.total { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.cart-summary-row.total span:last-child { font-family: var(--f-display); }

/* ---- CHECKOUT OVERLAY ---- */
.checkout-overlay {
  position: fixed; inset: 0; z-index: 700; overflow: auto;
  background: radial-gradient(130% 90% at 50% -10%, #1a0930 0%, #0c0418 42%, #050007 100%);
}
.checkout-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px,5vw,56px);
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(7,2,14,.85), rgba(7,2,14,.4));
  border-bottom: 1px solid rgba(176,38,255,.16);
}
.checkout-back { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .18em; color: #cdbbe0; background: none; border: none; }
.checkout-back:hover { color: #fff; }

.checkout-body { max-width: 1040px; margin: 0 auto; padding: clamp(30px,5vw,56px) clamp(20px,5vw,40px) 80px; display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(28px,4vw,52px); align-items: start; }
@media (max-width: 820px) { .checkout-body { grid-template-columns: 1fr; } }

.checkout-form h2 { font-size: clamp(30px,5vw,48px); margin-bottom: 6px; }
.checkout-form > p.lead { font-size: 13px; color: var(--text-dimmer); margin-bottom: 28px; }
.checkout-step-label { font-size: 11px; letter-spacing: .24em; color: var(--ac2); margin-bottom: 14px; }
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.field-mb { margin-bottom: 24px; }
.field-mb-sm { margin-bottom: 12px; }

.order-summary { border: 1px solid rgba(176,38,255,.2); border-radius: 10px; padding: 24px; background: rgba(10,4,20,.55); position: sticky; top: 90px; }
.order-summary > p.label { font-size: 11px; letter-spacing: .24em; color: #cdbbe0; margin-bottom: 16px; }
.order-line { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(176,38,255,.1); }
.order-line-img { width: 54px; height: 54px; flex: none; border-radius: 4px; background: radial-gradient(circle, rgba(176,38,255,.22), transparent 70%); display: flex; align-items: center; justify-content: center; }
.order-line-img img { max-width: 88%; max-height: 88%; object-fit: contain; }
.order-line-body { flex: 1; min-width: 0; }
.order-line-body .name { font-size: 12px; font-weight: 600; color: #fff; line-height: 1.3; }
.order-line-body .meta { font-size: 11px; color: var(--text-dimmer); margin-top: 2px; }
.order-line .price { font-family: var(--f-display); font-size: 14px; }
.order-summary-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-top: 16px; }
.order-summary-row.total { font-size: 17px; font-weight: 700; color: #fff; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(176,38,255,.2); }
.order-summary-row.total span:last-child { font-family: var(--f-display); }
.place-order-btn {
  width: 100%; margin-top: 20px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 17px;
  background: var(--ac); color: #0b0012;
  font-weight: 700; font-size: 12px; letter-spacing: .2em;
  border: none; border-radius: 2px;
  box-shadow: 0 12px 40px -8px var(--ac);
  transition: transform .2s ease;
}
.place-order-btn:hover { transform: translateY(-2px); }
.pay-secure-note { font-size: 10px; letter-spacing: .1em; color: var(--text-faint); text-align: center; margin-top: 12px; }
.pay-providers { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pay-providers .tag { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.15); color: var(--text-dim); }

.checkout-success { max-width: 560px; margin: 0 auto; padding: clamp(50px,10vw,120px) 24px; text-align: center; }
.checkout-success h2 { font-size: clamp(34px,6vw,64px); margin: 24px 0 0; }
.checkout-success p { margin: 18px auto 0; max-width: 420px; font-size: 15px; line-height: 1.7; color: var(--text-dim); }
.checkout-success .order-no { margin: 14px 0 30px; font-size: 12px; letter-spacing: .2em; color: var(--text-faint); }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 900;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  background: rgba(12,4,22,.92);
  border: 1px solid var(--ac);
  border-radius: 3px;
  box-shadow: 0 12px 40px -8px var(--ac);
  backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, transform .3s ease;
}
.toast.show { opacity: 1; visibility: visible; }
.toast span { font-size: 12px; letter-spacing: .12em; color: #fff; }
