:root {
  --primary: #db2777;
  --primary-dark: #be185d;
  --primary-light: rgba(219, 39, 119, 0.14);
  --primary-border: rgba(219, 39, 119, 0.25);
  --primary-shadow: rgba(219, 39, 119, 0.35);
  --hero-bg: linear-gradient(135deg, #fff0f5 0%, #ffe4ec 50%, #ffd6e0 100%);
  --hero-title-color: #1f2937;
  --hero-sub-color: #374151;
  --hero-badge-bg: rgba(219, 39, 119, 0.15);
  --hero-badge-color: #db2777;
  --hero-border: rgba(219, 39, 119, 0.18);
  --heading-font: 'Playfair Display', serif;
  --purple: #7c3aed;
  --accent: #f59e0b;
  --dark: #1f2937;
  --dark-2: #374151;
  --dark-3: #4b5563;
  --gray: #6b7280;
  --gray-light: #9ca3af;
  --text: #1f2937;
  --bg: #f3f4f6;
  --card: #ffffff;
  --card-border: #e5e7eb;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 60px;
}

.hidden { display: none !important; }

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 60px;
  background: var(--card); backdrop-filter: blur(12px);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 100;
}

.menu-btn {
  width: 44px; height: 44px; border: none;
  background: var(--primary-light);
  color: var(--primary); border-radius: 12px; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

.topbar-title {
  flex: 1; font-family: var(--heading-font); font-size: 1.15rem;
  font-weight: 700; color: var(--dark);
}

.btn-icon {
  position: relative;
  width: 44px; height: 44px; border: none; background: transparent;
  font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 12px; text-decoration: none;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed; top: 0; left: -300px; width: 300px; height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--card-border);
  box-shadow: 8px 0 30px rgba(0,0,0,0.12); z-index: 200;
  transition: left 0.3s ease; overflow-y: auto;
}
.sidebar.open { left: 0; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px; border-bottom: 1px solid var(--card-border);
}

.sidebar-logo {
  font-family: var(--heading-font); font-size: 1.2rem; font-weight: 700;
  color: var(--primary);
}

.sidebar-close {
  width: 40px; height: 40px; border: none;
  background: var(--bg); border-radius: 10px;
  color: var(--dark); font-size: 1.1rem; cursor: pointer;
}

.sidebar-menu { list-style: none; padding: 8px; }
.sidebar-menu li { margin: 2px 0; }

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: 12px; font-size: 1rem; font-weight: 500;
  color: var(--dark-2); text-decoration: none; transition: all 0.2s;
}
.nav-item:hover, .nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-divider { height: 1px; background: var(--card-border); margin: 8px 16px; }

.menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 150; opacity: 0; visibility: hidden; transition: all 0.3s;
}
.menu-overlay.open { opacity: 1; visibility: visible; }

/* ============================================
   MAIN
   ============================================ */
.main-content { padding: 76px 12px 24px; min-height: 100vh; width: 100%; max-width: 100vw; overflow-x: hidden; }
.page { display: none; width: 100%; max-width: 100%; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   HERO - Dinâmico por Segmento & Cor Principal
   ============================================ */
.hero-mobile {
  background: var(--hero-bg);
  border-radius: var(--radius); padding: 26px 18px; margin-bottom: 14px;
  text-align: center; position: relative; overflow: hidden;
  border: 1px solid var(--hero-border);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.hero-mobile::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, var(--primary-light) 0%, transparent 55%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }

.hero-badge {
  display: inline-block; padding: 6px 16px;
  background: var(--hero-badge-bg); color: var(--hero-badge-color);
  border: 1px solid var(--primary-border); border-radius: 50px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 14px;
}
.hero-title {
  font-family: var(--heading-font); font-size: 1.65rem; font-weight: 800;
  color: var(--hero-title-color); line-height: 1.18; margin-bottom: 8px;
}
.hero-subtitle { font-size: 0.92rem; color: var(--hero-sub-color); margin-bottom: 18px; line-height: 1.5; }

/* ============================================
   STATS
   ============================================ */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 18px 14px;
  text-align: center; border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}
.stat-card.pink { border-color: var(--primary-border); }
.stat-card.purple { border-color: rgba(124, 58, 237, 0.4); }
.stat-card.blue { border-color: rgba(37, 99, 235, 0.4); }
.stat-card.green { border-color: rgba(16, 185, 129, 0.4); }
.stat-icon { font-size: 1.6rem; margin-bottom: 6px; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--dark); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--gray); margin-top: 4px; }

/* ============================================
   SECTIONS & CARDS
   ============================================ */
.section-header { text-align: center; margin-bottom: 20px; padding: 0 8px; }
.section-badge {
  display: inline-block; padding: 4px 14px; background: var(--primary-light);
  color: var(--primary); border-radius: 50px; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.section-title {
  font-family: var(--heading-font); font-size: 1.5rem; font-weight: 700;
  color: var(--dark); line-height: 1.2;
}
.section-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--card-border); margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.section-card .section-title { font-size: 1.1rem; margin-bottom: 14px; font-family: 'Inter', sans-serif; color: var(--dark); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; font-family: inherit; font-size: 0.95rem;
  font-weight: 600; border: none; cursor: pointer; transition: all 0.2s;
  min-height: 44px; width: 100%; text-decoration: none; margin-bottom: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; box-shadow: 0 4px 15px var(--primary-shadow);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg); color: var(--dark-2);
  border: 1px solid var(--card-border);
}
.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: white; box-shadow: 0 4px 15px rgba(37,211,102,0.3);
}
.btn-danger { background: #ef4444; color: white; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; min-height: 36px; width: auto; border-radius: 10px; margin-bottom: 0; display: inline-flex; }
.btn-icon-social {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; border: none;
  cursor: pointer; transition: transform 0.2s;
  background: transparent;
  padding: 0; overflow: hidden;
}
.btn-icon-social img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.btn-icon-social:active { transform: scale(0.92); }

.social-row { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 12px; }

.action-bar { margin-bottom: 14px; }

/* ============================================
   INPUTS
   ============================================ */
.input, input, select, textarea {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--card-border);
  border-radius: 12px; font-family: inherit; font-size: 1rem; color: var(--dark);
  background: var(--bg); transition: all 0.2s;
  -webkit-appearance: none; appearance: none; min-height: 52px;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.textarea { min-height: 100px; resize: vertical; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 500; color: var(--dark-2); margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ============================================
   TAB BAR
   ============================================ */
.tab-bar {
  display: flex; gap: 8px; margin-bottom: 16px; padding: 0 4px;
}
.tab-btn {
  flex: 1; padding: 12px; border: none; border-radius: 12px;
  background: var(--bg); color: var(--gray); font-size: 0.95rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
  border: 1px solid var(--card-border);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: 1px solid var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================
   LIST / CARDS
   ============================================ */
.list-container { display: flex; flex-direction: column; gap: 10px; }
.item-card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  border: 1px solid var(--card-border); box-shadow: var(--shadow);
}
.item-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 10px; }
.item-card-title { font-size: 1rem; font-weight: 600; color: var(--dark); flex: 1; }
.item-card-badge {
  padding: 4px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 600;
  background: var(--primary-light); color: var(--primary); white-space: nowrap;
}
.item-card-badge.upcoming { background: #fef3c7; color: #d97706; }
.item-card-badge.completed { background: #d1fae5; color: #059669; }
.item-card-badge.cancelled { background: #fee2e2; color: #dc2626; }

/* Profissional */
.pro-card { display: flex; gap: 14px; align-items: center; }
.pro-photo { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-border); flex-shrink: 0; }
.pro-name { font-size: 1rem; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.pro-specialty { font-size: 0.85rem; color: var(--primary); font-weight: 500; margin-bottom: 4px; }
.pro-rating { font-size: 0.85rem; color: #f59e0b; }

/* Produto */
.product-card { display: flex; gap: 14px; }
.product-image { width: 80px; height: 80px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--card-border); flex-shrink: 0; }
.product-name { font-size: 1rem; font-weight: 600; color: var(--dark); margin-bottom: 4px; }
.product-desc { font-size: 0.85rem; color: var(--gray); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-weight: 700; color: var(--primary); font-size: 1.05rem; }
.product-old-price { font-size: 0.8rem; color: var(--gray-light); text-decoration: line-through; }

/* ============================================
   GALLERY - Ajustada para mobile
   ============================================ */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; cursor: pointer; border: 1px solid var(--card-border); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery-item:nth-child(7n+1) { grid-column: span 2; grid-row: span 2; }

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: all 0.3s; }
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: var(--radius-sm); object-fit: contain; }
.lightbox-close { position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; background: rgba(255,255,255,0.2); border: none; border-radius: 50%; color: white; font-size: 1.3rem; cursor: pointer; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500; opacity: 0; visibility: hidden; transition: all 0.3s; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal { background: var(--card); border-radius: var(--radius); width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--card-border); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--card-border); }
.modal-title { font-size: 1.1rem; font-weight: 600; color: var(--dark); }
.modal-close { width: 36px; height: 36px; border: none; background: var(--bg); border-radius: 10px; color: var(--dark); font-size: 1.1rem; cursor: pointer; }
.modal-body { padding: 20px; }

/* Admin Gallery */
.gallery-admin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery-admin-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; border: 1px solid var(--card-border); }
.gallery-admin-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-admin-delete { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; background: rgba(239,68,68,0.9); color: white; border: none; border-radius: 50%; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Admin only nav items */
.admin-only { display: none; }
.admin-only.show { display: list-item; }

/* Filter bar */
.filter-bar { margin-bottom: 14px; padding: 0 4px; }

/* ============================================
   CAROUSEL / SCROLL HORIZONTAL
   ============================================ */
.carousel-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin: 0 -4px;
}
.carousel-container::-webkit-scrollbar { height: 4px; }
.carousel-container::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
.carousel-item {
  flex: 0 0 85%;
  scroll-snap-align: start;
  min-width: 260px;
}
.carousel-item .item-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer { text-align: center; padding: 30px 20px; color: var(--gray); font-size: 0.9rem; border-top: 1px solid var(--card-border); background: var(--card); }
.footer-copy { font-size: 0.8rem; opacity: 0.7; margin-top: 6px; }

/* ============================================
   TOAST
   ============================================ */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--dark); color: white; padding: 14px 24px; border-radius: 14px; font-size: 0.95rem; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 400; opacity: 0; transition: all 0.4s ease; text-align: center; max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }

/* ============================================
   LOADING
   ============================================ */
.loading { text-align: center; padding: 40px 20px; color: var(--gray); font-size: 0.95rem; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray); }
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }

/* ============================================
   CALENDAR
   ============================================ */
.calendar-container { background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.calendar-header button { background: var(--primary-light); border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 1.1rem; color: var(--primary); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.calendar-header h3 { font-size: 1rem; font-weight: 600; color: var(--dark); text-transform: capitalize; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calendar-day-label { font-size: 0.75rem; font-weight: 600; color: var(--gray); padding: 6px 0; text-transform: uppercase; }
.calendar-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; border-radius: 10px; font-size: 0.9rem; font-weight: 500; color: var(--dark); cursor: pointer; transition: background 0.2s; position: relative; }
.calendar-day:hover { background: var(--primary-light); }
.calendar-day.empty { color: transparent; cursor: default; pointer-events: none; }
.calendar-day.today { border: 2px solid var(--primary); color: var(--primary); font-weight: 700; }
.calendar-day.selected { background: var(--primary); color: white; }
.calendar-day.has-event::after { content: ''; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.calendar-day.selected.has-event::after { background: white; }
.calendar-day.today.has-event::after { background: var(--primary); }
.calendar-day.past { color: var(--gray-light); }
.calendar-day.disabled { color: var(--gray-light); background: #f1f5f9; cursor: not-allowed; pointer-events: none; }
.calendar-day.disabled:hover { background: #f1f5f9; }
.calendar-agenda-list { max-height: 300px; overflow-y: auto; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
