/* ============================================
   SD BERTO — Design System & Animations
   Senior-level UI • Mobile-first • Accessible
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand (from logo) */
  --orange: #E65100;
  --orange-light: #FF8A50;
  --orange-dark: #BF360C;
  --white: #FFFFFF;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-300: #E0E0E0;
  --gray-600: #757575;
  --gray-800: #424242;
  --black: #212121;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-sans);

  /* Spacing & layout */
  --header-height: 64px;
  --container-max: 1140px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
  --transition-fast: 0.2s ease;
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base & Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--black);
  background: var(--gray-50);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--orange-dark); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; }
.text-lead { font-size: 1.125rem; color: var(--gray-800); }

/* ---------- Layout ---------- */
.container-custom { max-width: var(--container-max); margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 768px) { .container-custom { padding-left: 1.5rem; padding-right: 1.5rem; } }

/* ---------- Navbar ---------- */
.navbar-sdberto {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  min-height: var(--header-height);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}
.navbar-sdberto .container-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.navbar-sdberto.scrolled { box-shadow: var(--shadow-sm); }
.navbar-sdberto .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--black);
  flex-shrink: 0;
  margin-right: 1rem;
  max-width: calc(100% - 52px);
}
.navbar-sdberto .navbar-brand img {
  height: 44px;
  width: auto;
  min-width: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.navbar-sdberto .navbar-toggler {
  order: 2;
  margin-left: auto;
}
.navbar-sdberto .navbar-collapse {
  order: 3;
  flex-basis: 100%;
  width: 100%;
}
@media (min-width: 992px) {
  .navbar-sdberto .navbar-collapse { flex-basis: auto; width: auto; order: 2; }
  .navbar-sdberto .navbar-toggler { order: 3; display: none; }
  .navbar-sdberto .navbar-nav { margin-left: auto; }
}
@media (max-width: 991.98px) {
  .navbar-sdberto .navbar-collapse {
    text-align: right;
    padding-top: 0.5rem;
  }
  .navbar-sdberto .navbar-nav {
    align-items: flex-end;
    margin-left: 0;
  }
  .navbar-sdberto .nav-item { margin-left: 0; }
}
.navbar-sdberto .nav-link {
  font-weight: 500;
  color: var(--gray-800);
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.navbar-sdberto .nav-link:hover { color: var(--orange); background: rgba(230,81,0,0.08); }
.navbar-sdberto .nav-link.active { color: var(--orange); background: rgba(230,81,0,0.1); }

/* CTA in nav */
.btn-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: var(--white) !important;
  background: var(--orange);
  border-radius: var(--radius-md);
  border: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-base), background var(--transition-fast);
}
.btn-nav-cta:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(230,81,0,0.35);
}

/* ---------- Buttons ---------- */
.btn-sdberto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-base), background var(--transition-fast), color var(--transition-fast);
}
.btn-sdberto-primary {
  color: var(--white);
  background: var(--orange);
}
.btn-sdberto-primary:hover {
  background: var(--orange-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230,81,0,0.35);
}
.btn-sdberto-outline {
  color: var(--orange);
  background: transparent;
  border: 2px solid var(--orange);
}
.btn-sdberto-outline:hover {
  background: var(--orange);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230,81,0,0.25);
}
.btn-whatsapp {
  background: #25D366;
  color: var(--white);
}
.btn-whatsapp:hover { background: #20BD5A; color: var(--white); }
.btn-sdberto.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* ---------- Hero carousel (index) ---------- */
.hero-carousel-sdberto {
  position: relative;
  width: 100%;
  min-height: 420px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-carousel-sdberto .carousel-item {
  min-height: 420px;
  background: var(--gray-200);
}
.hero-carousel-sdberto .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-carousel-sdberto .carousel-control-prev,
.hero-carousel-sdberto .carousel-control-next {
  width: 48px;
  height: 48px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  opacity: 1;
  border: none;
}
.hero-carousel-sdberto .carousel-control-prev { left: 1rem; }
.hero-carousel-sdberto .carousel-control-next { right: 1rem; }
.hero-carousel-sdberto .carousel-indicators {
  margin-bottom: 1rem;
}
.hero-carousel-sdberto .carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--orange);
  opacity: 0.5;
}
.hero-carousel-sdberto .carousel-indicators .active { opacity: 1; }
.hero-carousel-inline.hero-carousel-sdberto { min-height: 280px; }
.hero-carousel-inline .carousel-item { min-height: 280px; }
@media (min-width: 992px) {
  .hero-carousel-wrap { max-width: 100%; }
  .hero-carousel-inline.hero-carousel-sdberto { min-height: 320px; border-radius: var(--radius-lg); }
  .hero-carousel-inline .carousel-item { min-height: 320px; }
}

/* ---------- Hero ---------- */
.hero-sdberto {
  min-height: auto;
  display: flex;
  align-items: flex-start;
  padding-top: calc(var(--header-height) + 1rem);
  padding-bottom: 2.5rem;
  background: linear-gradient(160deg, var(--gray-50) 0%, var(--white) 50%, rgba(230,81,0,0.04) 100%);
  position: relative;
  overflow: hidden;
}
@media (min-width: 992px) {
  .hero-sdberto { padding-bottom: 3.5rem; }
}
.hero-sdberto::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 150%;
  background: radial-gradient(ellipse, rgba(230,81,0,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(230,81,0,0.1);
  color: var(--orange);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.6s ease forwards;
}
.hero-title {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 800;
  color: var(--black);
  margin-bottom: 1rem;
  animation: fadeInUp 0.6s 0.1s ease both;
}
.hero-title .highlight { color: var(--orange); }
.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  max-width: 520px;
  margin-bottom: 1.75rem;
  animation: fadeInUp 0.6s 0.2s ease both;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  animation: fadeInUp 0.6s 0.3s ease both;
}

/* ---------- Sections ---------- */
.section-sdberto {
  padding: 4rem 0;
}
@media (min-width: 768px) { .section-sdberto { padding: 5rem 0; } }
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title h2 { margin-bottom: 0.5rem; }
.section-title .text-lead { max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- Cards (Services) ---------- */
.card-sdberto {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-fast);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card-sdberto:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(230,81,0,0.2);
}
.card-sdberto .card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(230,81,0,0.1);
  color: var(--orange);
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  transition: transform var(--transition-base), background var(--transition-base);
}
.card-sdberto:hover .card-icon {
  transform: scale(1.08);
  background: rgba(230,81,0,0.15);
}
.card-sdberto .card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.5rem;
}
.card-sdberto .card-text {
  color: var(--gray-600);
  font-size: 0.9375rem;
  flex-grow: 1;
  margin-bottom: 1.25rem;
}
.card-sdberto .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

/* ---------- Media gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--gray-200);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.gallery-item:hover::after { opacity: 1; }
.gallery-item-placeholder {
  background: var(--gray-200) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item-placeholder::before {
  content: 'Médiathèque';
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
}

/* ---------- Footer ---------- */
.footer-sdberto {
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  color: var(--gray-300);
  padding: 0;
  margin-top: 4rem;
  position: relative;
  overflow: hidden;
}
.footer-sdberto::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  opacity: 0.6;
}
.footer-sdberto a { color: var(--gray-300); transition: color var(--transition-fast); }
.footer-sdberto a:hover { color: var(--white); }
.footer-sdberto .footer-inner { padding: 3.5rem 0 2rem; }
.footer-sdberto .footer-brand {
  display: inline-block;
  margin-bottom: 1rem;
}
.footer-sdberto .footer-brand img {
  height: 42px;
  width: auto;
  display: block;
}
.footer-sdberto .footer-tagline {
  font-size: 0.9375rem;
  color: var(--gray-600);
  max-width: 260px;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.footer-sdberto .footer-col-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
  margin-bottom: 1rem;
}
.footer-sdberto .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-sdberto .footer-links li { margin-bottom: 0.5rem; }
.footer-sdberto .footer-links a { font-size: 0.9375rem; }
.footer-sdberto .footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}
.footer-sdberto .footer-contact-item i {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--orange);
  flex-shrink: 0;
}
.footer-sdberto .footer-bottom {
  margin-top: 0;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8125rem;
  color: var(--gray-600);
}
.footer-sdberto .footer-bottom a { color: var(--gray-500); }
.footer-sdberto .footer-bottom a:hover { color: var(--orange); }

/* ---------- WhatsApp floating ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1020;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 20px rgba(37,211,102,0.5);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  animation: pulse-ring 2s ease-in-out infinite;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(37,211,102,0.55);
}
.whatsapp-float svg { width: 28px; height: 28px; }

/* ---------- Chatbot ---------- */
.chatbot-trigger {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  z-index: 1018;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.chatbot-trigger:hover { transform: scale(1.08); box-shadow: 0 12px 32px rgba(230,81,0,0.4); }
.chatbot-panel {
  position: fixed;
  bottom: 7rem;
  right: 1.5rem;
  z-index: 1019;
  width: 340px;
  max-width: calc(100vw - 3rem);
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 56px rgba(0,0,0,0.18);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
}
.chatbot-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.chatbot-header {
  background: var(--orange);
  color: var(--white);
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 0.9375rem;
}
.chatbot-body { padding: 1.25rem; max-height: 320px; overflow-y: auto; }
.chatbot-message {
  background: var(--gray-100);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  color: var(--gray-800);
}
.chatbot-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chatbot-option {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--black);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
.chatbot-option:hover {
  border-color: var(--orange);
  background: rgba(230,81,0,0.06);
  color: var(--orange);
}

/* ---------- Page: Contact form ---------- */
.form-sdberto .form-control,
.form-sdberto .form-select {
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-sdberto .form-control:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(230,81,0,0.15);
  outline: none;
}

/* ---------- Page: Boutique coming soon ---------- */
.coming-soon-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}
.coming-soon-card .icon-placeholder {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: rgba(230,81,0,0.1);
  color: var(--orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,0.5); }
  50% { box-shadow: 0 4px 28px rgba(37,211,102,0.7); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* ---------- Utilities ---------- */
.pt-header { padding-top: var(--header-height); }
.mb-0 { margin-bottom: 0; }
.text-orange { color: var(--orange) !important; }
.bg-orange { background-color: var(--orange) !important; }
