/* ===== Services Page (Kling AI Flagship Style) ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
    color: #e0e0e0;
    overflow-x: hidden;
}

.services-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 48px 48px 72px;
}

/* ===== Header ===== */
.services-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 44px;
}
.services-header .back-button {
    /* ⛔ 정본: assets/css/getavata.css 의 .page-back-btn (결제·아바타·스타일·라이브와 동일 규격)
       ⚠️ main.css 의 전역 `button { padding: 0 3.75em; font-size:0.6em; line-height:4.75em;
          letter-spacing:0.25em; text-transform:uppercase; border-radius:3em }` 이 새어 들어온다.
          padding 을 명시하지 않으면 border-box 에서 **패딩이 폭을 밀어내 알약 모양**이 된다
          (2026-08-24 실제 발생 — 화면상 36px 이 아니라 넓은 캡슐로 보였다).
          아래 항목을 하나라도 빼지 말 것. */
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s, border-color 0.18s;
}
.services-header .back-button:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
}
.services-header-text h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
}
.services-header-text h1 em {
    font-style: italic;
    color: #c471ed;
}
.services-header-text p {
    font-size: 1rem;
    color: rgba(255,255,255,0.55);
    margin: 0;
}

/* ===== Cards Grid ===== */
.service-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

/* 중간 폭: 5열 카드가 과도하게 얇아지는 것 방지 */
@media (max-width: 1320px) {
    .service-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 980px) {
    .service-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Card ===== */
.service-card {
    position: relative;
    height: 620px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    background: #181530;
    border: 1px solid rgba(255,255,255,0.06);
}

/* ===== Background Image (제자리 고정) ===== */
.service-card-bg {
    position: absolute;
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 170px);
    object-fit: cover;
    display: block;
    border-radius: 16px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 0;
}
/* 이미지 줌 + 패널 확장은 아래 미디어쿼리에서만 적용 (모바일 무분별 :hover 방지) */

/* ===== Body (하단에 위치, 호버시 위로 확장) ===== */
.service-card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: #181530;
    padding: 20px 24px 28px;
    transition: height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 158px;
    display: flex;
    flex-direction: column;
}

.service-card-body h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    flex-shrink: 0;
}
.service-card-sub {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
    flex-shrink: 0;
}

/* ===== Expand Area (호버시 나타남) ===== */
.service-card-expand {
    overflow: hidden;
    opacity: 0;
    max-height: 0;
    transition: opacity 0.4s ease 0.05s, max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ----- PC·트랙패드: 호버 시에만 확장 (실제 호버 가능한 기기만) ----- */
@media (hover: hover) and (pointer: fine) {
    .service-card:hover .service-card-bg {
        transform: scale(1.05);
    }
    .service-card:hover .service-card-body {
        height: 370px;
    }
    .service-card:hover .service-card-expand {
        opacity: 1;
        max-height: 200px;
    }
}

/* ----- 터치·스타일러스 위주: 기본은 접힘 → 탭으로 .is-expanded (services.js) ----- */
@media (hover: none), (pointer: coarse) {
    .service-card {
        -webkit-tap-highlight-color: transparent;
    }
    .service-card.is-expanded .service-card-bg {
        transform: scale(1.05);
    }
    .service-card.is-expanded .service-card-body {
        height: 370px;
    }
    .service-card.is-expanded .service-card-expand {
        opacity: 1;
        max-height: 200px;
    }
}

/* Feature List */
.service-features {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
}
.service-features li {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.75);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.service-features li i {
    color: #c471ed;
    font-size: 0.72rem;
    flex-shrink: 0;
}

/* ===== Card Button ===== */
.service-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    border-radius: 24px;
    border: 1.5px solid rgba(255,255,255,0.3);
    background: transparent;
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    margin-top: auto;
    align-self: flex-start;
    flex-shrink: 0;
}
.service-card-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* Purchase 버전 */
.service-card-btn.purchase-btn {
    border-color: rgba(255,255,255,0.3);
    background: transparent;
}
.service-card-btn.purchase-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* ===== Fade-in Animation ===== */
.animate-fade-in {
    animation: fadeInUp 0.6s ease both;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 860px) {
    .service-cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .service-card {
        height: 480px;
    }
    .services-container {
        padding: 28px 16px 40px;
    }
    .services-header-text h1 {
        font-size: 1.6rem;
    }
}

/* ⛔ 모바일에서 뒤로가기를 숨기던 규칙을 제거했다(2026-08-24).
   정본(getavata.css)도 2026-08-02 에 같은 이유로 제거했고 '되살리지 말 것'이라 적혀 있다 —
   모바일에서 돌아갈 방법이 사라지고, 서비스마다 헤더 모양이 달라 보인다. */

@media (max-width: 480px) {
    .services-container {
        padding: 20px 12px 32px;
    }
    .services-header-text h1 {
        font-size: 1.35rem;
    }
    .service-card {
        height: 440px;
    }
    /* 모바일에서도 PC와 동일하게 하단 패널 기본 높이(158px) 유지 — 이미지 대부분 노출 */
    .service-card-body {
        padding: 20px 18px 22px;
    }
}
