/* ============================================================
   LayosCamp — Popup "Plazas limitadas" & Floating CTA
   Brand colors: #8BA841 (primary green), #A4C256 (light green),
                 #6B8A2F (dark green), #F0F4E8 (background)
   ============================================================ */

/* ── Popup overlay ── */
.lc-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  visibility: hidden;
  transition: background 0.35s ease, opacity 0.35s ease, visibility 0.35s ease;
}

.lc-popup-overlay--visible {
  background: rgba(0, 0, 0, 0.55);
  opacity: 1;
  visibility: visible;
}

.lc-popup-overlay--closing {
  opacity: 0;
  visibility: hidden;
}

/* ── Popup card ── */
.lc-popup {
  position: relative;
  width: 100%;
  max-width: 460px;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.25),
    0 8px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lc-popup-overlay--visible .lc-popup {
  transform: translateY(0) scale(1);
}

.lc-popup-overlay--closing .lc-popup {
  transform: translateY(20px) scale(0.96);
}

/* ── Close button ── */
.lc-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.lc-popup__close:hover,
.lc-popup__close:focus-visible {
  background: rgba(255, 255, 255, 0.45);
  transform: scale(1.1);
  outline: none;
}

.lc-popup__close:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
}

.lc-popup__close svg {
  display: block;
}

/* ── Header ── */
.lc-popup__header {
  position: relative;
  padding: 32px 24px 24px;
  text-align: center;
  overflow: hidden;
}

/* Decorative circles in header */
.lc-popup__header::before,
.lc-popup__header::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.lc-popup__header::before {
  width: 180px;
  height: 180px;
  top: -60px;
  right: -40px;
}

.lc-popup__header::after {
  width: 120px;
  height: 120px;
  bottom: -30px;
  left: -30px;
}

.lc-popup__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.lc-popup__title {
  position: relative;
  margin: 0;
  padding: 0;
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  letter-spacing: 0.01em;
}

/* ── Body ── */
.lc-popup__body {
  padding: 24px 28px 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #4a4a4a;
}

.lc-popup__body p {
  margin: 0 0 12px;
}

.lc-popup__body p:last-child {
  margin-bottom: 0;
}

.lc-popup__body strong {
  color: #2c3e50;
  font-weight: 600;
}

/* ── Footer ── */
.lc-popup__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 28px 28px;
}

/* CTA button */
.lc-popup__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(139, 168, 65, 0.35);
}

.lc-popup__cta:hover,
.lc-popup__cta:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 168, 65, 0.45);
  color: #fff;
  text-decoration: none;
}

.lc-popup__cta:active {
  transform: translateY(0);
}

/* Dismiss link */
.lc-popup__dismiss {
  padding: 4px 8px;
  border: none;
  background: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.82rem;
  color: #999;
  cursor: pointer;
  transition: color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.lc-popup__dismiss:hover,
.lc-popup__dismiss:focus-visible {
  color: #555;
  text-decoration: underline;
}

/* ── Floating CTA button ── */
.lc-floating-cta {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 28px;
  background: #8BA841;
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 6px 20px rgba(139, 168, 65, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s ease,
              background 0.2s ease,
              box-shadow 0.2s ease;
}

.lc-floating-cta--visible {
  transform: translateY(0);
  opacity: 1;
}

.lc-floating-cta:hover,
.lc-floating-cta:focus-visible {
  background: #7A952F;
  box-shadow:
    0 8px 28px rgba(139, 168, 65, 0.55),
    0 3px 8px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
}

.lc-floating-cta:active {
  transform: translateY(0);
}

/* Pulse animation for the floating CTA */
.lc-floating-cta--visible::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 32px;
  background: rgba(139, 168, 65, 0.3);
  animation: lc-cta-pulse 2.5s ease-in-out 2s 3;
  pointer-events: none;
}

@keyframes lc-cta-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

/* ── Hide on admin pages (toolbar present) ── */
body.toolbar-horizontal .lc-floating-cta,
body.toolbar-vertical .lc-floating-cta,
body.toolbar-horizontal .lc-popup-overlay,
body.toolbar-vertical .lc-popup-overlay {
  display: none !important;
}

/* ── Hide floating CTA on camp detail pages (has its own "Seleccionar" button) ── */
body.page-node-type-detalle-de-campamento .lc-floating-cta {
  display: none !important;
}

/* ── Hide floating CTA on campamentos listing (it IS the campamentos page) ── */
body.page-route-layoscamp-catalogo-campamentos .lc-floating-cta {
  display: none !important;
}

/* ── Hide floating CTA on inscription/checkout forms ── */
body.path-panel .lc-floating-cta {
  display: none !important;
}

/* ── Hide floating CTA when chatbot is open ── */
body.lc-chat-open .lc-floating-cta {
  display: none !important;
}

/* ── Hide on checkout/cart pages ── */
body.page-node-type-checkout .lc-floating-cta,
body[class*="commerce-checkout"] .lc-floating-cta {
  display: none !important;
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .lc-popup {
    max-width: 100%;
    border-radius: 12px;
  }

  .lc-popup__header {
    padding: 24px 20px 20px;
  }

  .lc-popup__title {
    font-size: 1.35rem;
  }

  .lc-popup__body {
    padding: 20px 20px 8px;
    font-size: 0.9rem;
  }

  .lc-popup__footer {
    padding: 12px 20px 24px;
  }

  .lc-popup__cta {
    padding: 14px 20px;
    font-size: 1rem;
  }

  .lc-floating-cta {
    bottom: 14px;
    right: 14px;
    padding: 12px 22px;
    font-size: 0.88rem;
    border-radius: 24px;
  }
}

@media (max-width: 360px) {
  .lc-floating-cta {
    right: 10px;
    bottom: 10px;
    padding: 10px 18px;
    font-size: 0.82rem;
  }
}
