/* ============================================================
   COMPONENTS — Trust, Ecosystem Preview, Footer
   ============================================================ */

/* === TRUST SECTION === */
.trust { padding: var(--space-24) 0; background: var(--off-white); position: relative; overflow: hidden; }
.trust__header { text-align: center; margin-bottom: var(--space-16); }
.trust__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.trust__card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}
.trust__card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-orange);
  transform: scaleX(0);
  transition: transform var(--duration-normal) var(--ease-smooth);
}
.trust__card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.trust__card:hover::before { transform: scaleX(1); }
.trust__card-icon {
  width: 64px; height: 64px;
  background: rgba(255,107,0,0.1);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-6);
  font-size: 28px;
}
.trust__card-title { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-3); color: var(--charcoal); }
.trust__card-desc { font-size: var(--text-sm); color: var(--mid-gray); line-height: 1.7; }

/* === ECOSYSTEM PREVIEW === */
.eco-preview { padding: var(--space-24) 0; background: var(--deep-dark); color: var(--white); position: relative; overflow: hidden; }
.eco-preview__inner { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-16); align-items: center; }
.eco-preview__text { max-width: 540px; }
.eco-preview__list { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.eco-preview__tag {
  padding: 8px 18px;
  background: rgba(255,107,0,0.1);
  border: 1px solid rgba(255,107,0,0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--sst-orange-light);
  transition: all var(--duration-fast);
}
.eco-preview__tag:hover { background: rgba(255,107,0,0.2); transform: translateY(-2px); }

/* Ecosystem Wheel */
.eco-preview__wheel {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 500px;
  margin: 0 auto;
  --radius: 190px;
}
.eco-preview__wheel-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 140px; height: 140px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid var(--sst-orange);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.1), 0 0 45px rgba(255,107,0,0.35);
  z-index: 2;
  perspective: 1000px;
}

/* 3D Stacked Logo with thickness and swing animation */
.logo-3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: swingYLogo 8s ease-in-out infinite;
}

.logo-3d__layer {
  position: absolute;
  width: 65%;
  height: 65%;
  object-fit: contain;
  pointer-events: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.logo-3d__layer--1 { transform: translateZ(0px); }
.logo-3d__layer--2 { transform: translateZ(-1.5px); filter: brightness(0.85); }
.logo-3d__layer--3 { transform: translateZ(-3px); filter: brightness(0.7); }
.logo-3d__layer--4 { transform: translateZ(-4.5px); filter: brightness(0.55); }
.logo-3d__layer--5 { transform: translateZ(-6px); filter: brightness(0.4) drop-shadow(0 8px 12px rgba(0,0,0,0.6)); }

@keyframes swingYLogo {
  0%, 100% { transform: rotateY(-40deg); }
  50% { transform: rotateY(40deg); }
}
.eco-preview__wheel-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(255,107,0,0.2);
  animation: rotate-slow 60s linear infinite;
}
.eco-preview__wheel-ring--1 { width: 250px; height: 250px; }
.eco-preview__wheel-ring--2 { width: 380px; height: 380px; animation-direction: reverse; animation-duration: 80s; }
.eco-preview__wheel-node {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  transition: all var(--duration-normal);
  cursor: pointer;
  transform: translate(-50%, -50%) rotate(var(--angle)) translate(var(--radius)) rotate(calc(-1 * var(--angle))) scale(1);
}
.eco-preview__wheel-node:hover {
  background: rgba(255,107,0,0.2);
  border-color: var(--sst-orange);
  box-shadow: var(--shadow-glow-orange);
  transform: translate(-50%, -50%) rotate(var(--angle)) translate(var(--radius)) rotate(calc(-1 * var(--angle))) scale(1.15);
}

/* Angles of 360 / 8 = 45 degrees (Top center is 270deg) */
.preview-node-0 { --angle: 270deg; }
.preview-node-1 { --angle: 315deg; }
.preview-node-2 { --angle: 0deg; }
.preview-node-3 { --angle: 45deg; }
.preview-node-4 { --angle: 90deg; }
.preview-node-5 { --angle: 135deg; }
.preview-node-6 { --angle: 180deg; }
.preview-node-7 { --angle: 225deg; }
.eco-preview__wheel-node-label {
  position: absolute;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
}

/* === CTA BANNER === */
.cta-banner {
  padding: var(--space-20) 0;
  background: var(--gradient-orange);
  position: relative; overflow: hidden;
  text-align: center;
}
.cta-banner__title { font-size: var(--text-4xl); font-weight: 800; color: var(--white); margin-bottom: var(--space-4); }
.cta-banner__subtitle { font-size: var(--text-lg); color: rgba(255,255,255,0.85); margin-bottom: var(--space-10); max-width: 600px; margin-left: auto; margin-right: auto; }
.cta-banner__btns { display: flex; gap: var(--space-4); justify-content: center; flex-wrap: wrap; }
.cta-banner__btn-white { padding: 16px 36px; background: var(--white); color: var(--sst-orange); font-family: var(--font-display); font-weight: 700; border-radius: var(--radius-full); transition: all var(--duration-normal); font-size: var(--text-sm); }
.cta-banner__btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cta-banner__btn-outline { padding: 16px 36px; background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.5); font-family: var(--font-display); font-weight: 700; border-radius: var(--radius-full); transition: all var(--duration-normal); font-size: var(--text-sm); }
.cta-banner__btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.1); }

/* === FOOTER === */
.footer { background: var(--black); color: rgba(255,255,255,0.6); padding: var(--space-20) 0 var(--space-8); }
.footer__top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-12); margin-bottom: var(--space-16); }
.footer__brand-desc { font-size: var(--text-sm); line-height: 1.8; margin: var(--space-4) 0 var(--space-6); max-width: 340px; }
.footer__socials { display: flex; gap: var(--space-3); }
.footer__social {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6);
  transition: all var(--duration-fast);
  font-size: 16px;
}
.footer__social:hover { background: var(--sst-orange); border-color: var(--sst-orange); color: var(--white); }
.footer__heading { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; color: var(--white); margin-bottom: var(--space-6); text-transform: uppercase; letter-spacing: 1px; }
.footer__link { display: block; font-size: var(--text-sm); color: rgba(255,255,255,0.5); padding: var(--space-2) 0; transition: color var(--duration-fast); }
.footer__link:hover { color: var(--sst-orange); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.06); padding-top: var(--space-6); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); }
.footer__copy { font-size: var(--text-xs); }
.footer__bottom-links { display: flex; gap: var(--space-6); }
.footer__bottom-link { font-size: var(--text-xs); color: rgba(255,255,255,0.4); transition: color var(--duration-fast); }
.footer__bottom-link:hover { color: var(--sst-orange); }



/* === STICKY CTA === */
.sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(20px);
  padding: 12px var(--space-6);
  display: flex; justify-content: center; align-items: center; gap: var(--space-4);
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-smooth);
  border-top: 1px solid rgba(255,107,0,0.2);
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta__text { font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600; color: var(--white); }

/* === QUOTE POPUP === */
.quote-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: none; align-items: center; justify-content: center;
  padding: var(--space-6);
}
.quote-popup-overlay.open { display: flex; }
.quote-popup {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  max-width: 540px; width: 100%;
  position: relative;
  animation: scaleIn 0.4s var(--ease-spring);
  max-height: 90vh; overflow-y: auto;
}
.quote-popup__close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  background: var(--off-white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--dark-gray);
  transition: all var(--duration-fast);
  cursor: pointer;
}
.quote-popup__close:hover { background: var(--sst-orange); color: var(--white); }
.quote-popup__title { font-size: var(--text-2xl); font-weight: 800; margin-bottom: var(--space-2); }
.quote-popup__subtitle { font-size: var(--text-sm); color: var(--mid-gray); margin-bottom: var(--space-8); }
.quote-popup .form-group { margin-bottom: var(--space-4); }
.quote-popup .form-label { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--dark-gray); margin-bottom: var(--space-2); text-transform: uppercase; letter-spacing: 0.5px; }
.quote-popup .form-input,
.form-input {
  width: 100%; padding: 12px 16px;
  background: rgba(15, 23, 42, 0.02);
  border: 1.5px solid rgba(10, 36, 99, 0.15);
  border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: var(--text-sm);
  color: var(--charcoal);
  transition: all var(--duration-fast) var(--ease-smooth);
  outline: none;
}
.quote-popup .form-input:focus,
.form-input:focus {
  border-color: var(--sst-orange);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.12);
}
.quote-popup .form-select,
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

@media (max-width: 1024px) {
  .trust__grid { grid-template-columns: repeat(2, 1fr); }
  .eco-preview__inner { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .trust__grid { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr; }
  .sticky-cta { flex-direction: column; gap: var(--space-2); padding: 10px var(--space-4); }

  /* Ecosystem Wheel Mobile Scaling */
  .eco-preview__wheel {
    max-width: 310px !important;
    margin: 0 auto;
    --radius: 120px;
  }
  .eco-preview__wheel-center {
    width: 90px;
    height: 90px;
    border-width: 3px;
  }
  .eco-preview__wheel-node {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  .eco-preview__wheel-node svg {
    width: 20px !important;
    height: 20px !important;
  }
  .eco-preview__wheel-ring--1 {
    width: 160px;
    height: 160px;
  }
  .eco-preview__wheel-ring--2 {
    width: 240px;
    height: 240px;
  }
  
  /* Mobile labels styling to prevent overflow clipping */
  .eco-preview__wheel-node-label {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    font-size: 0.55rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.2px;
  }
  
  /* Top-half labels */
  .eco-preview__wheel-node[title="Solar Cells"] .eco-preview__wheel-node-label,
  .eco-preview__wheel-node[title="Solar Glass"] .eco-preview__wheel-node-label,
  .eco-preview__wheel-node[title="Global Sourcing Desk (Wuxi Growwell)"] .eco-preview__wheel-node-label,
  .eco-preview__wheel-node[title="EVA Sheets"] .eco-preview__wheel-node-label {
    top: -24px !important;
    bottom: auto !important;
  }

  /* Bottom-half labels */
  .eco-preview__wheel-node[title="Junction Boxes"] .eco-preview__wheel-node-label,
  .eco-preview__wheel-node[title="Aluminum Frames"] .eco-preview__wheel-node-label,
  .eco-preview__wheel-node[title="TPT Backsheet"] .eco-preview__wheel-node-label,
  .eco-preview__wheel-node[title="Turnkey Machinery"] .eco-preview__wheel-node-label {
    bottom: -24px !important;
    top: auto !important;
  }
}
