/* ─────────────────────────────────────────────────────────
   Saturn Elementor Widgets — shared CSS
   All colours/radii/fonts reference theme CSS variables so
   every widget automatically matches the active theme palette.
   ───────────────────────────────────────────────────────── */

/* ── Shared tokens ── */
.saturn-el-widget {
  font-family: var(--font-sans, system-ui, sans-serif);
  color: hsl(var(--foreground));
  box-sizing: border-box;
}
.saturn-el-widget *,
.saturn-el-widget *::before,
.saturn-el-widget *::after { box-sizing: inherit; }
/* Prevent Tailwind Typography prose rules from adding margins to widget images */
.saturn-el-widget img { margin-top: 0; margin-bottom: 0; }

/* Missing-plugin notice rendered inside a widget */
.saturn-el-notice {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground, 215.4 16.3% 46.9%));
  border: 1px dashed hsl(var(--border, 214.3 31.8% 91.4%));
  border-radius: var(--radius, 0.5rem);
  text-align: center;
}

/* ── Buttons ── */
.saturn-el-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius, 0.5rem);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.15s ease, background 0.18s ease;
  white-space: nowrap;
}
.saturn-el-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.saturn-el-btn:active { transform: translateY(0); }

.saturn-el-btn--primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
.saturn-el-btn--ghost {
  background: transparent;
  color: currentColor;
  border-color: currentColor;
  opacity: 0.85;
}
.saturn-el-btn--ghost:hover { opacity: 1; background: hsl(var(--foreground) / 0.06); }

.saturn-el-btn--sm { font-size: 0.8125rem; padding: 0.5rem 1.25rem; }
.saturn-el-btn--lg { font-size: 1rem; padding: 0.9rem 2.25rem; }

/* ── Eyebrow badge ── */
.saturn-el-eyebrow {
  display: inline-block;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3em 0.85em;
  border-radius: 999px;
  background: hsl(var(--brand-accent) / 0.12);
  color: hsl(var(--brand-accent));
  margin-bottom: 1rem;
}

/* ── Section heading ── */
.saturn-el-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.saturn-el-section-head h2 {
  font-family: var(--font-heading, var(--font-sans, system-ui, sans-serif));
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin: 0;
}
.saturn-el-section-head a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--primary));
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.saturn-el-section-head a:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   HERO BANNER
   ═══════════════════════════════════════════════════════════ */
.saturn-el-hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: calc(var(--radius, 0.5rem) * 2);
  min-height: 520px;
}
.saturn-el-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.6s ease;
}
.saturn-el-hero:hover .saturn-el-hero__bg { transform: scale(1.025); }
.saturn-el-hero__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.saturn-el-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 4rem clamp(1.5rem, 5vw, 5rem);
}
.saturn-el-hero__content { max-width: 640px; }
.saturn-el-hero--align-center .saturn-el-hero__inner { display: flex; justify-content: center; }
.saturn-el-hero--align-center .saturn-el-hero__content { text-align: center; }
.saturn-el-hero--align-right .saturn-el-hero__inner { display: flex; justify-content: flex-end; }
.saturn-el-hero--align-right .saturn-el-hero__content { text-align: right; }

.saturn-el-hero__title {
  font-family: var(--font-heading, var(--font-sans, system-ui, sans-serif));
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: inherit;
}
.saturn-el-hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.55;
  margin: 0 0 2rem;
  opacity: 0.85;
  color: inherit;
}
.saturn-el-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.saturn-el-hero--align-center .saturn-el-hero__ctas { justify-content: center; }
.saturn-el-hero--align-right .saturn-el-hero__ctas  { justify-content: flex-end; }

@media (max-width: 640px) {
  .saturn-el-hero { min-height: 380px; }
  .saturn-el-hero__title { font-size: 2rem; }
  .saturn-el-hero__ctas { flex-direction: column; align-items: stretch; }
  .saturn-el-hero__ctas .saturn-el-btn { justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════
   PRODUCT GRID
   Columns are handled via Tailwind grid-cols-* classes on the
   <ul> directly (same pattern as archive-product.php).
   The tablet/mobile breakpoints below override those classes.
   Per-widget card aspect ratio is set via --card-aspect on the
   wrapper; the global default comes from dynamic-css.php.
   ═══════════════════════════════════════════════════════════ */
.saturn-el-product-grid {}
@media (max-width: 1023px) {
  .saturn-el-product-grid .products {
    grid-template-columns: repeat(var(--cols-tablet, 2), 1fr) !important;
  }
}
@media (max-width: 639px) {
  .saturn-el-product-grid .products {
    grid-template-columns: repeat(var(--cols-mobile, 1), 1fr) !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   CATEGORY TILES
   Columns and gap come from CSS variables set on the widget
   wrapper: --cat-cols, --cat-cols-t, --cat-cols-m, --cat-gap.
   ═══════════════════════════════════════════════════════════ */
.saturn-el-cat-tiles__grid {
  display: grid;
  gap: var(--cat-gap, 12px);
  grid-template-columns: repeat(var(--cat-cols, 3), 1fr);
}
@media (max-width: 1023px) {
  .saturn-el-cat-tiles__grid {
    grid-template-columns: repeat(var(--cat-cols-t, 2), 1fr);
  }
}
@media (max-width: 639px) {
  .saturn-el-cat-tiles__grid {
    grid-template-columns: repeat(var(--cat-cols-m, 1), 1fr);
  }
}
/* Base tile — the <a> is just a flex column wrapper */
.saturn-el-cat-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: calc(var(--radius, 0.5rem) * 1.5);
  overflow: hidden;
}

/* Image box: aspect-ratio is set inline per widget instance.
   The image is absolutely positioned inside so it always fills
   the box correctly regardless of natural image dimensions. */
.saturn-el-cat-tile__img-box {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: calc(var(--radius, 0.5rem) * 1.5);
  background: hsl(var(--muted, #f1f5f9));
  /* aspect-ratio injected inline */
}
.saturn-el-cat-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  margin: 0;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.saturn-el-cat-tile:hover .saturn-el-cat-tile__img { transform: scale(1.06); }

/* Overlay label — sits at the bottom of the image box */
.saturn-el-cat-tile__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-radius: 0 0 calc(var(--radius, 0.5rem) * 1.5) calc(var(--radius, 0.5rem) * 1.5);
}
.saturn-el-cat-tile__name {
  font-family: var(--font-heading, var(--font-sans, system-ui, sans-serif));
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}
.saturn-el-cat-tile__count {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

/* Below-image variant — label is outside and below the img-box */
.saturn-el-cat-tile--below .saturn-el-cat-tile__label {
  position: static;
  background: none;
  padding: 0.625rem 0.125rem 0;
}
.saturn-el-cat-tile--below .saturn-el-cat-tile__name  { color: hsl(var(--foreground)); }
.saturn-el-cat-tile--below .saturn-el-cat-tile__count { color: hsl(var(--foreground) / 0.5); }

/* Hover reveal variant */
.saturn-el-cat-tile--hover .saturn-el-cat-tile__label {
  background: hsl(var(--primary) / 0.88);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.saturn-el-cat-tile--hover:hover .saturn-el-cat-tile__label {
  opacity: 1;
  transform: translateY(0);
}
.saturn-el-cat-tile--hover .saturn-el-cat-tile__name { color: hsl(var(--primary-foreground)); }

/* ═══════════════════════════════════════════════════════════
   PROMO BANNER
   ═══════════════════════════════════════════════════════════ */
.saturn-el-promo {
  display: grid;
  border-radius: calc(var(--radius, 0.5rem) * 2);
  overflow: hidden;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}
.saturn-el-promo--image-left  { grid-template-columns: 1fr 1fr; }
.saturn-el-promo--image-right { grid-template-columns: 1fr 1fr; }
.saturn-el-promo--centered    { grid-template-columns: 1fr; text-align: center; }

.saturn-el-promo__img-wrap {
  overflow: hidden;
  min-height: 300px;
}
.saturn-el-promo--image-right .saturn-el-promo__img-wrap { order: 2; }
.saturn-el-promo--centered .saturn-el-promo__img-wrap    { min-height: 260px; }

.saturn-el-promo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  transition: transform 0.5s ease;
}
.saturn-el-promo:hover .saturn-el-promo__img { transform: scale(1.04); }

.saturn-el-promo__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5%, 3.5rem);
  gap: 1.25rem;
}
.saturn-el-promo--centered .saturn-el-promo__body { align-items: center; }

.saturn-el-promo__title {
  font-family: var(--font-heading, var(--font-sans, system-ui, sans-serif));
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: hsl(var(--foreground));
}
.saturn-el-promo__desc {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: hsl(var(--foreground) / 0.65);
  margin: 0;
  max-width: 42ch;
}
.saturn-el-promo__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}
.saturn-el-promo--centered .saturn-el-promo__ctas { justify-content: center; }

@media (max-width: 767px) {
  .saturn-el-promo--image-left,
  .saturn-el-promo--image-right { grid-template-columns: 1fr; }
  .saturn-el-promo--image-right .saturn-el-promo__img-wrap { order: 0; }
}

/* ═══════════════════════════════════════════════════════════
   COUNTDOWN BANNER
   ═══════════════════════════════════════════════════════════ */
.saturn-el-countdown {
  border-radius: calc(var(--radius, 0.5rem) * 2);
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
  position: relative;
}
.saturn-el-countdown__title {
  font-family: var(--font-heading, var(--font-sans, system-ui, sans-serif));
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  color: inherit;
}
.saturn-el-countdown__subtitle {
  font-size: 1.0625rem;
  line-height: 1.6;
  opacity: 0.8;
  max-width: 48ch;
  margin: -0.75rem auto 0;
}
.saturn-el-countdown__timer {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}
.saturn-el-countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 5rem;
}
.saturn-el-countdown__num {
  font-family: var(--font-heading, var(--font-sans, system-ui, sans-serif));
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-radius: var(--radius, 0.5rem);
  padding: 0.6em 0.5em;
  min-width: 4.5rem;
  text-align: center;
  box-shadow: 0 2px 8px hsl(0 0% 0% / 0.08);
  transition: transform 0.15s ease;
}
.saturn-el-countdown__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
}
.saturn-el-countdown__sep {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  opacity: 0.35;
  padding: 0.2em 0.1em 0;
  align-self: flex-start;
}
.saturn-el-countdown__expired {
  font-size: 1.125rem;
  font-weight: 600;
  opacity: 0.6;
}

@media (max-width: 480px) {
  .saturn-el-countdown__unit { min-width: 3.75rem; }
  .saturn-el-countdown__num  { font-size: 2rem; min-width: 3.5rem; padding: 0.5em 0.4em; }
  .saturn-el-countdown__sep  { font-size: 1.75rem; }
}

/* ── Dark mode overrides ── */
.dark .saturn-el-countdown__num { box-shadow: 0 2px 8px hsl(0 0% 0% / 0.25); }
