/* Salon customer app — colours come from the company theme variables when available. */
:root {
    --sa-primary: var(--saas-primary, #08706c);
    --sa-primary-dark: var(--saas-primary-dark, #065a57);
    --sa-on-primary: var(--saas-on-primary, #ffffff);
    --sa-accent: var(--saas-accent, #d4af37);
    --sa-soft: var(--saas-primary-soft, #e3f2f1);
    --sa-bg: #f7f5f1;
    --sa-card: #ffffff;
    --sa-ink: #2d2d2b;
    --sa-muted: #6f6d68;
    --sa-line: rgba(45, 45, 43, 0.1);
    --sa-radius: 16px;
    --sa-shadow: 0 6px 24px rgba(45, 45, 43, 0.07);
}

/* Standalone page (/salon without the website) */
.sa-page { margin: 0; padding: 0; background: var(--sa-bg); }

.sa-app, .sa-app * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.sa-app {
    color: var(--sa-ink);
    font-family: "Tajawal", "Inter", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: 150px; position: relative;
}
html[dir="ltr"] .sa-app { font-family: "Inter", "Tajawal", system-ui, sans-serif; }
.sa-app button, .sa-app input, .sa-app select, .sa-app textarea { font: inherit; color: inherit; }
.sa-app button { cursor: pointer; }
.sa-loading { display: flex; justify-content: center; padding: 80px 0; }
.sa-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--sa-soft); border-top-color: var(--sa-primary); animation: sa-spin 0.9s linear infinite; }
@keyframes sa-spin { to { transform: rotate(360deg); } }

/* Header */
.sa-header {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: rgba(247, 245, 241, 0.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--sa-line);
}
.sa-logo { height: 34px; width: auto; }
.sa-brand { font-weight: 800; font-size: 18px; color: var(--sa-primary); }
.sa-header-actions { display: flex; align-items: center; gap: 10px; }
.sa-club-chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--sa-soft); color: var(--sa-primary); font-weight: 700; }
.sa-link { background: none; border: 0; color: var(--sa-primary); font-weight: 600; padding: 6px 4px; }
.sa-danger { color: #b42318; }

/* Hero */
.sa-main { padding: 0 16px; }
.sa-hero {
    margin: 16px 0; padding: 22px 20px; border-radius: 22px; color: #fff;
    background: radial-gradient(120% 140% at 100% 0%, var(--sa-accent) 0%, transparent 45%),
                linear-gradient(150deg, var(--sa-primary) 0%, var(--sa-primary-dark) 100%);
    box-shadow: var(--sa-shadow);
}
.sa-hero-greet { opacity: 0.9; font-size: 14px; }
.sa-hero-title { margin: 6px 0 0; font-size: 24px; line-height: 1.3; font-weight: 800; }
.sa-member { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; font-size: 13px; align-items: center; }
.sa-tier { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--tier, #c9cdd2); color: #fff; font-weight: 700; font-size: 12px; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); }

/* Catalogue */
.sa-section { margin: 18px 0; }
.sa-center { text-align: center; padding: 40px 0; }
.sa-h2 { font-size: 18px; font-weight: 800; margin: 20px 0 10px; }
.sa-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.sa-chips::-webkit-scrollbar { display: none; }
.sa-chip { flex: 0 0 auto; border: 1px solid var(--sa-line); background: var(--sa-card); border-radius: 999px; padding: 7px 14px; font-weight: 600; }
.sa-chip.is-on { background: var(--sa-primary); border-color: var(--sa-primary); color: var(--sa-on-primary); }
.sa-services { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.sa-service { display: flex; gap: 12px; justify-content: space-between; align-items: center; background: var(--sa-card); border: 1px solid var(--sa-line); border-radius: var(--sa-radius); padding: 14px; transition: border-color 0.15s; }
.sa-service.is-on { border-color: var(--sa-primary); box-shadow: 0 0 0 2px var(--sa-soft); }
.sa-service-name { font-weight: 700; }
.sa-service-meta { color: var(--sa-muted); font-size: 13px; }
.sa-service-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.sa-price { font-weight: 800; color: var(--sa-primary); white-space: nowrap; }
.sa-add { border: 1px solid var(--sa-primary); background: transparent; color: var(--sa-primary); border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 700; }
.sa-add.is-on { background: var(--sa-primary); color: var(--sa-on-primary); }

/* Buttons & inputs */
.sa-btn { border: 0; border-radius: 14px; background: var(--sa-primary); color: var(--sa-on-primary); font-weight: 700; padding: 12px 18px; }
.sa-btn:disabled { opacity: 0.45; cursor: default; }
.sa-btn-block { width: 100%; margin-top: 16px; padding: 14px; font-size: 16px; }
.sa-label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; color: var(--sa-muted); }
.sa-input { width: 100%; border: 1px solid var(--sa-line); border-radius: 12px; padding: 12px; background: #fff; }
.sa-input:focus { outline: 2px solid var(--sa-soft); border-color: var(--sa-primary); }
.sa-ltr { direction: ltr; text-align: left; }
html[dir="rtl"] .sa-ltr { text-align: right; }
.sa-code { letter-spacing: 0.6em; font-size: 22px; text-align: center !important; }
.sa-check { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 13px; color: var(--sa-muted); }
.sa-check input { margin-top: 3px; accent-color: var(--sa-primary); }
.sa-muted { color: var(--sa-muted); font-size: 14px; }
.sa-error { color: #b42318; font-size: 14px; margin: 10px 0 0; }

/* Basket */
.sa-basket {
    position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%); z-index: 25;
    width: calc(100% - 24px); max-width: 496px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--sa-ink); color: #fff; border-radius: 18px; padding: 10px 10px 10px 16px; box-shadow: var(--sa-shadow);
}
html[dir="rtl"] .sa-basket { padding: 10px 16px 10px 10px; }

/* Bottom navigation */
.sa-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 30;
    width: 100%; max-width: 520px; display: flex; justify-content: space-around;
    background: #fff; border-top: 1px solid var(--sa-line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.sa-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: var(--sa-muted); font-size: 12px; font-weight: 600; padding: 4px 0; }
.sa-nav-icon { font-size: 20px; line-height: 1; }
.sa-nav-item.is-on { color: var(--sa-primary); }

/* Bottom sheet */
.sa-overlay { position: fixed; inset: 0; background: rgba(20, 20, 18, 0.45); z-index: 40; }
.sa-sheet {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 50;
    width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
    background: var(--sa-bg); border-radius: 24px 24px 0 0; padding: 12px 18px calc(24px + env(safe-area-inset-bottom));
    animation: sa-up 0.22s ease-out;
}
@keyframes sa-up { from { transform: translate(-50%, 40px); opacity: 0.4; } to { transform: translate(-50%, 0); opacity: 1; } }
.sa-sheet-bar { display: flex; justify-content: space-between; align-items: center; }
.sa-close { border: 0; background: var(--sa-card); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; }
.sa-sheet-title { font-size: 17px; font-weight: 800; margin: 14px 0 10px; }

/* Specialist options */
.sa-option { width: 100%; display: flex; gap: 12px; align-items: center; text-align: start; border: 1px solid var(--sa-line); background: var(--sa-card); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.sa-option.is-on { border-color: var(--sa-primary); box-shadow: 0 0 0 2px var(--sa-soft); }
.sa-option-text { display: flex; flex-direction: column; }
.sa-option-text small { color: var(--sa-muted); }
.sa-avatar { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sa-soft); color: var(--sa-primary); font-weight: 800; flex: 0 0 auto; }
.sa-avatar-any { background: var(--sa-accent); color: #fff; }

/* Dates & slots */
.sa-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.sa-days::-webkit-scrollbar { display: none; }
.sa-day { flex: 0 0 62px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 14px; border: 1px solid var(--sa-line); background: var(--sa-card); }
.sa-day small { color: var(--sa-muted); font-size: 11px; }
.sa-day b { font-size: 18px; }
.sa-day.is-on { background: var(--sa-primary); border-color: var(--sa-primary); color: var(--sa-on-primary); }
.sa-day.is-on small { color: var(--sa-on-primary); opacity: 0.85; }
.sa-slot-group { margin-bottom: 12px; }
.sa-slot-label { font-size: 13px; color: var(--sa-muted); margin-bottom: 6px; font-weight: 600; }
.sa-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sa-slot { border: 1px solid var(--sa-line); background: var(--sa-card); border-radius: 12px; padding: 9px 0; font-weight: 700; direction: ltr; }
.sa-slot.is-calm { border-color: var(--sa-accent); }
.sa-slot.is-on { background: var(--sa-primary); border-color: var(--sa-primary); color: var(--sa-on-primary); }
.sa-slot.is-taken { opacity: 0.35; text-decoration: line-through; cursor: default; }
.sa-calm-note { color: #8a6d16; font-size: 13px; margin: 8px 0 0; }

/* Review */
.sa-review { background: var(--sa-card); border: 1px solid var(--sa-line); border-radius: var(--sa-radius); padding: 6px 14px; }
.sa-review-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--sa-line); }
.sa-review-row:last-child { border-bottom: 0; }
.sa-total { font-size: 16px; }
.sa-total b { color: var(--sa-primary); }
.sa-policy { font-size: 12.5px; color: var(--sa-muted); margin: 8px 0; }

/* Done */
.sa-done { text-align: center; }
.sa-done-icon { width: 64px; height: 64px; border-radius: 50%; margin: 12px auto 8px; display: flex; align-items: center; justify-content: center; font-size: 32px; background: var(--sa-soft); color: var(--sa-primary); }
.sa-done h3 { margin: 4px 0; font-size: 20px; }
.sa-done .sa-review { text-align: start; margin-top: 14px; }

/* Account */
.sa-card-club {
    border-radius: 22px; padding: 20px; color: #fff; margin-top: 16px; box-shadow: var(--sa-shadow);
    background: radial-gradient(140% 120% at 0% 0%, var(--tier, #c9cdd2) 0%, transparent 55%),
                linear-gradient(150deg, var(--sa-primary-dark) 0%, #1d2a28 100%);
}
.sa-card-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; opacity: 0.95; }
.sa-card-name { font-size: 22px; font-weight: 800; margin: 18px 0 14px; }
.sa-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sa-card-stats small { display: block; opacity: 0.75; font-size: 11.5px; }
.sa-card-stats b { font-size: 15px; }
.sa-booking { background: var(--sa-card); border: 1px solid var(--sa-line); border-radius: var(--sa-radius); padding: 12px 14px; margin-bottom: 10px; }
.sa-booking-head, .sa-booking-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sa-booking-foot { margin-top: 6px; font-size: 13px; color: var(--sa-muted); }
.sa-badge { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--sa-soft); color: var(--sa-primary); font-weight: 700; }
.sa-badge-cancelled, .sa-badge-no_show { background: #f3f1ee; color: var(--sa-muted); }
.sa-badge-done { background: #e8f5e9; color: #2e7d32; }

/* Toast */
.sa-toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--sa-ink); color: #fff; padding: 10px 16px; border-radius: 12px; max-width: 90%; box-shadow: var(--sa-shadow); font-size: 14px; }

/* Embedded in the website (/book): the site's header and footer are used */
.sa-app.sa-embedded { max-width: 640px; min-height: 0; padding-bottom: 96px; }
.sa-embedded .sa-main { padding: 0; }
.sa-tabs { display: flex; gap: 8px; margin: 0 0 12px; }
.sa-tabs .sa-nav-item { flex: 0 0 auto; flex-direction: row; gap: 6px; font-size: 14px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--sa-line); background: var(--sa-card); }
.sa-tabs .sa-nav-item.is-on { background: var(--sa-primary); border-color: var(--sa-primary); color: var(--sa-on-primary); }
.sa-tabs .sa-nav-icon { font-size: 15px; }
.sa-embedded .sa-basket { position: sticky; bottom: 16px; left: auto; transform: none; width: 100%; max-width: none; margin-top: 16px; z-index: 1035; }
.sa-embedded .sa-overlay { z-index: 1040; }
.sa-embedded .sa-sheet { z-index: 1050; }
.sa-embedded .sa-toast { z-index: 1060; top: 90px; }
.sa-member-inline { color: var(--sa-ink); background: var(--sa-soft); border-radius: 14px; padding: 10px 14px; margin: 0 0 12px; }
