/* ================================================================
   AraOnline User Panel - extras (v2.0.1)
   1) tracking-code popup (site-wide)   2) tracking card (order detail)
   3) cart "coins you will earn" box
   Self-contained: every colour falls back to the panel's defaults, so it
   also works on pages where ara-panel.css is not loaded.
   ================================================================ */

/* ---------- 1) Popup ---------- */
.ara-trk-modal {
    position: fixed; inset: 0; z-index: 100001;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; direction: rtl; font-family: inherit;
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
}
.ara-trk-modal.is-open { opacity: 1; visibility: visible; }
.ara-trk-backdrop { position: absolute; inset: 0; background: rgba(26, 13, 25, .58); cursor: pointer; }
.ara-trk-card {
    position: relative; width: 100%; max-width: 400px; max-height: calc(100vh - 32px); overflow-y: auto;
    background: #fff; border-radius: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
    transform: translateY(18px) scale(.97); transition: transform .3s cubic-bezier(.2, .9, .3, 1.2);
    color: var(--ara-text, #1f2937); font-size: 14px; line-height: 1.7; text-align: right;
}
.ara-trk-modal.is-open .ara-trk-card { transform: none; }
.ara-trk-card *, .ara-trk-card *::before, .ara-trk-card *::after { box-sizing: border-box; }

.ara-trk-x {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    width: 32px; height: 32px; border: 0; border-radius: 50%; padding: 0;
    background: rgba(255, 255, 255, .22); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.ara-trk-x:hover { background: rgba(255, 255, 255, .36); }

.ara-trk-hero {
    position: relative; overflow: hidden; text-align: center; color: #fff;
    padding: 28px 22px 26px;
    background: linear-gradient(135deg, var(--ara-primary, #5C1F5A), #8a5a86);
    border-radius: 22px 22px 0 0;
}
.ara-trk-hero::before, .ara-trk-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.ara-trk-hero::before { width: 120px; height: 120px; top: -40px; right: -30px; }
.ara-trk-hero::after  { width: 80px;  height: 80px;  bottom: -26px; left: -18px; }
.ara-trk-hero__icon {
    position: relative; z-index: 1; display: inline-grid; place-items: center;
    width: 64px; height: 64px; margin-bottom: 10px; border-radius: 20px;
    background: rgba(255, 255, 255, .2); font-size: 34px;
    animation: araTrkPop .7s cubic-bezier(.2, .9, .3, 1.4) .15s both;
}
.ara-trk-hero h3 { position: relative; z-index: 1; margin: 0 0 6px; color: #fff; font-size: 19px; font-weight: 800; line-height: 1.5; }
.ara-trk-hero p  { position: relative; z-index: 1; margin: 0; color: rgba(255, 255, 255, .86); font-size: 12.5px; line-height: 1.9; }
@keyframes araTrkPop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }

.ara-trk-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ara-trk-order { background: #faf7fa; border: 1px solid #efe5ee; border-radius: 16px; padding: 12px; }
.ara-trk-order__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.ara-trk-order__head span { color: var(--ara-text-sm, #6b7280); font-size: 12px; }

.ara-trk-code {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; margin-bottom: 10px; background: #fff;
    border: 1.5px dashed var(--ara-amber, #f59e0b); border-radius: 12px;
}
.ara-trk-code__main { min-width: 0; display: flex; flex-direction: column; }
.ara-trk-code small { color: var(--ara-text-sm, #6b7280); font-size: 11px; }
.ara-trk-code code {
    direction: ltr; text-align: right; background: none; padding: 0; margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 16px; font-weight: 800; letter-spacing: .5px; color: var(--ara-primary, #5C1F5A);
    word-break: break-all; user-select: all;
}
.ara-trk-copy {
    flex: 0 0 auto; border: 0; border-radius: 9px; padding: 7px 14px; cursor: pointer;
    background: #fef3c7; color: #b45309; font-family: inherit; font-size: 12px; font-weight: 700;
    transition: background .15s, color .15s;
}
.ara-trk-copy:hover { background: #fde68a; }
.ara-trk-copy.is-done { background: #d1fae5; color: #047857; }

.ara-trk-coins {
    margin-bottom: 10px; padding: 8px 12px; border-radius: 10px;
    background: #fffbeb; color: #92400e; font-size: 12.5px; font-weight: 600;
}

.ara-trk-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
    padding: 12px 18px; border: 0; border-radius: 12px; cursor: pointer; text-decoration: none;
    font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.4; transition: transform .15s, box-shadow .15s, background .15s;
}
.ara-trk-btn--primary { background: var(--ara-primary, #5C1F5A); color: #fff; box-shadow: 0 6px 16px rgba(92, 31, 90, .28); }
.ara-trk-btn--primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(92, 31, 90, .36); }
.ara-trk-btn--ghost { background: transparent; color: var(--ara-gray, #6b7280); border: 1.5px solid var(--ara-border, #e5e7eb); }
.ara-trk-btn--ghost:hover { background: #f5f5f7; }
body.ara-trk-open { overflow: hidden; }

/* ---------- 2) Tracking card inside the panel's order detail ---------- */
.ara-trk-detail { border: 1.5px solid #fde68a; background: linear-gradient(180deg, #fffdf5, #fff); }
.ara-trk-detail h3 { display: flex; align-items: center; gap: 6px; }
.ara-trk-detail .ara-trk-code { margin-bottom: 8px; }
.ara-trk-detail__note { margin: 0; color: var(--ara-text-sm, #6b7280); font-size: 12px; line-height: 1.9; }

/* ---------- 3) Cart: coins the customer will earn ---------- */
.ara-coin-box {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px;
    margin: 0 12px 12px; padding: 13px 14px; border-radius: 16px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a; color: #78350f; direction: rtl; text-align: right;
}
.ara-coin-box::after {
    content: ""; position: absolute; top: -30px; left: -30px; width: 90px; height: 90px;
    border-radius: 50%; background: rgba(245, 158, 11, .12); pointer-events: none;
}
.ara-coin-box__icon {
    position: relative; z-index: 1; flex: 0 0 auto; display: grid; place-items: center;
    width: 46px; height: 46px; border-radius: 50%; font-size: 24px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 4px 12px rgba(245, 158, 11, .4);
    animation: araCoinFloat 2.8s ease-in-out infinite;
}
@keyframes araCoinFloat { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-3px) rotate(4deg); } }
.ara-coin-box__body { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ara-coin-box__title { font-size: 14px; font-weight: 800; line-height: 1.7; color: #78350f; }
.ara-coin-box__title b { color: #b45309; font-size: 16px; }
.ara-coin-box__text { font-size: 12px; line-height: 1.9; color: #92400e; }
.ara-coin-box__text a { color: #b45309; font-weight: 700; text-decoration: underline; }
.ara-coin-box__next { font-size: 11.5px; font-weight: 600; color: #b45309; }
.ara-shop--cart .ara-coin-box { margin: 0; }

@media (prefers-reduced-motion: reduce) {
    .ara-coin-box__icon, .ara-trk-hero__icon { animation: none; }
    .ara-trk-card, .ara-trk-modal { transition: none; }
}
@media (max-width: 480px) {
    .ara-trk-modal { align-items: flex-end; padding: 0; }
    .ara-trk-card { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
}
