/* ==========================================================================
   Sarovar Tube Industries — Factory / Gallery video section
   Matches the brand tokens used by "Our Products" (deep red accent + navy)
   ========================================================================== */

.srv-factory {
  --srv-accent: #962c2a;
  --srv-accent-dark: #a3220f;
  --srv-navy: #0b1730;
  --srv-navy-2: #0f2040;
  --srv-navy-3: #16294c;
  --srv-ink: #eef1f8;
  --srv-muted: #9aa7c2;
  --srv-radius: 22px;

  position: relative;
  background: radial-gradient(120% 160% at 85% 0%, var(--srv-navy-3) 0%, var(--srv-navy) 55%, #081226 100%);
  padding: 110px 0 100px;
  overflow: hidden;
  isolation: isolate;
}

.srv-factory::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(60% 60% at 50% 20%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 20%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.srv-factory::after {
  content: "";
  position: absolute;
  top: -180px;
  left: -140px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(224, 54, 28, 0.32) 0%, rgba(224, 54, 28, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

.srv-factory-container {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.srv-factory-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 52px;
}

.srv-factory-head-left {
  max-width: 720px;
}

.srv-factory-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffb4a6;
  padding: 8px 16px;
  border: 1px solid rgba(224, 54, 28, 0.45);
  border-radius: 999px;
  background: rgba(150, 44, 42, 0.16);
  margin-bottom: 20px;
}

.srv-factory-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--srv-accent-dark);
  box-shadow: 0 0 0 4px rgba(224, 54, 28, 0.22);
}

.srv-factory-heading {
  color: var(--srv-ink);
  font-size: clamp(30px, 3.4vw, 50px);
  line-height: 1.12;
  margin: 0;
}

.srv-factory-heading span {
  color: #962c2a;
}

.srv-factory-desc {
  color: var(--srv-muted);
  font-size: 16px;
  line-height: 1.7;
  margin: 18px 0 0;
  max-width: 620px;
}

.srv-factory-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--srv-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.srv-factory-note svg {
  width: 18px;
  height: 18px;
  color: #962c2a;
  flex: none;
}

/* ---------- Grid: 4 in a row ---------- */
.srv-factory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

/* ---------- Card ---------- */
.srv-factory-card {
  position: relative;
  border-radius: var(--srv-radius);
  overflow: hidden;
  background: linear-gradient(160deg, var(--srv-navy-2) 0%, #09122a 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 18px 40px rgba(3, 8, 22, 0.45);
  transition: transform 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}

.srv-factory-card:hover {
  transform: translateY(-8px);
  border-color: rgba(224, 54, 28, 0.55);
  box-shadow: 0 28px 60px rgba(3, 8, 22, 0.6);
}

.srv-factory-media {
  position: relative;
  aspect-ratio: 3 / 4;
  width: 100%;
  overflow: hidden;
  background: #060d1e;
}

.srv-factory-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 0.6s ease;
}

.srv-factory-card:hover .srv-factory-media video {
  transform: scale(1.06);
}

/* gradient shade so captions stay readable */
.srv-factory-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 12, 28, 0.92) 0%, rgba(6, 12, 28, 0.35) 42%, rgba(6, 12, 28, 0.08) 70%);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.srv-factory-card.is-playing .srv-factory-shade {
  opacity: 0.75;
}

/* poster frame until the video paints its first frame */
.srv-factory-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, #16294c 0%, #0b1730 60%, #060d1e 100%);
  z-index: 0;
}

.srv-factory-media video {
  position: relative;
  z-index: 1;
}

.srv-factory-index {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ffd9d1;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(150, 44, 42, 0.85);
  backdrop-filter: blur(4px);
}

/* play / pause button */
.srv-factory-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(150, 44, 42, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s ease, background 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 0 0 0 rgba(224, 54, 28, 0.45);
  animation: srvFactoryPulse 2.6s infinite;
}

.srv-factory-play svg {
  width: 22px;
  height: 22px;
}

.srv-factory-play .srv-icon-pause {
  display: none;
}

.srv-factory-card.is-playing .srv-factory-play {
  opacity: 0;
  animation: none;
  pointer-events: none;
}

.srv-factory-card.is-playing:hover .srv-factory-play {
  opacity: 1;
  pointer-events: auto;
}

.srv-factory-card.is-playing .srv-factory-play .srv-icon-play {
  display: none;
}

.srv-factory-card.is-playing .srv-factory-play .srv-icon-pause {
  display: block;
}

.srv-factory-play:hover {
  background: var(--srv-accent-dark);
  transform: translate(-50%, -50%) scale(1.08);
}

@keyframes srvFactoryPulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 54, 28, 0.45); }
  70% { box-shadow: 0 0 0 18px rgba(224, 54, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 54, 28, 0); }
}

/* sound toggle */
.srv-factory-sound {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(9, 16, 34, 0.7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.srv-factory-card:hover .srv-factory-sound,
.srv-factory-card.is-playing .srv-factory-sound {
  opacity: 1;
  transform: translateY(0);
}

.srv-factory-sound:hover {
  background: var(--srv-accent);
}

.srv-factory-sound svg {
  width: 17px;
  height: 17px;
}

.srv-factory-sound .srv-icon-unmuted {
  display: none;
}

.srv-factory-sound.is-unmuted .srv-icon-muted {
  display: none;
}

.srv-factory-sound.is-unmuted .srv-icon-unmuted {
  display: block;
}

/* caption */
.srv-factory-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 22px 20px 24px;
  pointer-events: none;
}

.srv-factory-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffb4a6;
  margin-bottom: 8px;
}

.srv-factory-title {
  color: #fff;
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 6px;
}

.srv-factory-text {
  color: rgba(226, 232, 245, 0.78);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.45s ease, opacity 0.35s ease;
}

.srv-factory-card:hover .srv-factory-text {
  max-height: 90px;
  opacity: 1;
}

/* captions stay readable while the videos autoplay */
.srv-factory-body {
  transition: opacity 0.35s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  .srv-factory-grid { gap: 20px; }
  .srv-factory-title { font-size: 17px; }
}

@media (max-width: 991px) {
  .srv-factory { padding: 80px 0 72px; }
  .srv-factory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .srv-factory-head { margin-bottom: 40px; }
  .srv-factory-note { white-space: normal; }
}

@media (max-width: 575px) {
  .srv-factory { padding: 64px 0 60px; }
  .srv-factory-container { padding: 0 16px; }
  .srv-factory-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .srv-factory-media { aspect-ratio: 4 / 5; }
  .srv-factory-text { max-height: 90px; opacity: 1; }
  .srv-factory-play { width: 54px; height: 54px; }
  .srv-factory-sound { opacity: 1; transform: translateY(0); }
}

/* keyboard focus + reduced motion */
.srv-factory-play:focus-visible,
.srv-factory-sound:focus-visible {
  outline: 2px solid #962c2a;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .srv-factory-card,
  .srv-factory-media video,
  .srv-factory-play { transition: none; animation: none; }
}

/* ==========================================================================
   Layout v2 — one video per row, video + content side by side
   (client feedback: show each video separately with relevant content)
   ========================================================================== */
.srv-factory-list {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.srv-factory-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 56px;
  padding: 28px;
  background: linear-gradient(160deg, rgba(22, 41, 76, 0.55) 0%, rgba(9, 18, 42, 0.55) 100%);
  overflow: visible;
}

.srv-factory-row:hover {
  transform: none;
}

.srv-factory-row--reverse {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.srv-factory-row--reverse .srv-factory-media {
  order: 2;
}

.srv-factory-row .srv-factory-media {
  aspect-ratio: 4 / 5;
  max-height: 520px;
  border-radius: 18px;
}

.srv-factory-row .srv-factory-shade {
  background: linear-gradient(to top, rgba(6, 12, 28, 0.45) 0%, rgba(6, 12, 28, 0) 45%);
}

.srv-factory-info {
  padding: 8px 12px;
}

.srv-factory-step {
  display: block;
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 180, 166, 0.45);
  margin-bottom: 18px;
}

.srv-factory-info .srv-factory-tag {
  font-size: 12px;
  margin-bottom: 10px;
}

.srv-factory-info .srv-factory-title {
  font-size: clamp(24px, 2.2vw, 32px);
  margin: 0 0 16px;
}

.srv-factory-info .srv-factory-text {
  max-height: none;
  opacity: 1;
  overflow: visible;
  font-size: 16px;
  line-height: 1.75;
  color: var(--srv-muted);
  margin: 0 0 22px;
}

.srv-factory-row:hover .srv-factory-text {
  max-height: none;
}

.srv-factory-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.srv-factory-points li {
  position: relative;
  padding-left: 30px;
  color: var(--srv-ink);
  font-size: 15px;
  line-height: 1.5;
}

.srv-factory-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--srv-accent);
  box-shadow: 0 0 0 4px rgba(150, 44, 42, 0.25);
}

@media (max-width: 991px) {
  .srv-factory-list { gap: 40px; }
  .srv-factory-row,
  .srv-factory-row--reverse {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 20px;
  }
  .srv-factory-row--reverse .srv-factory-media { order: 0; }
  .srv-factory-row .srv-factory-media {
    aspect-ratio: 16 / 10;
    max-height: none;
  }
  .srv-factory-step { font-size: 44px; margin-bottom: 12px; }
}

@media (max-width: 575px) {
  .srv-factory-row,
  .srv-factory-row--reverse { padding: 14px; }
  .srv-factory-row .srv-factory-media { aspect-ratio: 4 / 5; }
  .srv-factory-info { padding: 4px 6px 10px; }
}
