/* ==========================================================================
   Industries Section – Premium Layout System
   3 Top Cards + Centered Bottom Card
   Enhanced Shadows | Smooth Transitions | Enterprise Finish
   ========================================================================== */

/* =========================================================
   Section Foundation
========================================================= */

.coffee-industries {
  position: relative;
  padding: clamp(5rem, 9vw, 9rem) clamp(1.5rem, 5vw, 6rem);
  background: var(--clr-bg);
  overflow: hidden;
  isolation: isolate;
  transition: background 0.4s ease;
}

/* Elegant ambient gradients */
.coffee-industries::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 25%, rgba(37, 99, 235, 0.06), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(16, 185, 129, 0.05), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Smooth section transition to next section */
.coffee-industries::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 140px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0) 0%,
    var(--clr-bg) 80%
  );
  pointer-events: none;
}

/* =========================================================
   Header
========================================================= */

.section-header {
  text-align: center;
  max-width: 900px;
  margin: 0 auto clamp(4rem, 6vw, 6rem);
  position: relative;
  z-index: 2;
}

.section-header h2 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 1.2rem;
}

.section-header p {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  opacity: 0.85;
  line-height: 1.7;
}

/* =========================================================
   GRID – 3 Top + 1 Centered Bottom
========================================================= */

.coffee-industries__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: clamp(2rem, 3vw, 3rem);
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Force the 4th card centered under the 2nd */
.coffee-industries__grid .industry-card:nth-child(4) {
  grid-column: 2 / 3;
}

/* Responsive fallback */
@media (max-width: 1024px) {
  .coffee-industries__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .coffee-industries__grid .industry-card:nth-child(4) {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .coffee-industries__grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   CARD SYSTEM
========================================================= */

.industry-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* important for stable icon alignment */
  gap: 1.2rem;
  padding: clamp(2rem, 2.5vw, 2.75rem);
  border-radius: 20px;
  background: linear-gradient(
    145deg,
    rgba(255,255,255,0.85),
    rgba(255,255,255,0.75)
  );
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,0,0.06);

  box-shadow:
    0 4px 20px rgba(0,0,0,0.04),
    0 1px 3px rgba(0,0,0,0.06);

  transition:
    transform 0.6s cubic-bezier(.2,.8,.2,1),
    box-shadow 0.6s ease,
    border-color 0.4s ease,
    background 0.4s ease;

  will-change: transform;
  opacity: 0;
  transform: translateY(40px);
}

/* Reveal State */
.industry-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hover Elevation */
.industry-card:hover {
  transform: translateY(-10px);
  box-shadow:
    0 25px 60px rgba(0,0,0,0.12),
    0 8px 25px rgba(0,0,0,0.08);
  border-color: rgba(37, 99, 235, 0.4);
}

/* Subtle top glow accent */
.industry-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--clr-primary),
    var(--clr-secondary)
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.industry-card:hover::before {
  opacity: 1;
}

/* =========================================================
   ICON (FULL FIXED VERSION)
========================================================= */

.industry-card__icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;

  /* hard centering */
  display: flex;
  align-items: center;
  justify-content: center;

  align-self: center;
  flex-shrink: 0;

  margin-bottom: 0.5rem;

  font-size: 1.5rem;
  line-height: 1;

  background: rgba(37, 99, 235, 0.08);
  color: var(--clr-primary);

  transition:
    transform 0.4s ease,
    background 0.4s ease,
    color 0.4s ease,
    box-shadow 0.4s ease;

  transform-origin: center center;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* normalize icon children */
.industry-card__icon > * {
  display: block;
  margin: auto;
  line-height: 1;
}

/* SVG / image normalization */
.industry-card__icon svg,
.industry-card__icon img,
.industry-card__icon i {
  width: 24px;
  height: 24px;
  display: block;
}

/* Hover icon */
.industry-card:hover .industry-card__icon {
  background: var(--clr-primary);
  color: #fff;
  transform: scale(1.08) translateZ(0);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

/* Desktop sizing refinement */
@media (min-width: 1200px) {
  .industry-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }
}

/* Tablet refinement */
@media (max-width: 1024px) {
  .industry-card__icon {
    width: 58px;
    height: 58px;
  }
}

/* Mobile: centered professional layout */
@media (max-width: 640px) {

  .industry-card {
    align-items: center;
    text-align: center;
  }

  .industry-card__icon {
    align-self: center;
    margin-left: auto;
    margin-right: auto;
  }

  .industry-card h3,
  .industry-card p,
  .industry-points {
    text-align: center;
    width: 100%;
  }

  .industry-points li {
    padding-left: 0;
  }

  .industry-points li::before {
    display: none;
  }
}

/* =========================================================
   TEXT
========================================================= */

.industry-card h3 {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
}

.industry-card p {
  font-size: 1rem;
  line-height: 1.7;
  opacity: 0.85;
}

.industry-points {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
  display: grid;
  gap: 0.6rem;
}

.industry-points li {
  position: relative;
  padding-left: 1.3rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

.industry-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clr-primary);
}

/* =========================================================
   CTA
========================================================= */

.coffee-industries__cta {
  text-align: center;
  margin-top: clamp(5rem, 8vw, 7rem);
  position: relative;
  z-index: 2;
}

.coffee-industries__cta p {
  margin-bottom: 2rem;
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  opacity: 0.9;
}

.coffee-industries__cta .btn--primary {
  padding: 1.1rem 2.5rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.4s ease;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.25);
}

.coffee-industries__cta .btn--primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.35);
}

/* =========================================================
   DARK MODE
========================================================= */

:root[data-theme="dark"] .industry-card {
  background: linear-gradient(
    145deg,
    rgba(30, 41, 59, 0.9),
    rgba(17, 24, 39, 0.95)
  );
  border-color: rgba(255,255,255,0.05);
}

:root[data-theme="dark"] .industry-card:hover {
  box-shadow:
    0 30px 70px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.05);
}