/* ============================================================
   VIPSCLUB Portal 2026 — Referral Banner Module
   Base styles live HERE so they load on every page this module
   is used (dashboard, services-catalogue, service-detail, etc.)
   ============================================================ */

/* ── Banner card ── */
.referral-banner {
  background: var(--vips-bg-card);
  border: 1px solid var(--vips-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-10);
}

/* ── Left: icon + link section — fixed size, slightly wider than CTA side ── */
.referral-banner__link-section {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  flex-shrink: 0;
}

.referral-banner__icon-wrap {
  background: var(--vips-dark);
  width: 88px;
  height: 83px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.referral-banner__icon-wrap img,
.referral-banner__icon-wrap svg {
  width: 48px;
  height: 48px;
}

/* Figma: content area w-[420.992px] — link input fills it via flex */
.referral-banner__link-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 421px;
}

.referral-banner__link-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.referral-banner__label {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--vips-text-primary);
  letter-spacing: -0.15px;
  line-height: 20px;
}

.referral-banner__sublabel {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--vips-text-secondary);
  line-height: 18px;
  letter-spacing: -0.15px;
}

.referral-banner__link-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.referral-banner__link-input {
  background: var(--vips-bg-input);
  border: 1px solid var(--vips-border);
  border-radius: var(--radius-md);
  height: 44px;
  padding: var(--space-2) 17px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--vips-text-secondary);
  flex: 1;
  cursor: text;
  user-select: all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.referral-banner__copy-btn {
  background: var(--vips-dark);
  height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--vips-bg-card);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.referral-banner__copy-btn:hover {
  opacity: 0.85;
}

.referral-banner__copy-btn:focus-visible {
  outline: 2px solid var(--vips-dark);
  outline-offset: 2px;
}

.referral-banner__copy-btn img,
.referral-banner__copy-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Middle: divider — two 1px×80px lines flanking the text ── */
/* Figma: w-[50px], gap-[16px], lines bg-[#e0e0e0] 1px×80px, text Inter Bold 14px #9e9e9e */
.referral-banner__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  width: 50px;
}

.referral-banner__divider-line {
  display: block;
  width: 1px;
  height: 80px;
  background-color: #e0e0e0;
  flex-shrink: 0;
}

.referral-banner__divider-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: #9e9e9e;
  white-space: nowrap;
  line-height: 1;
}

/* ── Right: CTA section ── */
.referral-banner__cta-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.referral-banner__cta-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.referral-banner__cta-heading {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--vips-text-primary);
  letter-spacing: -0.15px;
  text-align: center;
  text-transform: capitalize;
  line-height: 20px;
}

.referral-banner__cta-subtitle {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--vips-text-secondary);
  line-height: 18px;
  letter-spacing: -0.15px;
  text-align: center;
}

/* ── Tablet (769–1080px) ──
   Keep the 2-zone horizontal layout, but let the widths FLEX so the CTA never
   runs off the card. The link content was a rigid 421px + the link section was
   flex-shrink:0, so the banner had a min-width larger than the tablet card →
   "Refer a Friend" overflowed. These rules make both zones shrinkable. */
@media (min-width: 769px) and (max-width: 1080px) {
  .referral-banner {
    gap: 24px;
    padding: 24px;
  }

  /* Link zone shrinks to share space instead of holding a fixed width */
  .referral-banner__link-section {
    flex: 1 1 auto;
    min-width: 0;
    gap: 20px;
  }

  .referral-banner__icon-wrap {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
  }
  .referral-banner__icon-wrap img,
  .referral-banner__icon-wrap svg {
    width: 36px;
    height: 36px;
  }

  .referral-banner__link-content {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .referral-banner__link-input {
    min-width: 0;
  }

  /* CTA zone takes a fixed share so the heading + red button always fit */
  .referral-banner__cta-section {
    flex: 0 0 220px;
    min-width: 0;
  }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
  .referral-banner {
    flex-direction: column;
    gap: 16px;
    padding: 20px;            /* was 32px — too tight on a ~358px card */
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  /* Link section: icon inline-LEFT of the content (not stacked above) */
  .referral-banner__link-section {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;             /* allow flex children to shrink below content width */
  }

  /* Smaller inline icon on mobile (desktop is 88px) */
  .referral-banner__icon-wrap {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }
  .referral-banner__icon-wrap img,
  .referral-banner__icon-wrap svg {
    width: 22px;
    height: 22px;
  }

  /* Link content + header fill the column to the right of the icon (icon + label row) */
  .referral-banner__link-content,
  .referral-banner__link-header {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Input row breaks OUT below the icon + label to span the full card width.
     Icon (40px) + gap (12px) = 52px — pull the row left so the input is truly 100%. */
  .referral-banner__link-row {
    width: calc(100% + 52px);
    margin-left: -52px;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Input fills the row; Copy button collapses to an icon-only square (no text) */
  .referral-banner__link-input {
    min-width: 0;
    flex: 1 1 auto;
  }
  .referral-banner__copy-btn {
    flex-shrink: 0;
    padding: 0;
    width: 44px;
    justify-content: center;
  }
  .referral-copy-btn__text {
    display: none;
  }

  /* "Or" divider (vertical lines) is not shown on mobile */
  .referral-banner__divider {
    display: none;
  }

  /* CTA section fills width, separated from the link row above by a full-width
     horizontal divider (after the copy-link field, before the Refer a Friend block) */
  .referral-banner__cta-section {
    width: 100%;
    min-width: 0;
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
  }
  .referral-banner__cta-section .btn {
    width: 100%;
  }

  .referral-banner--hide-mobile {
    display: none;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .referral-banner__copy-btn {
    transition: none;
  }
}

/* ── Per-instance style overrides (set in module STYLE tab) ── */
{% if module.style_overrides.background_color.color %}
.referral-banner {
  background-color: ;
}
{% endif %}

{% if module.style_overrides.padding_top %}
.referral-banner {
  padding-top: px;
}
{% endif %}

{% if module.style_overrides.padding_bottom %}
.referral-banner {
  padding-bottom: px;
}
{% endif %}

{% if module.style_overrides.text_color.color %}
.referral-banner,
.referral-banner__label,
.referral-banner__cta-heading {
  color: ;
}
{% endif %}

{% if module.style_overrides.hide_on_mobile %}
@media (max-width: 768px) {
  .referral-banner--hide-mobile {
    display: none;
  }
}
{% endif %}

