/*!
 * ModxEasy widget base styles — emitted on every page that includes
 * [[!ModxEasy]] or any frontend rendering. Theme CSS can override any
 * .mxe-* class to match the site's look; defaults are sensible but minimal.
 */

/* ─── Layout: sections / columns / page wrapper ──────────────────────── */
.mxe-page { width: 100%; }
.mxe-page .mxe-section {
  width: 100%;
  display: block;
  padding: 0;
}
.mxe-page .mxe-section-row,
.mxe-page .mxe-section > .mxe-column,
.mxe-page .mxe-section {
  /* Sections wrap their columns directly in renderer output. */
}
.mxe-section {
  display: block;
  width: 100%;
}
.mxe-section > .mxe-column,
.mxe-section .mxe-column {
  display: inline-block;
  vertical-align: top;
  width: var(--mxe-w, 100%);
  padding: 0;
  box-sizing: border-box;
}
/* Render columns horizontally via flex on the immediate child container. */
.mxe-section {
  font-size: 0; /* kill inline-block whitespace */
}
.mxe-section > .mxe-column {
  font-size: 1rem;
}
@media (max-width: 640px) {
  .mxe-section > .mxe-column { width: 100% !important; display: block; }
}

/* ─── Headings / Text / Image / Button / Divider / Spacer ────────────── */
.mxe-w { box-sizing: border-box; }
.mxe-w-heading { margin: 0 0 0.5em; line-height: 1.2; font-weight: 700; }
.mxe-w-text { line-height: 1.55; margin: 0 0 1em; }
.mxe-w-image { max-width: 100%; height: auto; display: block; }
.mxe-w-image-wrap { display: block; }
.mxe-w-image-wrap .mxe-w-image { display: inline-block; }
.mxe-w-image-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; background: #f3f4f6; color: #6b7280; font-size: 12px;
  border: 1px dashed #d1d5db; border-radius: 4px;
}
.mxe-w-button {
  display: inline-block; padding: 10px 22px; text-decoration: none;
  border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.mxe-w-button:hover { opacity: 0.9; transform: translateY(-1px); }
.mxe-w-button-primary { background: #4f46e5; color: #fff; border: 1px solid #4f46e5; }
.mxe-w-button-ghost   { background: transparent; color: #4f46e5; border: 1px solid #4f46e5; }
.mxe-w-divider { border: 0; border-top: 1px solid #e5e7eb; margin: 16px 0; }
.mxe-w-spacer { display: block; }
.mxe-w-icon { display: inline-block; line-height: 1; }

/* ─── Video ──────────────────────────────────────────────────────────── */
.mxe-w-video {
  position: relative; width: 100%; padding-bottom: 56.25%; height: 0;
  overflow: hidden; background: #000; border-radius: 6px;
}
.mxe-w-video iframe,
.mxe-w-video video,
.mxe-w-video > iframe {
  position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important;
  border: 0;
}

/* ─── Gallery ───────────────────────────────────────────────────────── */
.mxe-w-gallery { display: grid; gap: 8px; }
.mxe-w-gallery img { width: 100%; height: auto; display: block; border-radius: 4px; }

/* ─── Accordion variants ─────────────────────────────────────────────── */
.mxe-w-accordion summary {
  cursor: pointer; padding: 8px 0; font-weight: 600;
  user-select: none; list-style: none;
}
.mxe-w-accordion summary::-webkit-details-marker { display: none; }
.mxe-w-accordion summary::after {
  content: '+'; float: right; font-size: 18px; color: #6b7280; line-height: 1;
}
.mxe-w-accordion details[open] summary::after { content: '−'; }
.mxe-w-accordion-item > div { padding: 4px 0 12px; line-height: 1.55; color: #4b5563; }
.mxe-w-accordion-bordered .mxe-w-accordion-item {
  border: 1px solid #e5e7eb; border-radius: 6px;
  margin-bottom: 8px; padding: 4px 14px;
}
.mxe-w-accordion-minimal .mxe-w-accordion-item { border-bottom: 1px solid #e5e7eb; padding: 8px 0; }
.mxe-w-accordion-cards .mxe-w-accordion-item {
  background: #fafafa; border-radius: 10px; padding: 12px 18px;
  margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid #efefef;
}
.mxe-w-accordion-numbered .mxe-w-accordion-item { border-bottom: 1px solid #e5e7eb; padding: 12px 0; }
.mxe-w-accordion-numbered summary { display: flex; align-items: center; gap: 12px; }
.mxe-w-accordion-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #4f46e5; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
}

/* ─── Tabs ───────────────────────────────────────────────────────────── */
.mxe-w-tabs { display: block; }
.mxe-w-tabs-list { display: flex; gap: 4px; border-bottom: 1px solid #e5e7eb; }
.mxe-w-tabs-tab {
  padding: 10px 16px; background: transparent; border: 0;
  border-bottom: 2px solid transparent; cursor: pointer;
  font-size: 14px; color: #4b5563; font-weight: 500;
}
.mxe-w-tabs-tab.is-active { color: #4f46e5; border-bottom-color: #4f46e5; }
.mxe-w-tabs-panels { padding: 16px 0; }
.mxe-w-tabs-panel { line-height: 1.55; }
.mxe-w-tabs-panel[hidden] { display: none; }

/* ─── Carousel ───────────────────────────────────────────────────────── */
.mxe-w-carousel { position: relative; overflow: hidden; border-radius: 6px; }
.mxe-w-carousel-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.mxe-w-carousel-track::-webkit-scrollbar { display: none; }
.mxe-w-carousel-slide {
  flex: 0 0 100%; scroll-snap-align: start; position: relative;
}
.mxe-w-carousel-slide img { width: 100%; height: auto; display: block; }
.mxe-w-carousel-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 18px; background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff; font-size: 14px;
}
.mxe-w-carousel-prev,
.mxe-w-carousel-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.4); color: #fff;
  border: 0; width: 36px; height: 36px; border-radius: 50%;
  font-size: 20px; cursor: pointer; line-height: 1;
}
.mxe-w-carousel-prev { left: 10px; }
.mxe-w-carousel-next { right: 10px; }
.mxe-w-carousel-dots {
  display: flex; justify-content: center; gap: 6px;
  padding: 10px 0;
}
.mxe-w-carousel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d1d5db; border: 0; padding: 0; cursor: pointer;
}
.mxe-w-carousel-dot.is-active { background: #4f46e5; }

/* ─── Counter ────────────────────────────────────────────────────────── */
.mxe-w-counter { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mxe-w-counter-value { font-size: 36px; font-weight: 800; color: #111; line-height: 1; }
.mxe-w-counter-label { font-size: 13px; color: #6b7280; }
.mxe-w-counter-plain .mxe-w-counter-value { color: #111; }
.mxe-w-counter-badge {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 22px;
  background: linear-gradient(135deg, rgba(79,70,229,0.12), rgba(99,102,241,0.04));
  border-radius: 14px; border: 1px solid rgba(79,70,229,0.25);
  box-shadow: 0 4px 10px rgba(79,70,229,0.08);
}
.mxe-w-counter-badge .mxe-w-counter-value { font-size: 38px; color: #4f46e5; letter-spacing: -0.02em; }
.mxe-w-counter-badge .mxe-w-counter-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; }

/* ─── Progress ───────────────────────────────────────────────────────── */
.mxe-w-progress { width: 100%; }
.mxe-w-progress-meta {
  display: flex; justify-content: space-between;
  font-size: 13px; color: #4b5563; margin-bottom: 6px;
}
.mxe-w-progress-track {
  height: 10px; background: #e5e7eb; border-radius: 5px; overflow: hidden;
}
.mxe-w-progress-bar {
  height: 100%; width: 0; border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.mxe-w-progress-steps { display: flex; gap: 4px; }
.mxe-w-progress-step { flex: 1; height: 10px; background: #e5e7eb; border-radius: 3px; transition: background 0.3s ease; }
.mxe-w-progress-step.is-filled { background: #4f46e5; }
.mxe-w-progress-circle { display: block; max-width: 160px; margin: 0 auto; }
.mxe-w-progress-circle-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mxe-w-progress-circle-label { font-size: 13px; color: #4b5563; }

/* ─── Countdown ──────────────────────────────────────────────────────── */
.mxe-w-countdown { display: flex; gap: 16px; flex-wrap: wrap; }
.mxe-w-countdown-unit {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 18px; background: #1f2937; color: #fff; border-radius: 8px;
  min-width: 70px;
}
.mxe-w-countdown-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mxe-w-countdown-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.8; }

/* ─── Form variants ──────────────────────────────────────────────────── */
.mxe-w-form { display: block; }
.mxe-w-form-stacked .mxe-w-form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.mxe-w-form-stacked label { font-size: 13px; color: #4b5563; font-weight: 500; }
.mxe-w-form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.mxe-w-form-inline .mxe-w-form-field { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; }
.mxe-w-form-inline .mxe-w-form-submit { flex: 0 0 auto; }
.mxe-w-form input,
.mxe-w-form textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid #e5e7eb; border-radius: 6px;
  font-size: 14px; font-family: inherit;
  background: #fff; color: #111;
}
.mxe-w-form input:focus, .mxe-w-form textarea:focus { outline: none; border-color: #4f46e5; }
.mxe-w-form-floating .mxe-w-form-field { position: relative; margin-bottom: 18px; }
.mxe-w-form-floating input,
.mxe-w-form-floating textarea { padding: 20px 12px 8px; }
.mxe-w-form-floating label {
  position: absolute; left: 12px; top: 14px;
  font-size: 14px; color: #6b7280; pointer-events: none;
  transition: transform 0.15s ease, font-size 0.15s ease, color 0.15s ease;
  background: #fff; padding: 0 4px;
}
.mxe-w-form-floating input:focus + label,
.mxe-w-form-floating textarea:focus + label,
.mxe-w-form-floating input:not(:placeholder-shown) + label,
.mxe-w-form-floating textarea:not(:placeholder-shown) + label {
  transform: translateY(-14px); font-size: 11px; color: #4f46e5;
}
.mxe-w-form-submit {
  display: inline-block; padding: 10px 24px;
  background: #4f46e5; color: #fff; border: 0; border-radius: 6px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  margin-top: 4px;
}
.mxe-w-form-submit:hover { opacity: 0.9; }
.mxe-w-form-status { padding: 8px 0; color: #4b5563; font-size: 13px; }

/* ─── HTML / Snippet shells ──────────────────────────────────────────── */
.mxe-w-html { display: block; }

/* ─── Animations (scroll-trigger) ───────────────────────────────────── */
.mxe-anim { opacity: 0; transition: opacity 0.6s ease, transform 0.6s ease; }
.mxe-anim-fade-in { opacity: 0; }
.mxe-anim-slide-up { transform: translateY(20px); }
.mxe-anim-zoom-in { transform: scale(0.92); }
.mxe-anim[data-mxe-anim-active] { opacity: 1; transform: none; }
