/* ================================
   SERVICES HERO SECTION
   ================================ */

html {
  overflow-y: scroll;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}
.services-hero {
  background: #1a1a2e;
  padding: 8rem 6rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4rem;
  max-width: 100%;
  margin: 0;
  min-height: 45vh;
}

.services-hero-left h1 {
  font-size: 3.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  margin-top: 4rem;
}

.services-hero-right {
  max-width: 600px;
}

.services-hero-right p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #e0e0e0;
  margin: 0;
  font-weight: 300;
  margin-top: 4rem;
}

/* ================================
   SERVICES GRID SECTION
   ================================ */
.services-grid-section {
  min-height: 100vh;
  padding: 5rem 0 8rem 0;
  margin-bottom: 5rem;
  background: #f5f5f7;
  overflow: hidden;
}

/* Carousel Wrapper */
/* 1. MOVE PERSPECTIVE TO WRAPPER (Not on scrolling container) [web:12] */
.services-grid-wrapper {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  perspective: 2000px; /* ADDED - moved from .services-grid */
  perspective-origin: center center; /* ADDED */
}
/* Carousel Navigation Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(26, 26, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f5f5f7;
  opacity: 0;
  pointer-events: none;
}

.services-grid-wrapper:hover .carousel-btn {
  opacity: 1;
  pointer-events: all;
}

.carousel-btn:hover {
  background: rgba(26, 26, 46, 1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-btn.prev {
  left: 1rem;
}

.carousel-btn.next {
  right: 1rem;
}

.carousel-btn svg {
  width: 24px;
  height: 24px;
}


/* Services Grid - Horizontal Scroll Container */
/* 2. UPDATE SERVICES GRID - Remove perspective */
.services-grid {
  display: flex;
  gap: 1.5rem;
  max-width: 100%;
  margin: 4rem auto;
  padding: 3rem 5rem;
  overflow-x: scroll;
  overflow-y: hidden;
  
  /* CENTER SNAP - USER manually scrolls [web:37] */
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transform-style: preserve-3d;
}

.services-grid::-webkit-scrollbar {
  display: none;
}

/* Service Card - 3D Transform Base */

/* 3. UPDATE SERVICE CARD - Allow JS to control transforms */
.service-card {
  background: #1a1a2e;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease; /* CHANGED - removed transform/filter transitions */
  cursor: pointer;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 0.5rem;
  
  flex: 0 0 420px;
  min-width: 420px;
  max-width: 420px;

    scroll-snap-align: center;
  scroll-snap-stop: normal; /* Changed from 'always' for smoother feel */
  
  transform-style: preserve-3d;
  will-change: transform, filter, opacity;
  
  
  /* CHANGED - Let JS handle these */
  transform-style: preserve-3d;
  will-change: transform, filter, opacity;
  
  /* REMOVED: Default transform/filter/opacity (JS will set) */
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.service-card:hover::before {
  opacity: 1;
}

/* Hover state - only for interactive feedback */
.service-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25),
    0 8px 16px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.15);
  /* REMOVED: Don't override JS transforms on hover */
}
/* Service Info */
.service-info {
  padding: 2.5rem;
  width: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.service-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f5f5f7;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  text-align: center;
  transition: font-size 0.5s ease;
}

/* ================================
   SERVICE PANEL (Slide-in from Right)
   ================================ */
.service-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.service-panel.active {
  pointer-events: auto;
}

/* Panel Overlay */
.panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.service-panel.active .panel-overlay {
  opacity: 1;
}

/* Panel Content Container */
.panel-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 50vw;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.service-panel.active .panel-content {
  transform: translateX(0);
}

/* Panel Header */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2.5rem;
  border-bottom: 1px solid #e0e0e0;
  background: #1a1a2e;
  flex-shrink: 0;
}

.panel-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0;
  letter-spacing: 0.01em;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

/* Close Button */
.close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  color: #e0e0e0;
}

.close-btn:hover {
  background: #e0e0e0;
  opacity: 0.5;
  transform: rotate(90deg);
}

.close-btn svg {
  width: 24px;
  height: 24px;
}

/* Panel Body */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 2.5rem;
  background: #ffffff;
}

.panel-body h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.panel-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c2c2e;
  margin: 2rem 0 1rem 0;
  letter-spacing: -0.01em;
}

.panel-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: #333333;
  margin: 0 0 1.5rem 0;
  font-weight: 400;
}

.panel-body ul {
  margin: 1rem 0 2rem 0;
  padding-left: 1.5rem;
}

.panel-body ul li {
  font-size: 1rem;
  line-height: 1.8;
  color: #333333;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

/* Hidden Templates */
.service-detail-template {
  display: none !important;
}


/* ===== RESPONSIVE DESIGN ===== */

/* 5. LARGE SCREENS (1921px+) */
@media (min-width: 1921px) {
  .services-hero {
    padding: 10rem 8rem 3rem;
    gap: 5rem;
    min-height: 50vh;
  }

  .services-hero-left h1 {
    font-size: 4.5rem;
    margin-top: 5rem;
  }

  .services-hero-right {
    max-width: 750px;
  }

  .services-hero-right p {
    font-size: 1.15rem;
    line-height: 1.9;
    margin-top: 5rem;
  }

  .services-grid-section {
    padding: 6rem 0 10rem 0;
    margin-bottom: 6rem;
  }

  .services-grid {
    gap: 2rem;
    margin: 5rem auto;
    padding: 4rem 6rem;
  }

  .service-card {
    flex: 0 0 500px;
    min-width: 500px;
    max-width: 500px;
    min-height: 260px;
  }

  .service-info {
    padding: 3rem;
  }

  .service-info h3 {
    font-size: 1.8rem;
  }

  .carousel-btn {
    width: 56px;
    height: 56px;
  }

  .carousel-btn svg {
    width: 28px;
    height: 28px;
  }

  .carousel-btn.prev {
    left: 1.5rem;
  }

  .carousel-btn.next {
    right: 1.5rem;
  }

  .panel-content {
    width: 45vw;
  }

  .panel-header {
    padding: 2.5rem 3rem;
  }

  .panel-header h2 {
    font-size: 2rem;
  }

  .panel-body {
    padding: 3rem;
  }

  .panel-body h2 {
    font-size: 2.3rem;
    margin-bottom: 2rem;
  }

  .panel-body h3 {
    font-size: 1.4rem;
    margin: 2.5rem 0 1.2rem 0;
  }

  .panel-body p {
    font-size: 1.1rem;
    margin-bottom: 1.8rem;
  }

  .panel-body ul {
    margin: 1.5rem 0 2.5rem 0;
    padding-left: 2rem;
  }

  .panel-body ul li {
    font-size: 1.1rem;
    margin-bottom: 0.9rem;
  }
}

/* 2. STANDARD DESKTOP (1367px - 1920px) */
@media (min-width: 1367px) and (max-width: 1920px) {
  .services-hero {
    padding: 9rem 7rem 2.5rem;
    gap: 4.5rem;
    min-height: 48vh;
  }

  .services-hero-left h1 {
    font-size: 4rem;
    margin-top: 4.5rem;
  }

  .services-hero-right {
    max-width: 650px;
  }

  .services-hero-right p {
    font-size: 1.05rem;
    margin-top: 4.5rem;
  }

  .services-grid-section {
    padding: 5.5rem 0 9rem 0;
  }

  .services-grid {
    gap: 1.8rem;
    margin: 4.5rem auto;
    padding: 3.5rem 5.5rem;
  }

  .service-card {
    flex: 0 0 460px;
    min-width: 460px;
    max-width: 460px;
    min-height: 240px;
  }

  .service-info {
    padding: 2.8rem;
  }

  .service-info h3 {
    font-size: 1.6rem;
  }

  .carousel-btn {
    width: 52px;
    height: 52px;
  }

  .carousel-btn svg {
    width: 26px;
    height: 26px;
  }

  .panel-content {
    width: 48vw;
  }

  .panel-header {
    padding: 2.2rem 2.8rem;
  }

  .panel-header h2 {
    font-size: 1.85rem;
  }

  .panel-body {
    padding: 2.8rem;
  }

  .panel-body h2 {
    font-size: 2.1rem;
  }

  .panel-body h3 {
    font-size: 1.3rem;
  }

  .panel-body p,
  .panel-body ul li {
    font-size: 1.05rem;
  }
}

/* 1. LAPTOP / HALF SCREEN (1025px - 1366px) - FIXED */
@media (min-width: 1025px) and (max-width: 1366px) {
  .services-hero {
    padding: 8rem 6rem 2rem;
    gap: 4rem;
    min-height: 45vh;
  }

  .services-hero-left h1 {
    font-size: 3.5rem;
    margin-top: 4rem;
  }

  .services-hero-right {
    max-width: 600px;
  }

  .services-hero-right p {
    font-size: 0.95rem;
    margin-top: 4rem;
  }

  .services-grid-section {
    padding: 5rem 0 8rem 0;
    margin-bottom: 5rem;
  }

  .services-grid {
    gap: 1.5rem;
    margin: 4rem auto;
    padding: 3rem 5rem;
  }

  .service-card {
    flex: 0 0 420px;
    min-width: 420px;
    max-width: 420px;
    min-height: 220px;
  }

  .service-info {
    padding: 2.5rem;
  }

  .service-info h3 {
    font-size: 1.5rem;
  }

  .carousel-btn {
    width: 48px;
    height: 48px;
  }

  .carousel-btn svg {
    width: 24px;
    height: 24px;
  }

  .panel-content {
    width: 50vw;
  }

  .panel-header {
    padding: 2rem 2.5rem;
  }

  .panel-header h2 {
    font-size: 1.75rem;
  }

  .panel-body {
    padding: 2.5rem;
  }

  .panel-body h2 {
    font-size: 2rem;
  }

  .panel-body h3 {
    font-size: 1.25rem;
  }

  .panel-body p,
  .panel-body ul li {
    font-size: 1rem;
  }
}

/* 3. TABLET (769px - 900px) */
@media (min-width: 768px) and (max-width: 900px) {
  .services-hero {
    flex-direction: column;
    padding: 7rem 4rem 2rem;
    min-height: 40vh;
    gap: 2.5rem;
  }

  .services-hero-left h1 {
    font-size: 3rem;
    margin-top: 2rem;
  }

  .services-hero-right {
    max-width: 100%;
  }

  .services-hero-right p {
    font-size: 0.95rem;
    margin-top: 0;
  }

  .services-grid-section {
    padding: 4rem 0 6rem 0;
    margin-bottom: 4rem;
  }

  .services-grid {
    gap: 1.3rem;
    margin: 3.5rem auto;
    padding: 3rem 2rem;
  }

  .service-card {
    flex: 0 0 380px;
    min-width: 380px;
    max-width: 380px;
    min-height: 380px;
  }

  .service-info {
    padding: 2.2rem;
  }

  .service-info h3 {
    font-size: 1.4rem;
  }

  .carousel-btn {
    width: 44px;
    height: 44px;
  }

  .carousel-btn svg {
    width: 22px;
    height: 22px;
  }

  .carousel-btn.prev {
    left: 0.8rem;
  }

  .carousel-btn.next {
    right: 0.8rem;
  }

  .panel-content {
    width: 65vw;
  }

  .panel-header {
    padding: 1.8rem 2.2rem;
  }

  .panel-header h2 {
    font-size: 1.6rem;
  }

  .panel-body {
    padding: 2.2rem;
  }

  .panel-body h2 {
    font-size: 1.85rem;
  }

  .panel-body h3 {
    font-size: 1.15rem;
    margin: 1.8rem 0 0.9rem 0;
  }

  .panel-body p,
  .panel-body ul li {
    font-size: 0.98rem;
    line-height: 1.75;
  }
}

/* 4. MOBILE LAYOUT (< 768px) */
@media (max-width: 768px) {
  .services-hero {
    flex-direction: column;
    padding: 6rem 2rem 1.5rem;
    min-height: 35vh;
    gap: 2rem;
  }

  .services-hero-left h1 {
    font-size: 2.5rem;
    margin-top: 1.5rem;
  }

  .services-hero-right {
    max-width: 100%;
  }

  .services-hero-right p {
    font-size: 0.95rem;
    margin-top: 0;
  }

  .services-grid-section {
    padding: 3rem 0 5rem 0;
    margin-bottom: 3rem;
  }

  .services-grid {
    gap: 1rem;
    margin: 3rem auto;
    padding: 3rem 1rem;
  }

  .service-card {
    flex: 0 0 275px;
    min-width: 200px;
    max-width: 200px;
    min-height: 200px;
  }

  .service-info {
    padding: 1.5rem;
  }

  .service-info h3 {
    font-size: 1.25rem;
  }

  .carousel-btn {
    display: none;
  }

  .panel-content {
    width: 100vw;
  }

  .panel-header {
    padding: 1.5rem;
  }

  .panel-header h2 {
    font-size: 1.5rem;
  }

  .close-btn svg {
    width: 22px;
    height: 22px;
  }

  .panel-body {
    padding: 2rem 1.5rem;
  }

  .panel-body h2 {
    font-size: 1.75rem;
    margin-bottom: 1.3rem;
  }

  .panel-body h3 {
    font-size: 1.1rem;
    margin: 1.8rem 0 0.9rem 0;
  }

  .panel-body p {
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 1.3rem;
  }

  .panel-body ul {
    margin: 0.9rem 0 1.8rem 0;
    padding-left: 1.3rem;
  }

  .panel-body ul li {
    font-size: 0.95rem;
    margin-bottom: 0.7rem;
  }
}

/* 4.1 SMALL PHONES (< 480px) */
@media (max-width: 480px) {
  .services-hero {
    padding: 5rem 1.5rem 1rem;
    min-height: 30vh;
    gap: 1.5rem;
  }

  .services-hero-left h1 {
    font-size: 2rem;
    margin-top: 1rem;
  }

  .services-hero-right p {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .services-grid-section {
    padding: 2.5rem 0 4rem 0;
    margin-bottom: 2rem;
  }

  .services-grid {
    gap: 0.75rem;
    margin: 2.5rem auto;
    padding: 3rem 0.75rem;
  }

  .service-card {
    flex: 0 0 200px;
    min-width: 180px;
    max-width: 200px;
    min-height: 160px;
  }


  .service-info {
    padding: 1.25rem;
  }

  .service-info h3 {
    font-size: 1.1rem;
    line-height: 1.25;
  }

  .panel-header {
    padding: 1.3rem;
  }

  .panel-header h2 {
    font-size: 1.35rem;
  }

  .close-btn {
    padding: 0.4rem;
  }

  .close-btn svg {
    width: 20px;
    height: 20px;
  }

  .panel-body {
    padding: 1.5rem 1rem;
  }

  .panel-body h2 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
  }

  .panel-body h3 {
    font-size: 1rem;
    margin: 1.6rem 0 0.8rem 0;
  }

  .panel-body p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
  }

  .panel-body ul {
    margin: 0.8rem 0 1.6rem 0;
    padding-left: 1.2rem;
  }

  .panel-body ul li {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    line-height: 1.7;
  }
}

/* card container */
.service-card{
  position:relative;
}


/* position button */
.delete-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  z-index: 999;
  transform-style: flat;
  isolation: isolate;
  border-radius: 0 0 18px 18px;
  overflow: hidden;
}

.delete-service {
  width: 100%;
  height: 100%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 0 0 18px 18px;
  transition: background 0.2s ease;
}

.delete-service:hover {
  background: rgba(229, 57, 53, 0.85);
  transform: none;
}

.delete-service:active {
  background: rgba(180, 30, 30, 0.95);
  transform: none;
}

.delete-icon {
  width: 18px;
  height: 18px;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2;
  fill: none;
  pointer-events: none;
  transition: stroke 0.2s ease;
}

.delete-service:hover .delete-icon {
  stroke: #fff;
}