/* ===========================
   SalonFlow UI — Fresha-ish
   =========================== */

/* Design tokens */
:root{
  --bg: #f7f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e7e7ef;
  --primary: #5c2ee6;   /* purple */
  --primary-700:#4d22db;
  --primary-50:#f4f1ff;
  --success:#10b981;
  --danger:#ef4444;
  --shadow: 0 8px 24px rgba(17,24,39,.06), 0 2px 6px rgba(17,24,39,.04);
  --radius: 16px;
  --sp-1: 6px; --sp-2: 10px; --sp-3: 16px; --sp-4: 24px; --sp-5: 36px;
}

/* Base */
*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0; color:var(--text); background:var(--bg);
  font: 16px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Inter,Arial,sans-serif;
}

/* Links */
a{ color: var(--primary); text-decoration: none; }
a:hover{ text-decoration: underline; }

/* Containers */
.container{ max-width: 1100px; margin:0 auto; padding: 0 16px; }
.layout{
  display:grid; grid-template-columns: 280px 1fr; gap: var(--sp-4);
}
@media (max-width: 980px){ .layout{ grid-template-columns: 1fr; } }

/* Header */
.header{
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--border);
}
.header .container{ display:flex; align-items:center; gap:16px; min-height:64px; }
.brand{ display:flex; align-items:center; }
.nav{ display:flex; gap:18px; align-items:center; }
.nav a{ color:#4b5563; padding:8px 0; }
.nav a:hover{ color:#111827; text-decoration:none; }

/* Language box – keep inside header */
.lang{
  margin-left:auto; display:flex; align-items:center; gap:8px;
  white-space: nowrap; max-width: 220px; overflow: hidden;
}
.lang select{
  appearance:none; -webkit-appearance:none;
  border:1px solid var(--border); background:#fff; color:#111;
  padding:8px 30px 8px 10px; border-radius:10px; font-size:14px;
}

/* Footer */
.footer{ padding: var(--sp-4) 0; color: var(--muted); }

/* Cards */
.card{
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card{ margin-top: var(--sp-3); }

/* Sidebar */
.sidebar .btn{ width:100%; }

/* Buttons */
.btn{
  display:inline-block; cursor:pointer;
  background: var(--primary); color:#fff; border:1px solid var(--primary);
  padding:10px 14px; border-radius: 12px; font-weight:600;
  transition: transform .05s ease, background .15s ease;
}
.btn:hover{ background: var(--primary-700); text-decoration:none; }
.btn:active{ transform: translateY(1px); }
.btn.btn-outline{
  background:#fff; color: var(--primary); border-color: var(--primary);
}
.btn.btn-outline:hover{ background: var(--primary-50); }

/* Inputs */
input, select, textarea{
  width:100%; padding:10px 12px; border-radius:10px;
  border:1px solid var(--border); background:#fff;
  font-size:14px; outline:none;
}
input:focus, select:focus, textarea:focus{ border-color: var(--primary); box-shadow: 0 0 0 3px rgba(92,46,230,.12); }

/* Tables */
.table-wrap{ overflow-x:auto; }
.table{ width:100%; border-collapse: collapse; }
.table th, .table td{ padding:12px 14px; text-align:left; vertical-align:middle; }
.table thead th{ color:#374151; font-weight:600; font-size:14px; }
.table tr + tr td{ border-top:1px solid var(--border); }
.table td:last-child{ width:1%; white-space:nowrap; } /* for action buttons */

/* Grid helpers */
.grid{ display:grid; gap:12px; }
.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
@media (max-width: 960px){ .grid-2{ grid-template-columns: 1fr; } }

/* Stars / small text */
.kv{ color: var(--muted); font-size:.95rem; }
.muted{ color: var(--muted); }
.price{ font-weight:600; }

/* Slots */
#slots{ display:flex; flex-wrap:wrap; gap:8px; }
#slots button{
  padding:8px 12px; border:1px solid var(--border); background:#fff;
  border-radius:10px; cursor:pointer;
}
#slots button.btn{
  background:var(--primary); color:#fff; border-color:var(--primary);
}

/* Toast */
.toast{
  position: fixed; left:50%; bottom: 26px; transform: translateX(-50%);
  background:#111; color:#fff; padding:10px 14px; border-radius:12px;
  box-shadow: var(--shadow); opacity:0; pointer-events:none; transition: .2s ease;
  z-index: 60;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(-2px); }

/* Pills for statuses if you use them */
.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 10px; font-weight:600; border-radius:999px; font-size:12px;
  background:#eef2ff; color:#3730a3;
}
.pill.confirmed{ background:#ecfdf5; color:#065f46; }
.pill.cancelled{ background:#fef2f2; color:#991b1b; }

/* === Header polish === */
.header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 24px;
  position: relative;
}
.brand img {
  display: block;
  height: auto;
  width: 120px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-weight: 500;
}
.nav a {
  color: #374151;
  transition: color .2s ease;
}
.nav a:hover {
  color: var(--primary);
}

/* Language */
.lang {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  white-space: nowrap;
}
.lang label {
  font-size: 13px;
  color: var(--muted);
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--primary);
}
@media (max-width: 800px) {
  .menu-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 16px;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
  }
  .nav.open { display: flex; }
  .lang { display: none; } /* hide on mobile for simplicity */
}

/* === Services table fix === */
.table td:last-child {
  text-align: right;
}
.table .btn {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 8px;
}

/* === Responsive container tweaks === */
@media (max-width: 960px) {
  .container { padding: 0 14px; }
}
/* spacing between City input and Search button */
input + .btn,
select + .btn {
  margin-top: 10px;
}

/* ===== MOBILE PADDING FIX ===== */
@media (max-width: 768px) {
  body {
    background: var(--bg);
  }

  .container {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .card {
    border-radius: 14px;
    margin-left: 2px;
    margin-right: 2px;
  }

  main {
    padding-left: 0;
    padding-right: 0;
  }

  .layout {
    padding: 0;
  }
}
/* Make sure nothing overlays the salon selector */
#salonSel { position: relative; z-index: 2; }
.header, .header .nav { z-index: 1; }
@media (max-width: 800px){
  /* mobile menu only overlays when open */
  .nav { display: none; }
  .nav.open { display: flex; }
}
/* ===== Ensure the Salon selector is always clickable ===== */
#salonSel { position: relative; z-index: 20; pointer-events: auto; }

/* The content layer should sit above the header/nav if needed */
.container, .card, .tabs, .toolbar { position: relative; z-index: 15; }

/* Header/nav base stacking */
.header { position: sticky; top: 0; z-index: 10; }
.header .nav { z-index: 11; }

/* MOBILE: prevent hidden nav from blocking clicks, only allow when open */
@media (max-width: 800px){
  .nav { 
    position: absolute;
    top: 64px; right: 16px;
    max-width: 90vw;
    display: none;
    pointer-events: none;   /* <- key: can't intercept clicks when closed */
    z-index: 12;            /* below the selector (20) and content (15) */
  }
  .nav.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 16px;
    pointer-events: auto;   /* only when open */
  }
}