/* The business site's services page, after the "KATCHUP 서비스 탭" design:
   a quiet grey surface, pill tabs that rise white when chosen, and one
   service's card at a time. Wide enough for both columns, the category
   tabs head the card and the services list sits at the foot of the left
   column; narrower, the parts stack with the tabs above the list. */
.service-catalog {
  --service-ink: #18181B;
  --service-muted: #5F6066;
  --service-quiet: #6B6B72;
  --service-surface: #F4F4F5;
  --service-edge: inset 0 0 0 1px rgba(24, 24, 27, 0.04);
  --service-lift: 0 1px 2px rgba(24, 24, 27, 0.06), 0 8px 22px rgba(24, 24, 27, 0.08);
  --service-accent: #5B8DEF;
  /* Two columns fill the screen's height and no more, so the catalog
     itself never scrolls: the page starts under the fixed site header (76px
     tall wherever there are two columns), and the space above and below
     narrows on a shorter screen (the design's 64px from about 1070px tall,
     16px at the least; more on a laptop or wider, below). 320px is the least
     the card's words and buttons need; only a screen too short for that
     (under about 440px) scrolls. */
  --service-header: 76px;
  --service-header-overlap: 0px;
  --service-pad-block: clamp(16px, 6vh, 64px);
  --service-fit: max(320px, calc(100vh - var(--service-header) - 2 * var(--service-pad-block)));
  box-sizing: border-box;
  width: 100%;
  padding: calc(var(--service-pad-block) + var(--service-header-overlap)) clamp(20px, 4vw, 40px) var(--service-pad-block);
  background: #FFFFFF;
  color: var(--service-ink);
  /* Korean lines break between words, never inside one ("서비 / 스"). */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* The height with the browser's toolbars showing, where it is known. */
@supports (height: 100svh) {
  .service-catalog {
    --service-fit: max(320px, calc(100svh - var(--service-header) - 2 * var(--service-pad-block)));
  }
}

/* From 768px wide the site header is 76px tall. A company's workspace
   clears all of it; the public page clears 64px, so there the catalog starts
   12px lower, and the space above it shows in full, as tall as the space
   below. */
@media (min-width: 768px) {
  .service-catalog:not([data-company-services-workspace="true"]) {
    --service-header-overlap: 12px;
  }
}

/* A laptop or wider gives the two columns more room above and below: 63px
   on a 789px-tall screen, 84px on a 970px one, 96px at the most. */
@media (min-width: 1024px) {
  .service-catalog {
    --service-pad-block: clamp(16px, calc(12vh - 32px), 96px);
  }
}

.service-catalog *,
.service-catalog *::before,
.service-catalog *::after {
  box-sizing: border-box;
}

.service-catalog [hidden] {
  display: none !important;
}

.service-catalog__frame {
  max-width: 1200px;
  margin: 0 auto;
  container-type: inline-size;
}

/* Narrow, the parts stack in their order: introduction, categories, the
   category's services, the card. */
.service-catalog__grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-catalog__intro {
  grid-area: intro;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.service-catalog__title {
  margin: 0;
  font-size: clamp(32px, 4vw, 40px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.service-catalog__lede {
  margin: 0;
  max-width: 270px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--service-muted);
}

/* Tabs: the categories run across, a category's services run down. */
.service-catalog__categories {
  grid-area: categories;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--service-surface);
  border-radius: 999px;
  box-shadow: var(--service-edge);
}

.service-catalog__menu {
  grid-area: menu;
  min-width: 0;
}

.service-catalog__product-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--service-surface);
  border-radius: 26px;
  box-shadow: var(--service-edge);
}

.service-catalog__tab {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--service-quiet);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: box-shadow 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.service-catalog__tab:hover {
  color: var(--service-ink);
}

.service-catalog__tab[aria-selected="true"] {
  background: #FFFFFF;
  box-shadow: var(--service-lift);
  color: var(--service-ink);
  font-weight: 500;
}

.service-catalog__category {
  flex: 1 1 0;
  min-width: 0;
  min-height: 50px;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  line-height: 1.3;
}

.service-catalog__product {
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 20px;
  text-align: left;
  line-height: 1.4;
}

.service-catalog__tab-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.service-catalog__category .service-catalog__tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-catalog__dot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFFFF 0%, #DADADF 80%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.service-catalog__category .service-catalog__dot {
  width: 12px;
  height: 12px;
}

.service-catalog__tab[aria-selected="true"] .service-catalog__dot {
  background: radial-gradient(circle at 32% 30%, #FFFFFF 0%, #F4D6E6 28%, var(--service-accent) 78%);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(91, 141, 239, 0.13);
}

/* The card. */
.service-catalog__stage {
  grid-area: stage;
  min-width: 0;
}

.service-catalog__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 8px;
  background: var(--service-surface);
  border-radius: 30px;
  box-shadow: var(--service-edge);
}

.service-catalog__media {
  aspect-ratio: 2 / 1;
  border-radius: 24px;
  overflow: hidden;
  background: #E3E9F3;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.06);
}

.service-catalog__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-catalog__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 28px 8px;
}

.service-catalog__headline-row {
  --service-headline-size: clamp(22px, 2.4vw, 26px);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* Centred on the headline's first line, however many it wraps to. */
.service-catalog__mark {
  flex: none;
  margin-top: calc((1.35 * var(--service-headline-size) - 20px) / 2);
}

.service-catalog__headline {
  margin: 0;
  min-width: 0;
  font-size: var(--service-headline-size);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.service-catalog__accent {
  font-family: "Gowun Batang", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* As tall as the lines it may show (1.75em each), however few it fills:
   a one-line summary leaves the card the height a full one gives it. */
.service-catalog__summary {
  display: -webkit-box;
  margin: 0;
  max-width: 640px;
  min-height: calc(3 * 1.75em);
  overflow: hidden;
  font-size: 16px;
  line-height: 1.75;
  color: var(--service-muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.service-catalog__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding: 20px 12px 12px 28px;
}

.service-catalog__price {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 4px;
}

.service-catalog__amount {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--service-ink);
}

.service-catalog__price-note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--service-muted);
}

.service-catalog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.service-catalog__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin: 0;
  padding: 14px 26px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.service-catalog__button--secondary {
  background: #E4E4E7;
  color: var(--service-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.service-catalog__button--secondary:hover {
  background: #DCDCE0;
}

.service-catalog__button--primary,
.service-catalog__button--primary:hover {
  color: #FFFFFF;
}

.service-catalog__button--primary {
  background: #17171A;
}

.service-catalog__button--primary:hover {
  background: #2C2C31;
}

.service-catalog :is(button, a):focus-visible,
.service-details :is(button, a):focus-visible {
  outline: 2px solid var(--service-accent, #5B8DEF);
  outline-offset: 3px;
}

.service-catalog__empty {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 40px 32px;
  background: var(--service-surface);
  border-radius: 30px;
  box-shadow: var(--service-edge);
}

.service-catalog__empty-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 600;
}

.service-catalog__empty-text {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--service-muted);
}

/* Wide enough for both columns (the design's 260px, a 40px gap and at
   least 560px for the card): the introduction tops the left column and the
   services list sits at its foot, level with the card's; the category tabs
   head the card. */
@container (min-width: 860px) {
  /* No taller than the screen allows (--service-fit): the flexible row
     gives way first, and with it the card's picture (below). */
  .service-catalog__grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "intro categories"
      "intro stage"
      "menu stage";
    column-gap: 40px;
    row-gap: 16px;
    max-height: var(--service-fit);
  }

  .service-catalog__grid[data-tabbed="false"] {
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "intro stage"
      "menu stage";
  }

  .service-catalog__intro {
    margin-bottom: 0;
  }

  .service-catalog__menu {
    align-self: end;
    min-height: 0;
    padding-top: 16px;
  }

  /* A long list scrolls inside its own box rather than outgrow the page. */
  .service-catalog__product-list {
    max-height: calc(var(--service-fit) - 200px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* The card takes its grid area's height; when the screen is short the
     picture gives up height (cut evenly from top and bottom) and the words
     and buttons keep theirs. With the tighter rules for short screens
     below, its 48px floor keeps them all inside the card at the catalog's
     least height. */
  .service-catalog__stage {
    min-height: 0;
  }

  .service-catalog__media {
    flex: 0 1 auto;
    min-height: 48px;
  }

  .service-catalog__body,
  .service-catalog__footer {
    flex: none;
  }

  /* Two lines at most, so a long headline cannot carry the card past the
     screen's foot. */
  .service-catalog__headline {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .service-catalog__empty {
    grid-row: 1 / -1;
  }
}

/* Two columns on a short screen: the summary keeps two lines, leaving the
   picture more. (Stacked on a phone, it keeps three.) */
@media (max-height: 820px) {
  @container (min-width: 860px) {
    .service-catalog__summary {
      min-height: calc(2 * 1.75em);
      -webkit-line-clamp: 2;
      line-clamp: 2;
    }
  }
}

/* Shorter still (a small laptop, a browser not at full height): one line
   of summary, and the tabs and the card's spacing a little tighter. */
@media (max-height: 700px) {
  @container (min-width: 860px) {
    .service-catalog__summary {
      min-height: 1.75em;
      -webkit-line-clamp: 1;
      line-clamp: 1;
    }

    .service-catalog__category {
      min-height: 44px;
      padding-block: 10px;
    }

    .service-catalog__product {
      min-height: 44px;
      padding-block: 10px;
    }

    .service-catalog__body {
      gap: 10px;
      padding-top: 20px;
    }

    .service-catalog__footer {
      padding-top: 14px;
    }
  }
}

/* At the very least (a browser with its developer tools open below), the
   headline keeps one line, so the words and buttons fit the 320px floor. */
@media (max-height: 560px) {
  @container (min-width: 860px) {
    .service-catalog__headline {
      -webkit-line-clamp: 1;
      line-clamp: 1;
    }
  }
}

@media (max-width: 599px) {
  .service-catalog {
    padding-top: 40px;
    padding-bottom: 48px;
  }

  .service-catalog__menu {
    margin-bottom: 8px;
  }

  .service-catalog__body {
    padding: 22px 16px 4px;
  }

  .service-catalog__footer {
    padding: 18px 8px 8px 16px;
  }

  .service-catalog__actions,
  .service-catalog__actions .service-catalog__button {
    flex: 1 1 auto;
  }
}

/* "자세히 보기": a sheet over the page, rising from the bottom on a phone. */
html:has(.service-details[open]) {
  overflow: hidden;
}

.service-details {
  box-sizing: border-box;
  width: min(720px, calc(100vw - 32px));
  max-width: none;
  max-height: min(88vh, 920px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: #FFFFFF;
  color: #18181B;
  box-shadow: 0 24px 80px rgba(24, 24, 27, 0.24);
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.service-details[open] {
  display: flex;
  flex-direction: column;
}

.service-details::backdrop {
  background: rgba(24, 24, 27, 0.45);
}

.service-details *,
.service-details *::before,
.service-details *::after {
  box-sizing: border-box;
}

.service-details__sheet {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 24px 0;
}

.service-details__top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.service-details__facts {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
  color: #5F6066;
}

.service-details__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -6px -10px -6px auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #3A3A40;
  cursor: pointer;
}

.service-details__close:hover {
  background: #F4F4F5;
}

.service-details__media {
  aspect-ratio: 2 / 1;
  border-radius: 22px;
  overflow: hidden;
  background: #E3E9F3;
}

.service-details__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-details__title {
  margin: 22px 0 0;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.service-details__description {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.75;
  color: #3F3F46;
  overflow-wrap: anywhere;
}

.service-details__description p {
  margin: 0;
}

.service-details__description p + p {
  margin-top: 12px;
}

.service-details__description :is(ul, ol) {
  margin: 10px 0;
  padding-left: 20px;
}

.service-details__description ul {
  list-style: disc;
}

.service-details__description ol {
  list-style: decimal;
}

.service-details__description li + li {
  margin-top: 4px;
}

.service-details__description a,
.service-details__guide {
  color: #18181B;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.service-details__guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
}

.service-details__footer {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 24px -24px 0;
  padding: 16px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #EDEDF0;
  background: #FFFFFF;
}

@media (max-width: 639px) {
  .service-details {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }

  .service-details__sheet {
    padding: 14px 16px 0;
  }

  .service-details__footer {
    margin: 20px -16px 0;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .service-details__footer .service-catalog__button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-catalog__tab,
  .service-catalog__button {
    transition: none;
  }
}
