/* Cart flow (owner 2026-10-14) — assets/js/cart.js + inc/shop.php. Loaded after style.css on every page.
   The one loud thing is the floating cart: a holo ring, a yellow count, and the photo landing in it.
   The options sheet stays quiet: white, lavender hairlines, pill choices like the rest of the shop. */

/* ---------- Floating cart, last in the right-side stack (.miora-fab) ---------- */
.miora-fab > a.miora-fab-cart{
  order:99;box-sizing:border-box;color:var(--purple-deep);font-size:25px;
  border:3px solid transparent;
  background:linear-gradient(#fff,#fff) padding-box,var(--holo) border-box;
  box-shadow:0 8px 20px rgba(63,35,150,.28);
}
.miora-fab > a.miora-fab-cart:hover{color:var(--purple);}
.miora-fab > a.miora-fab-cart:focus-visible{outline:3px solid var(--purple-deep);outline-offset:3px;}
.miora-fab > a.miora-fab-cart[hidden]{display:none !important;}
.miora-fab-cart .miora-cart-count{
  top:-6px;right:-6px;min-width:22px;height:22px;line-height:18px;
  background:var(--yellow);color:var(--purple-deep);border:2px solid #fff;
  font-family:var(--font-d);font-size:12px;
}
/* Phones: the contact buttons fold into a speed-dial (style.css); the cart stays out, below the toggle. */
@media (max-width:768px){
  .miora-fab > a.miora-fab-cart:not([hidden]){
    display:grid !important;width:50px !important;height:50px !important;font-size:23px !important;
    box-shadow:0 6px 18px rgba(63,35,150,.3) !important;animation:none !important;
  }
}

/* The photo's landing */
.miora-fab > a.miora-fab-cart.is-bump,.miora-cart-link.is-bump{animation:miora-cart-bump .42s cubic-bezier(.3,1.6,.5,1) !important;}
@keyframes miora-cart-bump{0%{transform:scale(1);}35%{transform:scale(1.2);}100%{transform:scale(1);}}
.miora-fly{position:fixed;z-index:130;pointer-events:none;margin:0;}
.miora-fly img{
  display:block;width:100%;height:100%;object-fit:cover;background:#fff;
  box-shadow:0 14px 30px rgba(63,35,150,.32);
}

/* ---------- Toast: on phones it stays clear of the floating column ---------- */
@media (max-width:768px){
  .miora-cart-toast{left:16px;right:82px;bottom:18px;width:auto;max-width:none;transform:translateY(16px);}
  .miora-cart-toast.is-on{transform:none;}
}
.miora-cart-toast a{color:var(--yellow);font-weight:700;white-space:nowrap;}
.miora-cart-toast a:focus-visible{outline:2px solid var(--yellow);outline-offset:2px;}

/* Busy "Đặt ngay" while the cart or the options load */
.miora-btn-order[aria-busy="true"],.is-style-miora-order a[aria-busy="true"],.buy-order[aria-busy="true"]{cursor:progress;opacity:.75;}

/* ---------- Options sheet: a centred card; a bottom sheet on phones ---------- */
.miora-sheet{
  box-sizing:border-box;width:min(460px,calc(100% - 32px));max-width:none;max-height:min(88vh,760px);
  margin:auto;padding:0;border:0;border-radius:var(--r-lg);overflow:auto;overscroll-behavior:contain;
  background:#fff;color:var(--ink);box-shadow:0 24px 60px rgba(42,35,66,.28);
  font-family:var(--font-b);
}
.miora-sheet::backdrop{background:rgba(36,28,58,.6);}
.miora-sheet[open]{animation:miora-sheet-in .24s cubic-bezier(.2,.8,.2,1);}
@keyframes miora-sheet-in{from{opacity:0;transform:translateY(18px) scale(.98);}}
.miora-sheet__in{position:relative;padding:24px 24px 22px;}
.miora-sheet__x{
  position:absolute;top:12px;right:12px;width:44px;height:44px;border:0;border-radius:50%;
  display:grid;place-items:center;background:#F1EBFA;color:var(--purple-deep);font-size:20px;cursor:pointer;
}
.miora-sheet__x:hover{background:#E6DCF7;}
.miora-sheet__head{display:flex;gap:16px;align-items:flex-start;margin:0 0 20px;}
.miora-sheet__img{
  flex:none;width:96px;height:96px;object-fit:cover;border-radius:var(--r);
  border:3px solid transparent;background:linear-gradient(#fff,#fff) padding-box,var(--holo) border-box;
}
.miora-sheet__img[hidden]{display:none;}
.miora-sheet__title{
  margin:2px 44px 8px 0;font-family:var(--font-d);font-size:18px;line-height:1.35;font-weight:700;color:var(--purple-deep);
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}
.miora-sheet__price{margin:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;line-height:1.3;}
.miora-sheet__price span{font-family:var(--font-d);font-weight:700;font-size:21px;color:var(--purple-deep);}
.miora-sheet__price s{font-size:14px;color:var(--muted);}

.miora-sheet__opt{border:0;margin:0 0 18px;padding:0;min-width:0;}
.miora-sheet__opt legend{padding:0;margin:0 0 10px;font-size:14px;font-weight:600;color:#544c6e;}
.miora-sheet__pick{font-weight:700;color:var(--purple-deep);}
.miora-sheet__chips{display:flex;flex-wrap:wrap;gap:8px;}
.miora-sheet__chip{position:relative;}
.miora-sheet__chip input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;}
.miora-sheet__chip span{
  display:inline-flex;align-items:center;min-height:44px;box-sizing:border-box;padding:8px 18px;
  border:1.5px solid var(--line);border-radius:var(--r-pill);background:#FCFAFF;
  font-size:14.5px;font-weight:600;color:var(--ink);transition:border-color .15s,background .15s;
}
.miora-sheet__chip:hover span{border-color:var(--purple);}
.miora-sheet__chip input:checked + span{
  border-color:var(--purple-deep);background:#F1EBFA;color:var(--purple-deep);
  box-shadow:inset 0 0 0 1px var(--purple-deep);
}
.miora-sheet__chip input:focus-visible + span{outline:3px solid var(--purple);outline-offset:2px;}
/* Cannot be bought with the other choices: struck out, still legible. */
.miora-sheet__chip input:disabled{cursor:not-allowed;}
.miora-sheet__chip input:disabled + span{
  border-style:dashed;background:#fff;color:var(--muted);text-decoration:line-through;
}

.miora-sheet__qty{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 6px;}
.miora-sheet__qty > span{font-size:14px;font-weight:600;color:#544c6e;}
.miora-qty{display:inline-flex;align-items:center;border:1.5px solid var(--line);border-radius:var(--r-pill);background:#FCFAFF;}
.miora-qty button{
  width:44px;height:44px;border:0;border-radius:50%;background:none;cursor:pointer;
  display:grid;place-items:center;color:var(--purple-deep);font-size:18px;
}
.miora-qty button:hover{background:#F1EBFA;}
.miora-qty button[aria-disabled="true"]{color:#A79FBD;cursor:default;background:none;}
.miora-qty button:focus-visible,.miora-qty input:focus-visible,.miora-sheet__x:focus-visible{outline:3px solid var(--purple);outline-offset:2px;}
.miora-qty input{
  width:48px;height:44px;padding:0;border:0;background:transparent;text-align:center;
  font-family:var(--font-d);font-weight:700;font-size:17px;color:var(--ink);-moz-appearance:textfield;appearance:textfield;
}
.miora-qty input::-webkit-outer-spin-button,.miora-qty input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}

.miora-sheet__msg{min-height:20px;margin:8px 0 10px;font-size:13.5px;color:#B4232C;}
.miora-sheet__msg:empty{margin:4px 0;min-height:0;}
.miora-sheet__add{width:100%;min-height:52px;justify-content:center;}
.miora-sheet__add:focus-visible{outline:3px solid var(--purple-deep);outline-offset:3px;}

@media (max-width:560px){
  .miora-sheet{
    width:100%;max-height:88vh;margin:auto 0 0;border-radius:var(--r-lg) var(--r-lg) 0 0;
  }
  .miora-sheet[open]{animation-name:miora-sheet-up;}
  @keyframes miora-sheet-up{from{transform:translateY(100%);}}
  .miora-sheet__in{padding:22px 16px calc(18px + env(safe-area-inset-bottom));}
  .miora-sheet__img{width:80px;height:80px;}
  .miora-sheet__price span{font-size:19px;}
}

/* ---------- Cart page: "Tiếp tục mua hàng" above "Tiến hành thanh toán" ---------- */
.wp-block-woocommerce-cart .miora-continue{
  display:flex;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;width:100%;
  min-height:48px;margin:0 0 12px;padding:10px 20px;border:1.5px solid var(--purple);border-radius:var(--r-pill);
  background:#fff;color:var(--purple-deep);font-family:var(--font-d);font-weight:700;font-size:15.5px;
  text-decoration:none;transition:background .15s;
}
.wp-block-woocommerce-cart .miora-continue:hover{background:#F4EFFC;color:var(--purple-deep);}
.wp-block-woocommerce-cart .miora-continue:focus-visible{outline:3px solid var(--purple-deep);outline-offset:2px;}
.wp-block-woocommerce-cart .miora-continue i{font-size:18px;}

@media (prefers-reduced-motion:reduce){
  .miora-sheet[open]{animation:none;}
  .miora-sheet__chip span,.wp-block-woocommerce-cart .miora-continue{transition:none;}
}
