:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --accent: #ff6b35;
  --bg-light: #f0f2f5;
  --card-shadow: 0 2px 12px rgba(0,0,0,.08);
  --card-hover-shadow: 0 8px 30px rgba(0,0,0,.12);
  --radius: 1rem;
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-light);
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── HERO ────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #6610f2 50%, var(--accent) 100%);
  padding: 5rem 0 4rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.hero-section .lead { font-size: 1.15rem; opacity: .9; }

@media (max-width: 768px) {
  .hero-section { padding: 3rem 0 2.5rem; }
  .hero-section h1 { font-size: 1.8rem; }
}

/* ── NAV ─────────────────────────────────── */
.navbar-booking {
  background: rgba(255,255,255,.96) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  transition: var(--transition);
}
.navbar-booking .navbar-brand {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--primary) !important;
}
.navbar-booking .nav-link {
  font-weight: 600;
  font-size: .92rem;
  padding: .6rem 1rem !important;
  border-radius: .5rem;
  transition: var(--transition);
}
.navbar-booking .nav-link:hover,
.navbar-booking .nav-link.active {
  background: rgba(13,110,253,.08);
  color: var(--primary) !important;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── CATEGORY FILTERS ────────────────────── */
.category-filters {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}
.category-chip {
  padding: .45rem 1.1rem;
  border-radius: 2rem;
  border: 2px solid #dee2e6;
  background: #fff;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.category-chip:hover, .category-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,110,253,.25);
}

/* ── ACTIVITY CARDS ──────────────────────── */
.activity-card {
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  height: 100%;
}
.activity-card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-4px);
}
.activity-card .card-img-top {
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}
.activity-card:hover .card-img-top {
  transform: scale(1.03);
}
.activity-card .card-img-wrapper {
  overflow: hidden;
  position: relative;
}
.activity-card .presale-badge {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 2;
}
.activity-card .category-tag {
  position: absolute;
  bottom: .75rem;
  left: .75rem;
  z-index: 2;
  padding: .25rem .65rem;
  border-radius: .4rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #fff;
}
.price-display {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}
.price-display .original {
  font-size: .9rem;
  text-decoration: line-through;
  color: #999;
  font-weight: 500;
}
.meta-info {
  display: flex;
  gap: 1rem;
  font-size: .82rem;
  color: #666;
}
.meta-info i { color: var(--primary); }

/* ── BOOKING MODAL ───────────────────────── */
.participant-counter {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: #f8f9fa;
  border-radius: .75rem;
  margin-bottom: .5rem;
}
.participant-counter .counter-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}
.participant-counter .counter-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #dee2e6;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: var(--transition);
}
.participant-counter .counter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.participant-counter .counter-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}
.participant-counter .count-display {
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  font-size: 1.1rem;
}
.participant-counter .participant-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
}

.schedule-option {
  padding: .75rem 1rem;
  border: 2px solid #dee2e6;
  border-radius: .75rem;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: .5rem;
}
.schedule-option:hover, .schedule-option.selected {
  border-color: var(--primary);
  background: rgba(13,110,253,.04);
}
.schedule-option .spots-left {
  font-size: .78rem;
  padding: .2rem .6rem;
  border-radius: 1rem;
}

/* ── CART SIDEBAR ────────────────────────── */
#cartOffcanvas .offcanvas-header {
  background: linear-gradient(135deg, var(--primary), #6610f2);
  color: #fff;
}
.cart-item {
  padding: 1rem;
  border-radius: .75rem;
  background: #f8f9fa;
  margin-bottom: .75rem;
  position: relative;
}
.cart-item .remove-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #fee2e2;
  color: #dc3545;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: .75rem;
}
.cart-item .remove-btn:hover { background: #dc3545; color: #fff; }

.cart-total-bar {
  background: #f8f9fa;
  border-radius: .75rem;
  padding: 1rem;
}

/* ── ADMIN ───────────────────────────────── */
.admin-sidebar {
  background: #1a1a2e;
  min-height: 100vh;
  color: #fff;
}
.admin-sidebar .nav-link {
  color: rgba(255,255,255,.6);
  padding: .75rem 1.25rem;
  border-radius: .5rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: .15rem;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.admin-sidebar .nav-link i { width: 24px; }

.stat-card {
  border: none;
  border-radius: var(--radius);
  padding: 1.5rem;
  background: #fff;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}
.stat-card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}
.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
}

.admin-table th {
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #666;
  border-bottom-width: 2px;
}
.admin-table td { vertical-align: middle; }

/* ── CHECKOUT ────────────────────────────── */
.checkout-summary {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  position: sticky;
  top: 5rem;
}
.checkout-step {
  padding: .5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: .85rem;
}

/* ── BOOKING MANAGEMENT ──────────────────── */
.booking-status {
  padding: .3rem .75rem;
  border-radius: 1rem;
  font-size: .78rem;
  font-weight: 700;
}
.status-confirmed { background: #d1fae5; color: #065f46; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* ── UTILITIES ───────────────────────────── */
.fade-in {
  animation: fadeInUp .5s ease forwards;
  opacity: 0;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }

.btn-primary-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, #6610f2 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  transition: var(--transition);
}
.btn-primary-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(13,110,253,.35);
  color: #fff;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.section-title {
  font-weight: 800;
  font-size: 1.8rem;
  margin-bottom: .25rem;
}

footer {
  background: #1a1a2e;
  color: rgba(255,255,255,.7);
  padding: 2.5rem 0;
}
footer a { color: rgba(255,255,255,.7); text-decoration: none; }
footer a:hover { color: #fff; }

.page-section { display: none; }
.page-section.active { display: block; }

.toast-container { z-index: 9999; }

/* ── MAP ────────────────────────────────── */
#bookingMapContainer, #seMapContainer {
  z-index: 0;
}
.leaflet-container { font-family: 'Inter', system-ui, sans-serif; }

/* ── LOGIN MODAL ────────────────────────── */
#loginModal .modal-header { border-radius: .75rem .75rem 0 0; }
#loginModal .modal-content { border-radius: .75rem; overflow: hidden; }

/* ── RICH TEXT EDITOR ────────────────────── */
[contenteditable="true"] {
  outline: none;
  line-height: 1.7;
  font-size: .95rem;
}
[contenteditable="true"]:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}
[contenteditable="true"] h3,
[contenteditable="true"] h4 { margin-top: 1rem; margin-bottom: .5rem; }
[contenteditable="true"] ul,
[contenteditable="true"] ol { padding-left: 1.5rem; }
[contenteditable="true"] a { color: var(--bs-primary); }

/* ── LEGAL PAGES ─────────────────────────── */
#privacyContent, #termsContent {
  line-height: 1.8;
}
#privacyContent h3, #termsContent h3,
#privacyContent h4, #termsContent h4 {
  margin-top: 1.5rem;
  margin-bottom: .75rem;
  font-weight: 700;
}
#privacyContent ul, #termsContent ul,
#privacyContent ol, #termsContent ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

/* ── BOOKING CAROUSEL ───────────────────── */
#activityCarousel .carousel-inner img {
  transition: opacity .3s ease;
}
#activityCarousel .carousel-caption {
  bottom: .5rem;
  left: .5rem;
  right: .5rem;
  text-align: center;
}

/* ── GALLERY ADMIN ──────────────────────── */
#actGalleryContainer {
  max-height: 300px;
  overflow-y: auto;
}

/* ── PRINT: nascondi menu admin e filtri in stampa ───── */
@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  .print-only.d-flex { display: flex !important; }
}

/* ── CALENDARIO PRENOTAZIONI (admin) ────────────────── */
.bk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--bg-light, #f0f2f5);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  overflow: hidden;
}
.bk-cal-dow {
  padding: 8px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  background: rgba(0,0,0,.06);
  color: #495057;
}
.bk-cal-day {
  min-height: 72px;
  padding: 6px;
  background: #fff;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.bk-cal-day.bk-cal-empty {
  background: rgba(0,0,0,.03);
}
.bk-cal-day.bk-cal-has {
  background: #f8f9fa;
  border-left: 3px solid var(--primary, #0d6efd);
}
.bk-cal-day.bk-cal-has-schedule {
  background: #fff8e6;
  border-left: 3px solid #ffc107;
}
.bk-cal-day.bk-cal-has-booking {
  background: #e8f5e9;
  border-left: 3px solid #198754;
}
.bk-cal-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  margin-bottom: 4px;
  max-height: 36px;
  overflow: hidden;
}
.bk-cal-act {
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bk-cal-act-clickable:hover {
  text-decoration: underline;
  opacity: 0.9;
}
.bk-cal-legend-booking {
  background: #e8f5e9;
  padding: 1px 6px;
  border-radius: 4px;
  border-left: 3px solid #198754;
}
.bk-cal-legend-schedule {
  background: #fff8e6;
  padding: 1px 6px;
  border-radius: 4px;
  border-left: 3px solid #ffc107;
}
.bk-cal-num {
  font-weight: 700;
  color: #212529;
  margin-bottom: 4px;
}
.bk-cal-stats {
  line-height: 1.3;
  text-align: center;
  color: #495057;
}
.bk-cal-legend {
  color: #6c757d;
}

/* Editor multilingua: una sola toolbar, un solo tab-pane visibile alla volta */
.ml-editor-tab-content .tab-pane {
  display: none !important;
}
.ml-editor-tab-content .tab-pane.show.active {
  display: block !important;
}

/* Impostazioni Privacy/Termini: una sola toolbar per card (nasconde eventuali duplicate) */
#settingsCardPrivacy .settings-editor-toolbar ~ .settings-editor-toolbar,
#settingsCardTerms .settings-editor-toolbar ~ .settings-editor-toolbar,
#settingsCardPrivacy .settings-toolbar-wrap ~ .settings-toolbar-wrap,
#settingsCardTerms .settings-toolbar-wrap ~ .settings-toolbar-wrap {
  display: none !important;
}
