/* ubertex/public/assets/css/service_section.css */

:root {
  --accent: #E6A57E;
  --accent-hover: #CF9270;
  --dark: #1f1f28;
  --light: #f9f9fb;
  --card: #fff;
  --muted: #6e6e80;
  --radius: 16px;
}

/* ===== SECTION WRAPPER ===== */
.service-section {
  background: linear-gradient(135deg,#1f1f28 0%,#2f2f42 100%);
  color: #ffffff;
  padding: 80px 1rem;
  font-family: 'Rubik', system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
}

/* ===== LAYOUT CONTAINER ===== */
.service-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 2.5rem;
  align-items: stretch;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

/* ===== MEDIA / SLIDER SIDE ===== */
.service-media {
  flex: 1 1 45%;
  min-width: 280px;
  position: relative;
  display: flex;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 1/1;
  height: auto;
  max-width: 480px;
  min-width: 240px;
  align-items: center;
  justify-content: center;
  background: #fff1e8;
}

/* Slider wrapper (inside media) */
.service-slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Slides container using scroll snapping */
.service-slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  width: 100%;
  height: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.service-slides::-webkit-scrollbar { display: none; }

/* Each slide */
.service-slide {
  flex: 0 0 100%;
  max-width: 100%;
  height: 100%;
  position: relative;
  scroll-snap-align: start;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  display: block;
  box-shadow: 0 30px 80px -10px rgba(0,0,0,0.5);
  background: #fff;
}

/* Navigation arrows */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  box-sizing: border-box;
  z-index: 2;
}
.slider-button {
  background: rgba(0,0,0,0.35);
  border: none;
  color: #fff;
  width: 44px;              /* A11Y: min tap size */
  height: 44px;             /* A11Y: min tap size */
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background .2s, transform .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline-offset: 3px;
}
.slider-button:hover {
  background: rgba(0,0,0,0.55);
  transform: translateY(-1px);
}
.slider-button:focus-visible {
  outline: 3px solid var(--accent);
}

/* ===== SLIDER DOTS ===== */
.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;                 /* A11Y: spacing antar target */
  z-index: 2;
  padding: 6px 8px;          /* ruang aman di container */
}

/* Tombol dot (button) — hitbox besar, visual kecil */
.dot {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  background-clip: padding-box;
  position: relative;
  box-sizing: border-box;

  width: 44px;               /* A11Y: min tap size */
  height: 44px;              /* A11Y: min tap size */
  min-width: 44px;
  min-height: 44px;

  padding: 0;                /* jangan tambah padding agar ukuran konsisten */
  margin: 0;
  border: none;
  border-radius: 999px;

  display: grid;
  place-items: center;

  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline-offset: 3px;
}

/* Visual dot kecil di tengah */
.dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(242,236,228,0.4);
  box-shadow: inset 0 0 0 2px rgba(31,31,40,0.08);
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

/* Hover */
.dot:hover::after {
  background: var(--dark);
}

/* Fokus untuk aksesibilitas (keyboard navigation) */
.dot:focus-visible {
  outline: 3px solid var(--accent);
}

/* Dot aktif (termasuk aria-current) */
.dot.active::after,
.dot[aria-current="true"]::after {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(230,165,126,0.45);
  transform: scale(1.05);
}

/* ===== CONTENT SIDE ===== */
.service-content {
  flex: 1 1 50%;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 1rem;

  /* penting agar teks/bars tidak kepotong saat flex shrink */
  min-width: 0;
  overflow: visible;
  word-break: normal;
}

/* gunakan clamp agar responsif dan tidak meluber */
.service-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin: 0;
  font-weight: 700;
  position: relative;
  line-height: 1.2;
}
.service-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: #E6A57E;
  border-radius: 2px;
  margin-top: 6px;
}

.service-subtitle {
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  margin: 4px 0 8px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

/* batasi lebar & pastikan wrap */
.service-description {
  font-size: clamp(.92rem, 1.4vw, 1rem);
  line-height: 1.7;
  margin: 0 0 1rem;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.85);
  overflow-wrap: anywhere;
}

/* Bars */
.service-bars {
  display: grid;
  gap: 1rem;
  margin-top: 10px;
  max-width: 700px;
  width: 100%;
}

.bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.bar-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 4px;
  letter-spacing: .5px;

  /* responsif */
  font-size: clamp(.82rem, 1.2vw, .9rem);

  /* cegah dorongan horizontal */
  flex-wrap: nowrap;
}

/* nama bar: biarkan mengambil sisa ruang */
.bar-label span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* persen: tetap rapat di kanan, tidak membungkus */
.bar-percent {
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1;
  transform: translateZ(0);
  will-change: contents;
  transition: opacity .3s ease;
}

/* track & fill 100% lebar container */
.bar-track {
  background: rgba(255,255,255,0.08);
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.bar-fill {
  width: 0%;
  max-width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #E6A57E 0%, #CF9270 100%);
  border-radius: 999px;
  transition: width 1.4s cubic-bezier(.4,.2,.2,1);
  position: relative;
}

/* CTA */
.service-cta { margin-top: 1.5rem; }
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: #E6A57E;
  color: #1f1f28;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: filter .25s ease, transform .2s ease;
  position: relative;
  white-space: nowrap;
}
.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* ====== RESPONSIVE ====== */

/* Tablet landscape / small desktop */
@media (max-width: 1024px) {
  .service-section {
    padding: 64px max(1rem, env(safe-area-inset-left)) 70px max(1rem, env(safe-area-inset-right));
  }
  .service-container {
    flex-direction: column-reverse;
    gap: 2rem;
  }
  .service-media,
  .service-content {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .service-media {
    aspect-ratio: 1/1;
    max-width: 100vw;
    min-width: 200px;
    margin: 0 auto;
  }
  .slider-nav { padding: 0 4px; }
  .service-description { max-width: 65ch; }
}

/* Tablet portrait */
@media (max-width: 820px) {
  .service-container { gap: 1.5rem; }
  .slider-button { width: 44px; height: 44px; }  /* tetap 44px */
  .bar-track { height: 9px; }
}

/* Mobile */
@media (max-width: 600px) {
  /* tidak ada horizontal scroll */
  .service-section,
  .service-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* konten: beri ruang napas dan pastikan wrap */
  .service-content {
    padding-right: 2px; /* menghindari clipped text oleh rounding */
  }

  /* slider (tetap: tidak diubah perilakunya) */
  .service-media,
  .service-slider,
  .service-slides,
  .service-slide {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  .service-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .slider-nav {
    left: 0;
    right: 0;
    padding-left: 8px;
    padding-right: 8px;
  }
  .slider-button { transform: translateY(-50%); }

  /* teks lebih rapat & tidak terpotong */
  .service-title { line-height: 1.25; }
  .service-subtitle { line-height: 1.35; }
  .service-description { line-height: 1.65; }

  /* bar lebih tipis & aman di layar kecil */
  .bar-track { height: 8px; }
  .bar-label { gap: .4rem; }
}

/* Perangkat sentuh: target sedikit lebih besar (48px) */
@media (pointer: coarse) {
  .slider-button {
    width: 48px;
    height: 48px;
  }
  .dot {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }
  .slider-dots {
    gap: 12px;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .service-title { font-size: 1.35rem; }
  .service-subtitle { font-size: .95rem; }
  .service-description { font-size: .9rem; }
  .bar-label { font-size: .8rem; }
}
