/**
 * 메인페이지 버전2 전용 스타일
 * 2026-01-14: 전체 너비 히어로 + 검색창 섹션 + 퀵박스 가로 배치
 */

/* ========================================
   1. 전체 너비 히어로 슬라이더
   ======================================== */

.hero-fullwidth-section {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 500px;
    position: relative;
    overflow: hidden;
}

.hero-fullwidth-section .heroSwiper {
    width: 100%;
    height: 100%;
}

.hero-fullwidth-section .swiper-slide {
    width: 100%;
    height: 100%;
}

.hero-fullwidth-section .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-fullwidth-section .swiper-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

/* 히어로 텍스트 오버레이 - 2026-01-14: 어두운 효과 제거 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: none;
    z-index: 10;
}

/* 2026-01-15: 디자인 시스템 클래스(text-display, text-h2) 그대로 사용 */
.hero-text {
    text-align: center;
    /* 이미지 위에서 가독성을 위한 그림자만 추가 */
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

.hero-text .text-h2 {
    margin-bottom: 8px;
}

.hero-text .text-display {
    margin-bottom: 8px;
}

/* 히어로 슬라이더 컨트롤 */
.hero-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero-controls button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #333;
    transition: color 0.2s;
}

.hero-controls button:hover {
    color: var(--accent-blue, #065c71);
}

.hero-controls .counter {
    font-size: 14px;
    color: #333;
    min-width: 50px;
    text-align: center;
}

/* 2026-01-15: v2 도트 인디케이터 스타일 - Swiper 내부에 배치 */
.heroSwiper .hero-pagination {
    position: absolute;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: auto !important;
    z-index: 10;
}

.heroSwiper .hero-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 4px;
}

.heroSwiper .hero-pagination .swiper-pagination-bullet-active {
    background: #fff;
    width: 24px;
    border-radius: 5px;
}

/* ========================================
   2026-01-15: v2 히어로 텍스트 오버레이
   - container-wrapper 기반 레이아웃으로 변경 (사이트 너비 1400px 기준 여백 적용)
   ======================================== */
.hero-overlay-v2 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

/* 내부 컨테이너 - max-width: 1400px 적용 (layout.css의 container-wrapper 상속) */
.hero-overlay-v2 .container-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

/* 텍스트 박스 기본 스타일 (text-shadow는 인라인으로 적용) */
.hero-text-v2 {
    width: 100%;
}

/* 정렬 옵션 - hero-text-v2에 직접 적용 */
.hero-text-v2.hero-align-left {
    text-align: left;
}

.hero-text-v2.hero-align-center {
    text-align: center;
}

.hero-text-v2.hero-align-right {
    text-align: right;
}

/* 2026-02-02: 수직 정렬 - container-wrapper에 적용 */
/* 여백은 hero-text-v2의 padding으로 상하좌우 공통 적용 */
.hero-overlay-v2 .container-wrapper.hero-valign-top {
    align-items: flex-start;
}

.hero-overlay-v2 .container-wrapper.hero-valign-center {
    align-items: center;
}

.hero-overlay-v2 .container-wrapper.hero-valign-bottom {
    align-items: flex-end;
}

/* 타이틀 - 반응형 폰트 */
.hero-title-v2 {
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}

/* 2026-04-13: 히어로 타이틀 굵기 혼합 지원 (어드민에서 얇은/굵은 두께 별도 설정) */
.hero-title-v2 b,
.hero-title-v2 strong {
    font-weight: var(--hero-bold-weight, 800);
}

/* 설명 - 반응형 폰트 */
.hero-desc-v2 {
    font-size: clamp(14px, 2.5vw, 24px);
    font-weight: 400;
    line-height: 1.5;
}

/* 2026-02-04: 슬라이드별 텍스트 전환 효과 */
.hero-text-v2.hero-text-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.hero-text-v2.hero-text-slide.active {
    opacity: 1;
    visibility: visible;
}

/* 슬라이드 텍스트 정렬 보정 */
.hero-text-v2.hero-text-slide.hero-align-left {
    align-items: flex-start;
}

.hero-text-v2.hero-text-slide.hero-align-center {
    align-items: center;
}

.hero-text-v2.hero-text-slide.hero-align-right {
    align-items: flex-end;
}

/* container-wrapper 내부에서 슬라이드 텍스트 위치 */
.hero-overlay-v2 .container-wrapper {
    position: relative;
}

/* 2026-01-15: 모바일에서 숨김 (640px = 진짜 모바일) */
@media (max-width: 640px) {
    /* 전체 오버레이 숨김 (기존 호환성 유지) */
    .hero-overlay-v2.hide-mobile {
        display: none;
    }
    /* 2026-01-15: 타이틀/설명 개별 숨김 */
    .hero-title-v2.hide-mobile,
    .hero-desc-v2.hide-mobile {
        display: none;
    }
}

/* ========================================
   2. 전체 검색 창 섹션
   ======================================== */

.search-section-v2 {
    background: #f8f9fa;
    /* 2026-01-15: 위아래 여백 50% 추가 (20px → 30px) */
    padding: 30px 0;
}

.search-form-v2 {
    /* 2025-01-15: 퀵버튼 실제 너비와 동일 */
    max-width: 825px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    border: 1px solid #1a5a7a;
    border-radius: 24px;
    overflow: hidden;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form-v2:focus-within {
    border-color: var(--accent-blue, #065c71);
    box-shadow: 0 0 0 3px rgba(6, 92, 113, 0.1);
}

.search-form-v2 input {
    flex: 1;
    height: 60px;
    padding: 0 24px;
    font-size: 1.125rem;
    border: none;
    outline: none;
    background: transparent;
}

.search-form-v2 input::placeholder {
    color: #9ca3af;
}

/* 2026-02-28: 고정 너비 → padding 기반, hover 배경 → 아이콘 opacity */
/* 좌측 패딩 없음: input 우측 패딩이 텍스트-아이콘 간격 담당 */
.search-form-v2 button {
    padding: 0 10px 0 0;
    margin-right: 8px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
}

.search-form-v2 button img {
    width: 28px;
    height: 28px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.search-form-v2 button:hover img {
    opacity: 1;
}

/* ========================================
   3. 퀵박스 가로 배치 섹션
   ======================================== */

/* ========================================
   3. PC/모바일 표시 전환
   2025-01-15: PC는 퀵버튼 6개, 모바일은 퀵박스
   ======================================== */
.pc-only {
    display: block;
}
.mobile-only {
    display: none;
}

@media (max-width: 1024px) {
    .pc-only {
        display: none;
    }
    .mobile-only {
        display: block;
    }
}

/* ========================================
   3-1. PC 전용: 퀵버튼 6개 가로 배치 (네이버 스타일)
   2025-01-15: 미니멀 아이콘 + 텍스트 스타일
   ======================================== */
.quick-buttons-v2 {
    padding: 32px 0 64px 0;
    background: #fff;
}

.quick-buttons-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.quick-btn-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 12px;
    text-decoration: none;
}

.quick-btn-icon {
    /* 2025-01-15: 크기 1.5배 (56px → 84px) */
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
}

/* 아이콘 배경색 - 앞 3개 연초록, 뒤 3개 연하늘 */
.quick-btn-v2:nth-child(1) .quick-btn-icon,
.quick-btn-v2:nth-child(2) .quick-btn-icon,
.quick-btn-v2:nth-child(3) .quick-btn-icon { background: #e8f5e9; }

.quick-btn-v2:nth-child(4) .quick-btn-icon,
.quick-btn-v2:nth-child(5) .quick-btn-icon,
.quick-btn-v2:nth-child(6) .quick-btn-icon { background: #e8f4fc; }

.quick-btn-icon img {
    width: 46px;
    height: 46px;
    filter: none;
}

/* 아이콘 색상 - 앞 3개 파스텔 초록, 뒤 3개 하늘 */
.quick-btn-v2:nth-child(1) .quick-btn-icon img,
.quick-btn-v2:nth-child(2) .quick-btn-icon img,
.quick-btn-v2:nth-child(3) .quick-btn-icon img { filter: invert(70%) sepia(30%) saturate(400%) hue-rotate(95deg) brightness(100%) contrast(80%); }

.quick-btn-v2:nth-child(4) .quick-btn-icon img,
.quick-btn-v2:nth-child(5) .quick-btn-icon img,
.quick-btn-v2:nth-child(6) .quick-btn-icon img { filter: invert(55%) sepia(70%) saturate(500%) hue-rotate(180deg) brightness(100%) contrast(90%); }

.quick-btn-icon svg {
    width: 46px;
    height: 46px;
    stroke: #666;
    stroke-width: 1.5;
}

.quick-btn-label {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    text-align: center;
    white-space: nowrap;
}

/* ========================================
   3-2. 모바일 전용: 기존 퀵박스
   ======================================== */
.quickbox-section-v2 {
    padding: 40px 0;
}

.quickbox-section-v2 .container-wrapper {
    max-width: 100%;
}

/* 2025-01-15: 그리드에서 한 줄 가로 배치로 변경 */
.quickbox-grid {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.quickbox-grid .qucik_box {
    /* 2025-01-15: components.css의 width: calc(100%/2 - 15px) 오버라이드 */
    width: auto !important;
    flex: 1;
    padding: 24px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    height: auto;
}

.quickbox-grid .quickbox-header {
    margin-bottom: 16px;
}

.quickbox-grid .quickbox-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.quickbox-grid .quickbox-header p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.quickbox-grid .quickbox-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 퀵박스 색상 - v1 (components.css)과 동일 */
/* 2025-01-15: 색상 수정 - v1과 동일하게 */
.quickbox-grid .green_box_color {
    background: linear-gradient(135deg, #3eb8a8, #1a7a7a);
}

.quickbox-grid .blue_box_color {
    background: linear-gradient(135deg, #3e95b8, #1a5a7a);
}

/* 롤오버 효과는 components.css의 [class*="item_qu"] 스타일 사용 */

/* ========================================
   4. 반응형 스타일
   ======================================== */

/* 태블릿 (641px ~ 1024px) */
@media (max-width: 1024px) {
    .hero-fullwidth-section {
        height: 400px;
    }

    .hero-text .text-line-main {
        font-size: 2.5rem;
    }

    .hero-text .text-line-top,
    .hero-text .text-line-bottom {
        font-size: 1rem;
    }

    .search-section-v2 {
        padding: 30px 0;
    }

    .search-form-v2 {
        width: 100%;
    }

    .search-form-v2 input {
        height: 50px;
        font-size: 1rem;
    }

    .search-form-v2 button {
        height: 50px;
    }

    .quickbox-section-v2 {
        padding: 30px 0;
    }

    /* 2025-01-15: 태블릿에서도 한 줄 유지 */
    .quickbox-grid {
        gap: 16px;
    }

    .quickbox-grid .qucik_box {
        min-height: 180px;
        padding: 20px;
    }
}

/* 모바일 (~ 640px) */
@media (max-width: 640px) {
    .hero-fullwidth-section {
        height: 300px;
    }

    .hero-text .text-line-main {
        font-size: 1.75rem;
    }

    .hero-text .text-line-top,
    .hero-text .text-line-bottom {
        font-size: 0.875rem;
    }

    .hero-controls {
        bottom: 20px;
        padding: 6px 12px;
        gap: 8px;
    }

    .hero-controls button {
        width: 28px;
        height: 28px;
    }

    .hero-controls .counter {
        font-size: 12px;
    }

    .search-section-v2 {
        padding: 24px 0;
    }

    .search-form-v2 {
        max-width: none;
        width: 100%;
    }

    .search-form-v2 input {
        height: 48px;
        padding: 0 16px;
        font-size: 0.9375rem;
    }

    .search-form-v2 button {
        height: 48px;
    }

    .search-form-v2 button img {
        width: 24px;
        height: 24px;
    }

    .quickbox-section-v2 {
        padding: 24px 0;
    }

    /* 2025-01-15: 모바일에서는 세로 배치 */
    .quickbox-grid {
        flex-direction: column;
        gap: 12px;
    }

    .quickbox-grid .qucik_box {
        min-height: auto;
        padding: 20px;
    }

    .quickbox-grid .quickbox-header h3 {
        font-size: 1.125rem;
    }
}

/* ========================================
   5. 버전2 전용 레이아웃 조정
   ======================================== */

/* 버전2에서 헤더 아래 패딩 제거 (히어로가 바로 시작) */
body.main-v2 .contents {
    padding-top: 0 !important;
}

/* 히어로 섹션은 헤더 뒤로 들어가지 않도록 */
body.main-v2 #wrap {
    overflow-x: hidden;
}

/* 반응형: 데스크톱에서 히어로는 헤더 높이만큼 마진 */
@media (min-width: 1025px) {
    body.main-v2 .hero-fullwidth-section {
        margin-top: 0;
    }
}

/* 반응형: 모바일에서는 헤더가 relative이므로 마진 불필요 */
@media (max-width: 1024px) {
    body.main-v2 .hero-fullwidth-section {
        margin-top: 0;
    }
}
