/* ==========================================================================
   TWL CRO Components — mobile-first, dark theme
   < 8KB target · WCAG AA contrast
   ========================================================================== */

/* --- Shared tokens (locally scoped, no conflict) --- */
:root {
  --cro-bg:           #111111;
  --cro-bg-card:      #181818;
  --cro-accent:       #ff6a00;
  --cro-accent-hover: #ff8533;
  --cro-wa:           #25d366;
  --cro-wa-hover:     #1ebe5d;
  --cro-text:         #ffffff;
  --cro-text-muted:   rgba(255,255,255,0.65);
  --cro-border:       rgba(255,255,255,0.09);
  --cro-radius:       8px;
  --cro-radius-lg:    14px;
  --cro-shadow:       0 4px 24px rgba(0,0,0,0.55);
  --cro-transition:   280ms cubic-bezier(0.2, 0.9, 0.2, 1);
  --cro-bar-h:        64px;
}

/* =========================================
   1. STICKY CTA BAR
   ========================================= */
.twl-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: var(--cro-bg);
  border-top: 1px solid var(--cro-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.6);
  transform: translateY(100%);
  transition: transform var(--cro-transition);
  will-change: transform;
  /* Respect cookie banners — push up if needed via JS override */
}

.twl-sticky-cta--visible {
  transform: translateY(0);
}

.twl-sticky-cta--no-motion,
.twl-sticky-cta--no-motion.twl-sticky-cta--visible {
  transition: none;
}

.twl-sticky-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  min-height: var(--cro-bar-h);
  max-width: 1200px;
  margin: 0 auto;
}

.twl-sticky-cta__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.twl-sticky-cta__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cro-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.twl-sticky-cta__text {
  font-size: 0.75rem;
  color: var(--cro-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 479px) {
  .twl-sticky-cta__copy { display: none; }
}

.twl-sticky-cta__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.twl-sticky-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--cro-radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--cro-transition), transform 150ms ease;
  letter-spacing: 0.01em;
}

.twl-sticky-cta__btn:focus-visible {
  outline: 2px solid var(--cro-accent);
  outline-offset: 2px;
}

.twl-sticky-cta__btn:active {
  transform: scale(0.97);
}

.twl-sticky-cta__btn--wa {
  background: var(--cro-wa);
  color: #fff;
}

.twl-sticky-cta__btn--wa:hover {
  background: var(--cro-wa-hover);
  color: #fff;
}

.twl-sticky-cta__btn--phone {
  background: var(--cro-accent);
  color: #fff;
  border: none;
}

.twl-sticky-cta__btn--phone:hover {
  background: var(--cro-accent-hover);
  color: #fff;
}

@media (max-width: 360px) {
  .twl-sticky-cta__btn span { display: none; }
  .twl-sticky-cta__btn { padding: 10px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .twl-sticky-cta {
    transition: none;
  }
}

/* =========================================
   2. SERVICE CTA CARD
   ========================================= */
.twl-cta-card {
  display: grid;
  gap: 24px;
  background: var(--cro-bg-card);
  border: 1px solid var(--cro-border);
  border-left: 3px solid var(--cro-accent);
  border-radius: var(--cro-radius-lg);
  padding: clamp(20px, 4vw, 32px);
  margin: clamp(24px, 5vw, 48px) 0;
}

@media (min-width: 640px) {
  .twl-cta-card {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.twl-cta-card__title {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  color: var(--cro-text);
  margin: 0 0 8px;
}

.twl-cta-card__text {
  font-size: 0.9rem;
  color: var(--cro-text-muted);
  margin: 0 0 12px;
  line-height: 1.55;
}

.twl-cta-card__steps {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--cro-text-muted);
  line-height: 1.8;
}

.twl-cta-card__steps li::marker {
  color: var(--cro-accent);
  font-weight: 700;
}

.twl-cta-card__action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

@media (min-width: 640px) {
  .twl-cta-card__action {
    align-items: center;
    min-width: 200px;
  }
}

.twl-cta-card__micro {
  font-size: 0.75rem;
  color: var(--cro-text-muted);
  text-align: center;
}

/* =========================================
   3. WARRANTY BADGE
   ========================================= */
.twl-warranty {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(255,106,0,0.06);
  border: 1px solid rgba(255,106,0,0.18);
  border-radius: var(--cro-radius-lg);
  padding: clamp(16px, 3vw, 24px);
  margin: clamp(16px, 3vw, 32px) 0;
}

.twl-warranty__icon {
  flex-shrink: 0;
  color: var(--cro-accent);
  line-height: 0;
  margin-top: 2px;
}

.twl-warranty__title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cro-text);
  margin-bottom: 6px;
}

.twl-warranty__text {
  font-size: 0.875rem;
  color: var(--cro-text-muted);
  margin: 0;
  line-height: 1.55;
}

/* =========================================
   4. SOCIAL PROOF BAR
   ========================================= */
.twl-social-proof {
  background: rgba(255,255,255,0.03);
  border-top: 1px solid var(--cro-border);
  border-bottom: 1px solid var(--cro-border);
  padding: 14px 0;
}

.twl-social-proof__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.twl-social-proof__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--cro-text-muted);
  white-space: nowrap;
}

.twl-social-proof__stars {
  color: #f5a623;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.twl-social-proof__count {
  color: var(--cro-text-muted);
}

.twl-social-proof__divider {
  width: 1px;
  height: 16px;
  background: var(--cro-border);
  flex-shrink: 0;
}

@media (max-width: 479px) {
  .twl-social-proof__divider { display: none; }
  .twl-social-proof__inner { justify-content: flex-start; gap: 8px 16px; }
}

/* =========================================
   5. B2B BANNER
   ========================================= */
.twl-b2b-banner {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--cro-border);
  border-radius: var(--cro-radius);
  padding: 14px 0;
  margin: clamp(24px, 4vw, 40px) 0;
}

.twl-b2b-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.twl-b2b-banner__copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 0.875rem;
}

.twl-b2b-banner__heading {
  color: var(--cro-text);
  font-weight: 700;
}

.twl-b2b-banner__sub {
  color: var(--cro-text-muted);
}

/* =========================================
   6. SHARED BUTTON UTILITIES
   (extend existing .twl-btn if present)
   ========================================= */
.twl-btn--whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cro-wa);
  color: #fff !important;
  padding: 13px 22px;
  border-radius: var(--cro-radius);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background var(--cro-transition), transform 150ms ease;
  border: none;
  cursor: pointer;
}

.twl-btn--whatsapp:hover {
  background: var(--cro-wa-hover);
  transform: translateY(-1px);
}

.twl-btn--whatsapp:focus-visible {
  outline: 2px solid var(--cro-wa);
  outline-offset: 3px;
}

.twl-btn--whatsapp:active {
  transform: scale(0.97);
}

.twl-btn--lg {
  padding: 15px 28px;
  font-size: 1rem;
}

.twl-btn--sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.twl-btn--outline {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--cro-text) !important;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 10px 20px;
  border-radius: var(--cro-radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: border-color var(--cro-transition), background var(--cro-transition);
  cursor: pointer;
}

.twl-btn--outline:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
}

.twl-btn--outline:focus-visible {
  outline: 2px solid var(--cro-accent);
  outline-offset: 2px;
}

/* =========================================
   7. BODY OFFSET (prevent sticky bar overlap)
   ========================================= */
body.twl-sticky-cta-active {
  padding-bottom: var(--cro-bar-h);
}

/* ── Mobile sticky CTA overlap fix ── */
@media (max-width: 768px) {
  body.twl-sticky-cta-active { padding-bottom: calc(var(--cro-bar-h, 64px) + 8px); }
  .twl-sticky-cta__btn { min-height: 44px; min-width: 44px; }
}
