/**
 * [B] Programs Showcase — Frontend Styles
 *
 * Design adapted from the Marian Iturre Programas section.
 * Uses CSS custom properties injected from plugin settings.
 *
 * @package BDW_Programs_Showcase
 */

/* ── GRID ────────────────────────────────────── */
.bdw-ps-grid {
  display: grid;
  gap: 2px;
  margin-top: 0;
}

.bdw-ps-columns-1 {
  grid-template-columns: 1fr;
}

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

.bdw-ps-columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

.bdw-ps-columns-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ── CARD — Matches reference design ────────── */
.bdw-ps-card {
  background: #fff;
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s ease;
}

.bdw-ps-card.bdw-ps-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Bottom accent bar — animates on hover (like reference) */
.bdw-ps-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--bdw-ps-primary, #E8601A);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bdw-ps-card:hover {
  background: #faf8f5;
}

.bdw-ps-card:hover::after {
  width: 100%;
}

/* Highlighted card */
.bdw-ps-card--highlight::after {
  width: 100%;
}

/* ── ICON ────────────────────────────────────── */
.bdw-ps-card-icon {
  font-size: 28px;
  margin-bottom: 20px;
  display: block;
  line-height: 1;
}

/* ── TITLE ───────────────────────────────────── */
.bdw-ps-card-title {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 12px;
  color: #2a2926;
  line-height: 1.2;
}

/* ── DESCRIPTION ─────────────────────────────── */
.bdw-ps-card-description {
  font-size: 14px;
  line-height: 1.7;
  color: #7a7672;
  margin-bottom: 20px;
  max-width: 100%;
}

/* ── DURATION TAG — Bottom tag like reference ── */
.bdw-ps-card-duration {
  display: inline-block;
  margin-top: 20px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bdw-ps-primary, #E8601A);
  border-bottom: 1px solid var(--bdw-ps-primary, #E8601A);
  padding-bottom: 1px;
}

/* ── CARD BUTTON — hidden when card is clickable ── */
.bdw-ps-card-btn {
  display: none;
}

/* ── MODAL OVERLAY ───────────────────────────── */
.bdw-ps-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 17, 16, 0);
  backdrop-filter: blur(0);
  opacity: 0;
  visibility: hidden;
  transition:
    background 0.35s ease,
    backdrop-filter 0.35s ease,
    opacity 0.35s ease,
    visibility 0s 0.35s;
}

.bdw-ps-modal-overlay.bdw-ps-modal--open {
  background: rgba(17, 17, 16, 0.7);
  backdrop-filter: blur(4px);
  opacity: 1;
  visibility: visible;
  transition:
    background 0.35s ease,
    backdrop-filter 0.35s ease,
    opacity 0.35s ease,
    visibility 0s 0s;
}

/* ── MODAL ───────────────────────────────────── */
.bdw-ps-modal {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.bdw-ps-modal-overlay.bdw-ps-modal--open .bdw-ps-modal {
  transform: translateY(0) scale(1);
}

/* ── MODAL CLOSE ─────────────────────────────── */
.bdw-ps-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #e0ddd8;
  color: #2a2926;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  z-index: 2;
  line-height: 1;
}

.bdw-ps-modal-overlay .bdw-ps-modal-close:hover,
.bdw-ps-modal-overlay .bdw-ps-modal-close:focus-visible {
  background: var(--bdw-ps-primary, #E8601A);
  color: #fff;
  border-color: var(--bdw-ps-primary, #E8601A);
  outline: none;
  box-shadow: none;
}

/* ── MODAL HEADER ────────────────────────────── */
.bdw-ps-modal-header {
  padding: 40px 40px 0;
  text-align: center;
}

.bdw-ps-modal-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  line-height: 1;
}

.bdw-ps-modal-title {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 32px;
  font-weight: 400;
  color: #2a2926;
  margin: 0 0 12px;
  line-height: 1.2;
}

.bdw-ps-modal-duration {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bdw-ps-primary-alpha, rgba(232, 96, 26, 0.1));
  color: var(--bdw-ps-primary, #E8601A);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── MODAL IMAGE ─────────────────────────────── */
.bdw-ps-modal-image {
  padding: 20px 40px;
  display: flex;
  justify-content: center;
  background: #f9f7f4;
}

.bdw-ps-modal-image img {
  max-height: 180px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ── MODAL BODY ──────────────────────────────── */
.bdw-ps-modal-body {
  padding: 28px 40px;
  font-size: 15px;
  line-height: 1.8;
  color: #5a5652;
}

.bdw-ps-modal-body ul,
.bdw-ps-modal-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.bdw-ps-modal-body li {
  margin-bottom: 8px;
}

.bdw-ps-modal-body p {
  margin-bottom: 16px;
  max-width: 100%;
}

/* ── MODAL FOOTER ────────────────────────────── */
.bdw-ps-modal-footer {
  padding: 0 40px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid #e0ddd8;
  padding-top: 28px;
  margin: 0 40px;
  padding-left: 0;
  padding-right: 0;
}

.bdw-ps-modal-price {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 32px;
  color: var(--bdw-ps-primary, #E8601A);
  font-weight: 400;
  line-height: 1;
}

.bdw-ps-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.bdw-ps-modal-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--bdw-ps-primary, #E8601A);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease;
  line-height: 1;
}

.bdw-ps-modal-cta:hover {
  background: var(--bdw-ps-primary-dim, #c04d12);
  color: #fff;
  text-decoration: none;
}

/* Ghost (secondary) CTA — like the reference design */
.bdw-ps-modal-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 32px;
  background: transparent;
  color: var(--bdw-ps-primary, #E8601A);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--bdw-ps-primary, #E8601A);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  line-height: 1;
}

.bdw-ps-modal-ghost:hover {
  background: var(--bdw-ps-primary, #E8601A);
  color: #fff;
  text-decoration: none;
}

/* PayPal card form expanded — Compact & Centered experience */
.bdw-ps-modal-footer.bdw-ps-footer-expanded {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.bdw-ps-footer-expanded .bdw-ps-modal-price {
  width: auto;
  font-size: 26px;
  margin-bottom: 5px;
}

.bdw-ps-footer-expanded .bdw-ps-modal-actions {
  width: 100%;
  max-width: 400px; /* Tamanho ideal de checkout */
  margin: 0 auto;
}

.bdw-ps-footer-expanded #bdwPsModalPayPalButton {
  width: 100%;
}

.bdw-ps-footer-expanded .bdw-ps-modal-ghost {
  display: none !important;
}

.bdw-ps-modal-ghost {
  transition: background 0.25s ease, color 0.25s ease, opacity 0.3s ease;
}

/* ── MODAL BENEFITS LIST ────────────────────────── */
.bdw-ps-modal-benefits-title {
  margin-top: 24px;
  margin-bottom: 16px;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 400;
  color: #2a2926;
}

.bdw-ps-modal-benefits-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.bdw-ps-modal-benefits-list li {
  font-size: 15px;
  color: #2a2926;
  margin-bottom: 10px;
  position: relative;
  padding-left: 24px;
  line-height: 1.6;
}

.bdw-ps-modal-benefits-list li::before {
  content: '✓';
  color: var(--bdw-ps-primary, #E8601A);
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* ── NO PROGRAMS ─────────────────────────────── */
.bdw-ps-no-programs {
  text-align: center;
  color: #7a7672;
  font-size: 15px;
  padding: 40px 20px;
}

/* ── FEATURED LAYOUT ─────────────────────────── */
.bdw-ps-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  background: #fff;
  padding: 40px;
  border: 1px solid #e0ddd8;
}

.bdw-ps-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.bdw-ps-featured-info h3 {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 16px;
  color: #2a2926;
}

.bdw-ps-featured-tag {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bdw-ps-primary-alpha, rgba(232, 96, 26, 0.1));
  color: var(--bdw-ps-primary, #E8601A);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.bdw-ps-featured-info p {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 24px;
  max-width: 100%;
  color: #7a7672;
}

.bdw-ps-featured-benefits {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.bdw-ps-featured-benefit {
  font-size: 14px;
  color: #2a2926;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.bdw-ps-featured-benefit::before {
  content: '✓';
  color: var(--bdw-ps-primary, #E8601A);
  font-weight: bold;
  flex-shrink: 0;
}

.bdw-ps-featured-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 14px 32px;
  background: var(--bdw-ps-primary, #E8601A);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease;
}

.bdw-ps-featured-btn:hover {
  background: var(--bdw-ps-primary-dim, #c04d12);
}

/* ── BITÁCORAS ───────────────────────────────── */
.bdw-ps-bitacoras-grid {
  display: grid;
  gap: 20px;
  margin-top: 0;
}

.bdw-ps-bitacoras-columns-2 {
  grid-template-columns: repeat(2, 1fr);
}

.bdw-ps-bitacoras-columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

.bdw-ps-bitacoras-columns-4 {
  grid-template-columns: repeat(4, 1fr);
}

.bdw-ps-bitacora-card.bdw-ps-card {
  background: #fff;
  border: 1px solid #e0ddd8;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition:
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bdw-ps-bitacora-card.bdw-ps-card::after {
  display: none;
}

.bdw-ps-bitacora-card.bdw-ps-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  background: #fff;
}

.bdw-ps-bitacora-cover {
  width: 100%;
  height: 160px;
  background: #f7f5f2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.bdw-ps-bitacora-cover img {
  max-width: 100%;
  max-height: 128px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bdw-ps-bitacora-card:hover .bdw-ps-bitacora-cover img {
  transform: scale(1.03);
}

.bdw-ps-bitacora-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #e8ddd0, #c9bfb4);
}

.bdw-ps-bitacora-info {
  padding: 16px 20px 20px;
}

.bdw-ps-bitacora-info h3 {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 6px;
  color: #2a2926;
  line-height: 1.2;
}

.bdw-ps-bitacora-info p {
  font-size: 12px;
  line-height: 1.6;
  color: #7a7672;
  margin-bottom: 12px;
}

.bdw-ps-bitacora-price {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 22px;
  color: var(--bdw-ps-primary, #E8601A);
  margin-bottom: 12px;
  display: block;
  font-weight: 400;
  line-height: 1;
}

.bdw-ps-bitacora-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bdw-ps-primary, #E8601A);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease;
  line-height: 1;
}

.bdw-ps-bitacora-card:hover .bdw-ps-bitacora-btn {
  background: var(--bdw-ps-primary-dim, #c04d12);
}

/* ── RESPONSIVE ──────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {

  .bdw-ps-columns-3,
  .bdw-ps-columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .bdw-ps-grid {
    gap: 2px;
  }

  .bdw-ps-featured {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .bdw-ps-featured-benefits {
    grid-template-columns: 1fr;
  }

  .bdw-ps-bitacoras-columns-3,
  .bdw-ps-bitacoras-columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .bdw-ps-bitacoras-grid {
    gap: 24px;
  }
}

/* Mobile */
@media (max-width: 768px) {

  .bdw-ps-columns-2,
  .bdw-ps-columns-3,
  .bdw-ps-columns-4 {
    grid-template-columns: 1fr;
  }

  .bdw-ps-card {
    padding: 32px 24px;
  }

  .bdw-ps-modal {
    max-width: 100%;
    max-height: 90vh;
  }

  .bdw-ps-modal-header {
    padding: 32px 24px 0;
  }

  .bdw-ps-modal-body {
    padding: 24px;
  }

  .bdw-ps-modal-footer {
    margin: 0 24px;
    padding-bottom: 32px;
    flex-direction: column;
    text-align: center;
  }

  .bdw-ps-modal-actions {
    flex-direction: column;
    width: 100%;
  }

  .bdw-ps-modal-close {
    top: 12px;
    right: 12px;
  }

  .bdw-ps-modal-title {
    font-size: 26px;
  }

  .bdw-ps-modal-price {
    font-size: 28px;
  }

  .bdw-ps-modal-cta {
    width: 100%;
    justify-content: center;
  }

  .bdw-ps-modal-ghost {
    width: 100%;
    justify-content: center;
  }

  .bdw-ps-modal-image {
    padding: 20px 24px 0;
  }

  .bdw-ps-bitacoras-columns-2,
  .bdw-ps-bitacoras-columns-3,
  .bdw-ps-bitacoras-columns-4 {
    grid-template-columns: 1fr;
  }

  .bdw-ps-bitacora-card.bdw-ps-card {
    padding: 0;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .bdw-ps-card {
    padding: 28px 20px;
  }

  .bdw-ps-card-icon {
    font-size: 36px;
  }

  .bdw-ps-card-title {
    font-size: 22px;
  }

  .bdw-ps-modal-overlay {
    padding: 12px;
  }
}

/* Scrollbar styling for modal */
.bdw-ps-modal::-webkit-scrollbar {
  width: 4px;
}

.bdw-ps-modal::-webkit-scrollbar-track {
  background: transparent;
}

.bdw-ps-modal::-webkit-scrollbar-thumb {
  background: #d0ccc6;
  border-radius: 2px;
}