/* ================================
   SERVICES CAROUSEL STYLES (Rebuilt)
   ================================ */

.services-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: none;
  /* Managed by JS */
  background: linear-gradient(135deg, rgba(4, 81, 116, 0.95) 0%, rgba(4, 81, 116, 0.98) 100%);
  overflow: hidden;
}

.services-carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.slider {
  list-style-type: none;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}

.item {
  width: min(15vw, 200px);
  /* Responsive width */
  height: min(22.5vw, 300px);
  /* Responsive height maintaining aspect ratio */
  list-style-type: none;
  position: absolute;
  bottom: 2rem;
  /* Position from bottom instead of top */
  transform: none;
  z-index: 1;
  background-position: center;
  background-size: cover;
  border-radius: 20px;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s, left 0.75s, bottom 0.75s, width 0.75s, height 0.75s;
}

.item:nth-child(1),
.item:nth-child(2) {
  left: 0;
  top: 0;
  bottom: auto;
  width: 100%;
  height: 100%;
  transform: none;
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
}

/* Position thumbnail images at bottom right with gap */
.item:nth-child(3) {
  right: calc((min(15vw, 200px) + 1rem) * 2 + 1rem);
  /* Third from right */
}

.item:nth-child(4) {
  right: calc(min(15vw, 200px) + 2rem);
  /* Second from right */
}

.item:nth-child(5) {
  right: 1rem;
  /* Rightmost */
}

.item:nth-child(6) {
  right: calc((min(15vw, 200px) + 1rem) * 3 + 1rem);
  /* Fourth from right, initially hidden */
  opacity: 0;
}

.content {
  width: min(35vw, 550px);
  /* Increased max-width */
  position: absolute;
  top: 25%;
  /* Moved up from 50% */
  left: 3rem;
  transform: translateY(0);
  /* Remove centering transform */
  font-family: var(--font-primary);
  color: var(--color-text);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  opacity: 0;
  display: none;
}

.content .title {
  font-family: 'Montserrat', sans-serif;
  text-transform: none;
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  font-weight: bold;
  color: #aacdbe;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  text-shadow: none;
  max-width: 100%;
  word-wrap: break-word;
}

.content .description {
  line-height: 1.7;
  margin: 1rem 0 1.5rem;
  font-size: 1.6rem;
  /* Increased for better readability */
  color: #f8dcbf;
  max-width: 95%;
}

/* Button removed as per request */
.content button {
  display: none;
}

.item:nth-of-type(2) .content {
  display: block;
  animation: show 0.75s ease-in-out 0.3s forwards;
}

@keyframes show {
  0% {
    filter: blur(5px);
    opacity: 0;
  }

  100% {
    opacity: 1;
    filter: blur(0);
  }
}

.nav {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  user-select: none;
  display: flex;
}

.nav .btn {
  background-color: rgba(255, 255, 255, 0.5);
  color: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(0, 0, 0, 0.6);
  margin: 0 0.25rem;
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.nav .btn:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

/* Desktop Navigation (arrows) */
.nav-mobile {
  display: none;
}

.nav-desktop {
  display: flex;
}

.nav-desktop .btn {
  background-color: rgba(255, 255, 255, 0.5);
  color: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(0, 0, 0, 0.6);
  margin: 0 0.25rem;
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

/* Media Queries */
@media (width > 650px) and (width < 900px) {
  .content .title {
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    text-shadow: none;
  }

  .content .description {
    font-size: 1.3rem;
  }

  .item {
    width: min(18vw, 160px);
    height: min(27vw, 240px);
  }

  /* Adjust thumbnail spacing for tablets */
  .item:nth-child(3) {
    right: calc((min(18vw, 160px) + 1rem) * 2 + 1rem);
  }

  .item:nth-child(4) {
    right: calc(min(18vw, 160px) + 2rem);
  }

  .item:nth-child(5) {
    right: 1rem;
  }

  .item:nth-child(6) {
    right: calc((min(18vw, 160px) + 1rem) * 3 + 1rem);
    opacity: 0;
  }
}

@media (width < 650px) {
  .services-section {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Hide desktop arrows and show mobile dots */
  .nav-desktop {
    display: none !important;
  }

  .nav-mobile {
    display: flex !important;
  }

  .services-carousel-container {
    min-height: 100vh;
    padding-bottom: 80px;
  }

  .content {
    width: 90% !important;
    max-width: 400px !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    text-align: center;
    padding: 2rem 1.5rem;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    border: none;
    margin: 0 !important;
    position: absolute !important;
    right: auto !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-height: 75vh;
    overflow-y: auto;
  }

  .content .title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    font-weight: bold;
    white-space: normal;
    line-height: 1.3;
    margin-bottom: 1.25rem;
    text-shadow: none;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    text-transform: none;
  }

  .content .title .mobile-break {
    display: block;
  }

  .content .description {
    font-size: 1.1rem;
    text-align: center;
    margin: 0;
    line-height: 1.6;
    color: #f8dcbf;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-shrink: 1;
    font-weight: 300;
  }

  /* On mobile, we want a single full-screen slide feel */
  .item {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    box-shadow: none;
  }

  /* Hide the stack pile on mobile */
  .item:nth-child(3),
  .item:nth-child(4),
  .item:nth-child(5),
  .item:nth-child(6) {
    display: none;
  }

  .nav-mobile {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 100;
    padding: 5px 10px;
    background: rgba(4, 81, 116, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 15px;
    border: 1px solid rgba(248, 220, 191, 0.15);
  }

  .nav-mobile .btn {
    width: 5px !important;
    height: 5px !important;
    min-width: 5px !important;
    min-height: 5px !important;
    max-width: 5px !important;
    max-height: 5px !important;
    border-radius: 50%;
    background-color: rgba(248, 220, 191, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin: 0;
    padding: 0 !important;
    font-size: 0 !important;
    display: block;
  }

  .nav-mobile .btn::after {
    display: none !important;
  }

  .nav-mobile .btn.active {
    background-color: rgba(248, 220, 191, 0.95);
    transform: scale(1.2);
    box-shadow: 0 0 6px rgba(248, 220, 191, 0.4);
  }

  .nav-mobile .btn:hover {
    background-color: rgba(248, 220, 191, 0.7);
    transform: scale(1.1);
  }
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
  .content {
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 360px !important;
    padding: 1.75rem 1.25rem;
    margin: 0 !important;
    left: 50% !important;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    border: none;
  }

  .content .title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.5rem, 5.5vw, 2.0rem);
    font-weight: bold;
    text-align: center;
    line-height: 1.3;
    text-shadow: none;
    text-transform: none;
  }

  .content .description {
    font-size: 1.0rem;
    line-height: 1.6;
    text-align: center;
  }

  .nav {
    bottom: 15px;
    padding: 0.5rem 1rem;
  }

  .nav .btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
    padding: 0.4rem;
  }
}