:root {
  --primary: #355B66;
  --secondary: #2E4E57;
  --bg: #F7F5F2;
  --accent: #EAE3DB;
  --text: #1F2A30;
  --border: #D8D2CB;
  --white: #ffffff;
  --danger: #D62828;
  --danger-dark: #B71C1C;
  --success-bg: #def5e5;
  --success-text: #1d6b3c;
  --warning-bg: #f8e9cc;
  --warning-text: #996c00;
  --ended-bg: #f2d9d9;
  --ended-text: #8e2f2f;
  --shadow-sm: 0 8px 18px rgba(31, 42, 48, 0.06);
  --shadow-md: 0 12px 28px rgba(31, 42, 48, 0.09);
  --shadow-lg: 0 18px 45px rgba(31, 42, 48, 0.12);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

body.menu-open,
body.popup-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

section {
  padding: 3rem 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin-top: 0;
}

h2 {
  color: var(--secondary);
  margin-bottom: 1rem;
}

p {
  margin-top: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  gap: 1rem;
}

.logo {
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.2px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-links a:hover {
  background: var(--accent);
}

.nav-links a.active,
.cart-link.active {
  color: #b8895a;
  font-weight: 700;
  background: rgba(184, 137, 90, 0.1);
}

.cart-link span {
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* Hero */
.hero {
  padding: 4.5rem 0;
  background: linear-gradient(130deg, var(--accent), var(--bg));
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 0.8rem;
  color: var(--secondary);
}

.hero p {
  max-width: 800px;
  font-size: 1.04rem;
  color: rgba(31, 42, 48, 0.9);
}

.section-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(53, 91, 102, 0.1);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Layout helpers */
.grid {
  display: grid;
  gap: 1.35rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card img {
  width: 100%;
  display: block;
}

.card-content {
  padding: 1.15rem;
}

.card-content h3 {
  margin-bottom: 0.55rem;
}

.card-content p:last-child {
  margin-bottom: 0;
}

/* Standard product/session card fix */
.session-card,
.home-session-card,
.product-card,
.home-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}

.session-card .card-content,
.home-session-card .card-content,
.product-card .card-content,
.home-product-card .card-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.session-card .btn,
.home-session-card .btn,
.product-card .btn,
.home-product-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Session media */
.session-card-media,
.home-session-media {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #ece7e0;
}

.session-card-media img,
.home-session-media img,
.home-session-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.session-card-media img,
.home-session-media img,
.home-session-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product media */
.product-card img,
.home-product-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #f1ede8;
}

/* Remove strange stretched heights */
.home-product-card img,
.boutique-grid .product-card img,
.product-card img {
  max-height: none;
}

.home-session-card img,
.session-card img {
  max-height: none;
}

/* Specific homepage cards */
.home-session-card {
  min-height: 100%;
}

.home-product-card {
  min-height: 100%;
}

/* Gallery */
.gallery-grid {
  columns: 3 220px;
  column-gap: 1rem;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  break-inside: avoid;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--primary);
  color: var(--white);
  background: var(--primary);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.btn:hover {
  background: var(--secondary);
  border-color: var(--secondary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--accent);
  border-color: var(--primary);
  color: var(--primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Badges */
.badge {
  padding: 0.24rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  display: inline-block;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.badge-ouverte {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-complète {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-terminée {
  background: var(--ended-bg);
  color: var(--ended-text);
}

/* Forms */
form {
  display: grid;
  gap: 0.8rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.78rem;
  background: var(--white);
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

th,
td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f3efea;
}

/* Alerts */
.alert {
  padding: 0.8rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.alert-success {
  background: #e0f5e6;
  color: #1c6a38;
}

.alert-error {
  background: #f9dfdf;
  color: #8f2d2d;
}

/* Footer */
.site-footer {
  background: var(--secondary);
  color: #e9f1f3;
  margin-top: 3rem;
  padding-top: 2rem;
}

.site-footer a {
  color: #e9f1f3;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.3rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.copyright {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 0;
  margin: 1.4rem 0 0;
}

/* Admin */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--secondary);
  color: #fff;
  padding: 1rem;
}

.admin-sidebar h2 {
  color: #fff;
}

.admin-sidebar a {
  color: #fff;
  display: block;
  margin: 0.5rem 0;
  text-decoration: none;
  padding: 0.35rem 0;
}

.admin-content {
  padding: 1.5rem;
}

.admin-content img {
  max-width: 100%;
}

.flex-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

/* Session promotion */
.session-card,
.home-session-card {
  position: relative;
}

.promo-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--danger), #f77f00);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.price-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.2rem;
}

.old-price {
  color: #8b8b8b;
  text-decoration: line-through;
}

.new-price {
  color: var(--danger);
  font-weight: 800;
  font-size: 1.05rem;
}

.normal-price {
  color: var(--text);
  font-weight: 700;
}

/* Popup */
.session-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.session-popup-overlay.active {
  display: flex;
}

.session-popup-box {
  width: 100%;
  max-width: 760px;
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  animation: popupFadeIn 0.28s ease;
}

.session-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}

.session-popup-close:hover {
  background: rgba(0, 0, 0, 0.78);
}

.session-popup-media {
  position: relative;
}

.session-popup-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.session-popup-content {
  padding: 24px;
}

.session-popup-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f4e1c1;
  color: #7a4b12;
  font-size: 13px;
  font-weight: 700;
}

.session-popup-content h3 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  line-height: 1.2;
}

.session-popup-content p {
  margin: 0 0 10px;
  color: #444;
}

.session-popup-price {
  margin: 0 0 16px;
}

/* Boutique */
.boutique-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
  justify-content: center;
}

.boutique-grid .product-card {
  width: 100%;
}

/* Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    right: 4%;
    top: 72px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    min-width: 220px;
    align-items: stretch;
  }

  .nav-links a {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-links.open {
    display: flex;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    columns: 2 160px;
  }

  .session-popup-box {
    max-width: 680px;
  }

  .session-popup-image {
    height: 260px;
  }

  .session-popup-content {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  section {
    padding: 2.4rem 0;
  }

  .hero {
    padding: 3.5rem 0;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .home-session-media,
  .session-card-media {
    aspect-ratio: 16 / 11;
  }

  .card-content {
    padding: 1rem;
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    columns: 1;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  th {
    display: none;
  }

  td {
    border-bottom: 1px solid var(--border);
  }

  .promo-badge {
    top: 10px;
    right: 10px;
    font-size: 12px;
    padding: 7px 10px;
  }

  .session-popup-overlay {
    padding: 12px;
  }

  .session-popup-image {
    height: 220px;
  }

  .session-popup-content {
    padding: 16px;
  }

  .session-popup-close {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }
}


.home-session-card,
.home-product-card {
  max-width: 340px;
  margin: 0 auto;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 340px));
  justify-content: start;
}