/* ============================================================
   Tokmart - Base: reset, CSS variables, page shell, shared buttons
   ============================================================ */

/* ===== ORDER SUCCESS MODAL (bottom sheet) ===== */
.order-success-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-admin-overlay);
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: flex-end;
    animation: fadeInOverlay 0.3s var(--ease-out);
}

.order-success-overlay.open {
    display: flex;
}

.order-success-box {
    background: var(--surface);
    color: var(--text);
    border-radius: 22px 22px 0 0;
    padding: 28px 22px calc(22px + var(--safe-area-bottom));
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0,0,0,.2);
    text-align: center;
    animation: bottomSheetIn 0.35s var(--ease-spring);
}

@keyframes bottomSheetIn {
    0% { transform: translateY(100%); }
    100% { transform: translateY(0); }
}

.order-success-box .success-icon {
    font-size: 52px;
    color: var(--primary);
    margin-bottom: 12px;
    animation: successPulse 1.5s infinite ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.order-success-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text2);
    margin-bottom: 6px;
}

.order-success-box .order-sub {
    font-size: 13px;
    color: var(--text3);
    margin-bottom: 16px;
}

.order-success-box .order-details-card {
    background: var(--bg2);
    border-radius: 12px;
    padding: 14px;
    font-size: 12px;
    margin-bottom: 14px;
    text-align: right;
}

.order-success-box .detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.order-success-box .detail-row:last-child { margin-bottom: 0; }
.order-success-box .detail-row .label { color: var(--text3); }
.order-success-box .detail-row .value { color: var(--text); font-weight: 600; }

.order-success-box .order-total {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    padding: 8px 6px;
    border-top: 1px dashed var(--border);
    margin-bottom: 16px;
    color: var(--primary);
}

.order-success-box .btn-close-success {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 14px;
    height: 50px;
    padding: 0 22px;
    font-size: var(--fs-xl);
    font-weight: 700;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

@keyframes fadeInOverlay {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ===== RESET & ROOT ===== */
* {
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #0f3d1c;
    --primary-light: #1b5e2b;
    --primary-dark: #072210;
    --secondary: #D8B07A;
    --bg: #F5F9FA;
    --bg-card: #FFFFFF;
    --bg2: #EDF4F5;
    --surface: #FFFFFF;
    --text: #193E45;
    --text-light: #4a7553;
    --border: rgba(15,61,28,.12);
    --text2: #193E45;
    --text3: #4a7553;
    --acSh: rgba(15,61,28,.06);
    --shadow: 0 8px 32px rgba(15,61,28,.10);
    --shadow-lg: 0 20px 60px rgba(15,61,28,.15);
    --gold: #D8B07A;
    --green: #2ECC71;
    --red: #E74C3C;
    --blue: #3498DB;
    --discount-color: #FF9A3D;
    --pink: #E91E63;
    --nav-bg: rgba(255,255,255,.92);
    --nav-shadow: 0 -4px 30px rgba(15,61,28,.06);
    --radius: 16px;
    --radius-sm: 12px;

    /* Type scale - kept to these steps everywhere so text sizes stay consistent */
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-base: 13px;
    --fs-md: 14px;
    --fs-lg: 15px;
    --fs-xl: 16px;
    --fs-2xl: 18px;
    --fs-3xl: 20px;
    --fs-4xl: 24px;

    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    /* Z-Index System */
    --z-base: 1;
    --z-content: 10;
    --z-header: 50;
    --z-bottom-nav: 100;
    --z-fab: 150;
    --z-overlay: 200;
    --z-modal: 250;
    --z-dialog: 300;
    --z-snackbar: 350;
    --z-loading: 400;
    --z-admin-header: 60;
    --z-admin-content: 20;
    --z-admin-modal: 350;
    --z-admin-overlay: 360;
}

html, body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    height: 100%;
    width: 100%;
    -webkit-font-smoothing: antialiased;
    position: relative;
    padding: 0;
    margin: 0;
    overflow: auto;
    overscroll-behavior: none;
}

#app {
    height: 100vh;
    overflow: hidden;
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    width: 100vw;
    width: 100dvw;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
    z-index: var(--z-base);
}

/* ============================================================
   Shared button system - three consistent size tiers instead of
   ad-hoc padding/font-size repeated (and drifting) on every button.
   Same naming convention as the admin panel (assets/css/admin-panel.css).
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.25s var(--ease-spring);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-block { width: 100%; }

.btn-lg { height: 50px; padding: 0 22px; font-size: var(--fs-xl); border-radius: 14px; }
.btn-md { height: 42px; padding: 0 18px; font-size: var(--fs-base); border-radius: 12px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: var(--fs-sm); border-radius: 10px; }

.btn-primary { background: var(--primary-light); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--surface); color: var(--text2); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
