/**
 * ============================================================
 *  TBL PWA — Feuille de styles principale
 *  The Beauty Lounge | thebeautylounge.com
 * ============================================================
 *  Pour modifier les couleurs → section :root uniquement
 * ============================================================
 */

/* ── Variables globales (modifiez ICI pour changer les couleurs) ── */
:root {
  --tbl-primary:       #F1898C;   /* Rose / saumon */
  --tbl-primary-light: #F9B8BA;   /* Rose clair */
  --tbl-primary-dark:  #D96669;   /* Rose foncé hover */
  --tbl-bg:            #FDF4F2;   /* Fond crème rosé */
  --tbl-dark:          #3D2424;   /* Texte / accents sombres */
  --tbl-white:         #FFFFFF;
  --tbl-overlay:       rgba(61, 36, 36, 0.45);

  --tbl-radius-sm:     8px;
  --tbl-radius-md:     16px;
  --tbl-radius-lg:     24px;
  --tbl-radius-pill:   50px;

  --tbl-shadow-sm:     0 2px 8px rgba(241, 137, 140, 0.15);
  --tbl-shadow-md:     0 4px 20px rgba(241, 137, 140, 0.25);
  --tbl-shadow-lg:     0 8px 40px rgba(61, 36, 36, 0.12);

  --tbl-transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --tbl-font-body:     'Cormorant Garamond', Georgia, serif;
  --tbl-font-ui:       'DM Sans', system-ui, sans-serif;
}

/* ── Reset PWA ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

/* Mode standalone : ajuster pour safe-area iOS */
.is-pwa-standalone body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.is-pwa-standalone header,
.is-pwa-standalone .header-top {
  padding-top: env(safe-area-inset-top, 0);
}

/* ── Bannière mise à jour ──────────────────────────────────── */
#tbl-update-banner {
  position: fixed;
  bottom: -120px;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0 1rem;
  transition: bottom var(--tbl-transition);
}

#tbl-update-banner.tbl-update-visible {
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.tbl-update-inner {
  background: var(--tbl-dark);
  color: var(--tbl-white);
  border-radius: var(--tbl-radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--tbl-shadow-lg);
  flex-wrap: wrap;
}

.tbl-update-icon { font-size: 1.4rem; flex-shrink: 0; }

.tbl-update-inner p {
  flex: 1;
  font-family: var(--tbl-font-ui);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.tbl-update-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.tbl-update-actions button {
  border: none;
  border-radius: var(--tbl-radius-pill);
  padding: 0.45rem 1.1rem;
  font-family: var(--tbl-font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--tbl-transition);
}

#tbl-update-btn {
  background: var(--tbl-primary);
  color: var(--tbl-white);
}

#tbl-update-dismiss {
  background: transparent;
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.25) !important;
}

.tbl-update-actions button:hover { opacity: 0.85; }

/* ── Bannière A2HS (Add to Home Screen) ───────────────────── */
#tbl-a2hs-banner {
  position: fixed;
  bottom: -100px;
  left: 0;
  right: 0;
  z-index: 9998;
  padding: 0 1rem;
  transition: bottom var(--tbl-transition);
}

#tbl-a2hs-banner.tbl-a2hs-visible {
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.tbl-a2hs-inner {
  background: var(--tbl-white);
  border: 1.5px solid var(--tbl-primary-light);
  border-radius: var(--tbl-radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--tbl-shadow-md);
}

.tbl-a2hs-icon {
  border-radius: var(--tbl-radius-sm);
  flex-shrink: 0;
}

.tbl-a2hs-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tbl-a2hs-text strong {
  font-family: var(--tbl-font-body);
  font-size: 1rem;
  color: var(--tbl-dark);
  font-weight: 700;
}

.tbl-a2hs-text span {
  font-family: var(--tbl-font-ui);
  font-size: 0.8rem;
  color: rgba(61, 36, 36, 0.6);
}

.tbl-a2hs-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

#tbl-a2hs-install {
  background: var(--tbl-primary);
  color: var(--tbl-white);
  border: none;
  border-radius: var(--tbl-radius-pill);
  padding: 0.5rem 1.1rem;
  font-family: var(--tbl-font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--tbl-transition);
  white-space: nowrap;
}

#tbl-a2hs-install:hover { background: var(--tbl-primary-dark); }

#tbl-a2hs-close {
  background: transparent;
  border: none;
  color: rgba(61,36,36,0.4);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color var(--tbl-transition);
}

#tbl-a2hs-close:hover { color: var(--tbl-dark); }

/* ── Page Offline ──────────────────────────────────────────── */
.tbl-offline-page {
  background: var(--tbl-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  font-family: var(--tbl-font-body);
  color: var(--tbl-dark);
}

.tbl-offline-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: tbl-float 3s ease-in-out infinite;
}

@keyframes tbl-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.tbl-offline-title {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 700;
  color: var(--tbl-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.tbl-offline-text {
  font-size: 1.1rem;
  opacity: 0.7;
  line-height: 1.7;
  max-width: 340px;
  margin-bottom: 2rem;
}

.tbl-btn-primary {
  display: inline-block;
  background: var(--tbl-primary);
  color: var(--tbl-white);
  border: none;
  border-radius: var(--tbl-radius-pill);
  padding: 0.9rem 2.25rem;
  font-family: var(--tbl-font-ui);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--tbl-shadow-md);
  transition: all var(--tbl-transition);
  letter-spacing: 0.02em;
}

.tbl-btn-primary:hover {
  background: var(--tbl-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--tbl-shadow-lg);
}

/* ── Loader splash screen ──────────────────────────────────── */
#tbl-splash {
  position: fixed;
  inset: 0;
  background: var(--tbl-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

#tbl-splash.tbl-splash-hidden {
  opacity: 0;
  pointer-events: none;
}

.tbl-splash-logo {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  animation: tbl-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tbl-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.tbl-splash-name {
  font-family: var(--tbl-font-body);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--tbl-dark);
  letter-spacing: 0.04em;
}

.tbl-splash-loader {
  margin-top: 2rem;
  width: 40px;
  height: 4px;
  background: var(--tbl-primary-light);
  border-radius: 4px;
  overflow: hidden;
}

.tbl-splash-loader::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: var(--tbl-primary);
  border-radius: 4px;
  animation: tbl-slide 1.2s ease-in-out infinite;
}

@keyframes tbl-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── Navigation bottom (mode standalone mobile) ────────────── */
.tbl-bottom-nav {
  display: none;
}

.is-pwa-standalone .tbl-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--tbl-white);
  border-top: 1px solid rgba(241, 137, 140, 0.2);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(61, 36, 36, 0.08);
}

.tbl-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.25rem;
  color: rgba(61, 36, 36, 0.45);
  text-decoration: none;
  font-family: var(--tbl-font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  gap: 0.2rem;
  transition: color var(--tbl-transition);
}

.tbl-bottom-nav a.active,
.tbl-bottom-nav a:hover { color: var(--tbl-primary); }

.tbl-bottom-nav .tbl-nav-icon {
  font-size: 1.35rem;
  line-height: 1;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .tbl-update-inner { flex-direction: column; align-items: flex-start; }
}
