/* ============================================
   JBE Promo Modal - Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* Overlay */
.jbe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 10, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.jbe-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal */
.jbe-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 99999;
  width: 92%;
  max-width: 520px;
  max-height: 90vh;
  background: linear-gradient(145deg, #f0f7e6 0%, #e8f0da 40%, #dce8cc 100%);
  border-radius: 24px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 25px 60px rgba(20, 40, 10, 0.3),
    0 0 0 1px rgba(255,255,255,0.3) inset,
    0 2px 0 rgba(255,255,255,0.5) inset;
}

.jbe-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Scroll interne */
.jbe-modal-scroll {
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.jbe-modal-scroll::-webkit-scrollbar {
  width: 4px;
}

.jbe-modal-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.jbe-modal-scroll::-webkit-scrollbar-thumb {
  background: rgba(74,124,36,0.3);
  border-radius: 4px;
}

/* Close button */
.jbe-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.jbe-modal-close:hover {
  background: #fff;
  transform: rotate(90deg) scale(1.1);
}

.jbe-modal-close svg {
  width: 16px;
  height: 16px;
  stroke: #3a5a20;
  stroke-width: 2.5;
}

/* Header */
.jbe-modal-header {
  position: relative;
  padding: 32px 28px 18px;
  text-align: center;
  overflow: hidden;
}

.jbe-modal-header::before {
  content: '';
  position: absolute;
  top: -30px;
  left: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(100,160,50,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.jbe-modal-header::after {
  content: '🌿';
  position: absolute;
  top: 12px;
  left: 20px;
  font-size: 1.4rem;
  opacity: 0.6;
  animation: jbe-sway 4s ease-in-out infinite;
}

@keyframes jbe-sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.jbe-modal-badge {
  display: inline-block;
  background: linear-gradient(135deg, #4a7c24, #3a6018);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.jbe-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #2d5016;
  line-height: 1.25;
  margin-bottom: 4px;
}

.jbe-modal-subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: #5a8a30;
}

/* Body */
.jbe-modal-body {
  padding: 0 28px 24px;
  text-align: center;
}

.jbe-modal-dates {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(100,160,50,0.2);
  border-radius: 14px;
  padding: 10px 20px;
  margin-bottom: 16px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: #3a5a20;
  font-size: 0.95rem;
}

.jbe-modal-dates svg {
  width: 18px;
  height: 18px;
  stroke: #5a8a30;
  flex-shrink: 0;
}

.jbe-modal-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #4a5a3a;
  margin-bottom: 18px;
}

.jbe-modal-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.jbe-highlight {
  background: rgba(255,255,255,0.5);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: #3a5a20;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}

.jbe-highlight-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.jbe-modal-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d5016;
  margin-bottom: 18px;
}

.jbe-modal-price span {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: #6a8a50;
}

/* Actions */
.jbe-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jbe-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #4a7c24 0%, #3a6018 100%);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(60,100,20,0.3);
  text-decoration: none;
}

.jbe-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(60,100,20,0.4);
  background: linear-gradient(135deg, #5a8c34 0%, #4a7024 100%);
  color: #fff;
  text-decoration: none;
}

.jbe-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: #5a8a30;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  padding: 8px;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
}

.jbe-btn-secondary:hover {
  color: #2d5016;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 560px) {
  .jbe-modal {
    width: 96%;
    max-height: 92vh;
    border-radius: 20px;
  }

  .jbe-modal-header {
    padding: 24px 20px 14px;
  }

  .jbe-modal-title {
    font-size: 1.4rem;
  }

  .jbe-modal-body {
    padding: 0 20px 20px;
  }

  .jbe-modal-highlights {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   SLIDE-IN CTA (visible après fermeture modal)
   ============================================ */
.jbe-slidein {
  position: fixed;
  right: -340px;
  bottom: 24px;
  z-index: 99990;
  width: 300px;
  transition: right 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.jbe-slidein.active {
  right: 20px;
}

.jbe-slidein-card {
  background: linear-gradient(145deg, #f0f7e6, #e2edcf);
  border-radius: 20px;
  padding: 20px;
  box-shadow:
    0 12px 40px rgba(20, 40, 10, 0.2),
    0 0 0 1px rgba(255,255,255,0.3) inset;
  position: relative;
  overflow: hidden;
}

.jbe-slidein-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(100,160,50,0.12) 0%, transparent 70%);
  border-radius: 0 20px 0 0;
}

.jbe-slidein-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.jbe-slidein-close:hover {
  background: #fff;
  transform: scale(1.1);
}

.jbe-slidein-close svg {
  width: 12px;
  height: 12px;
  stroke: #3a5a20;
  stroke-width: 2.5;
}

.jbe-slidein-leaf {
  font-size: 1rem;
  margin-bottom: 8px;
  display: block;
}

.jbe-slidein-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2d5016;
  margin-bottom: 4px;
  line-height: 1.3;
}

.jbe-slidein-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: #5a8a30;
  font-weight: 500;
  margin-bottom: 10px;
}

.jbe-slidein-info {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: #4a5a3a;
  line-height: 1.5;
  margin-bottom: 14px;
}

.jbe-slidein-price {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #2d5016;
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.jbe-slidein-price span {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: #6a8a50;
}

.jbe-slidein-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, #4a7c24, #3a6018);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(60,100,20,0.25);
}

.jbe-slidein-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(60,100,20,0.35);
}

/* Mini toggle (quand slide-in fermé) */
.jbe-mini-toggle {
  position: fixed;
  right: -60px;
  bottom: 24px;
  z-index: 99989;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #4a7c24, #3a6018);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(60,100,20,0.35);
  transition: all 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  animation: none;
}

.jbe-mini-toggle.active {
  right: 20px;
  animation: jbe-pulse 2.5s ease-in-out infinite 1s;
}

.jbe-mini-toggle:hover {
  transform: scale(1.1);
}

.jbe-mini-icon {
  font-size: 1.3rem;
  line-height: 1;
}

@keyframes jbe-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(60,100,20,0.35); }
  50% { box-shadow: 0 4px 30px rgba(60,100,20,0.55), 0 0 0 8px rgba(74,124,36,0.1); }
}

@media (max-width: 560px) {
  .jbe-slidein {
    width: calc(100% - 32px);
    bottom: 16px;
  }

  .jbe-slidein.active {
    right: 16px;
  }

  .jbe-mini-toggle.active {
    right: 16px;
    bottom: 16px;
  }
}

/* ============================================
   LIGHTBOX PROGRAMME
   ============================================ */
.jbe-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 5, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.jbe-lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.jbe-lightbox {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  z-index: 100001;
  width: 94%;
  max-width: 600px;
  max-height: 92vh;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.jbe-lightbox.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.jbe-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f0f7e6, #e8f0da);
  border-bottom: 1px solid rgba(100,160,50,0.15);
  flex-shrink: 0;
}

.jbe-lightbox-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #2d5016;
}

.jbe-lightbox-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.jbe-lightbox-close:hover {
  background: #fff;
  transform: rotate(90deg) scale(1.1);
}

.jbe-lightbox-close svg {
  width: 14px;
  height: 14px;
  stroke: #3a5a20;
  stroke-width: 2.5;
}

.jbe-lightbox-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.jbe-lightbox-body::-webkit-scrollbar {
  width: 4px;
}

.jbe-lightbox-body::-webkit-scrollbar-thumb {
  background: rgba(74,124,36,0.3);
  border-radius: 4px;
}

.jbe-lightbox-img {
  display: block;
  width: 100%;
  height: auto;
}

.jbe-lightbox-footer {
  padding: 14px 18px;
  background: linear-gradient(135deg, #f0f7e6, #e8f0da);
  border-top: 1px solid rgba(100,160,50,0.15);
  text-align: center;
  flex-shrink: 0;
}

.jbe-btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #4a7c24 0%, #3a6018 100%);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  padding: 11px 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 12px rgba(60,100,20,0.25);
  text-decoration: none;
}

.jbe-btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(60,100,20,0.4);
  background: linear-gradient(135deg, #5a8c34 0%, #4a7024 100%);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 560px) {
  .jbe-lightbox {
    width: 97%;
    max-height: 94vh;
    border-radius: 16px;
  }

  .jbe-lightbox-header,
  .jbe-lightbox-footer {
    padding: 12px 14px;
  }

  .jbe-lightbox-title {
    font-size: 0.9rem;
  }
}
