/* =========================================
   EYECONTACT COMPANY — 2차 리뉴얼
   블랙 + 그레인 / 빅 타이포 / 카드 슬라이더
   ========================================= */

/* 기본 리셋 */
* { box-sizing: border-box; }
body, html {
    margin: 0; padding: 0; height: 100%;
    color: #fff;

    font-family: 'Pretendard Variable', Pretendard, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
}
body.modal-open { overflow: hidden; }

/* 배경 오버레이 (Vegas 위를 어둡게) */
.bg-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.82); z-index: 0; }

/* 그레인 노이즈 텍스처 */
.grain {
    position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    z-index: 1; pointer-events: none;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grainShift 8s steps(10) infinite;
}
@keyframes grainShift {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-3%, 2%); }
    40% { transform: translate(2%, -3%); }
    60% { transform: translate(-2%, -2%); }
    80% { transform: translate(3%, 3%); }
}
@media (prefers-reduced-motion: reduce) {
    .grain { animation: none; }
}

/* =========================================
   상단 빅 타이포 + 헤더 바
   ========================================= */
header { position: absolute; top: 0; width: 100%; z-index: 200; padding: 28px 40px 0; }

/* 빅 타이포 (SVG textLength 로 화면 폭에 정확히 맞춤) */
.brand-type { margin: 0; width: 100%; user-select: none; }
.brand-type svg { width: 100%; height: auto; display: block; }
.brand-type text {
    font-family: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
    font-stretch: 125%;
    font-weight: 900;
    fill: #fff;
}

.header-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 22px;
    padding: 0 12px;
}
.header-id { font-size: 0.85rem; font-weight: 700; letter-spacing: 1.5px; color: #fff; }

.gnb { display: flex; gap: 34px; }
.gnb span {
    font-size: 0.85rem; font-weight: 700; letter-spacing: 1.5px;
    color: #999; cursor: pointer; transition: color 0.3s;
}
.gnb span:hover, .gnb span.active { color: #fff; }

/* =========================================
   메인 카드 슬라이더
   ========================================= */
.main-swiper { width: 100%; height: 100vh; position: relative; z-index: 10; }
.main-swiper .swiper-wrapper { align-items: center; }

.main-slide {
    width: 360px;
    height: 480px;
    opacity: 0.55;
    transform: scale(0.82);
    transition: opacity 0.5s ease, transform 0.5s ease;
    cursor: pointer;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #161616;
}
.main-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.main-slide.swiper-slide-active {
    opacity: 1;
    transform: scale(1.12);
    z-index: 5;
}

/* 카드 우하단 라벨 */
.card-label {
    position: absolute; bottom: 0; right: 0; left: 0;
    padding: 60px 18px 16px;
    text-align: right;
    font-family: 'Archivo', Arial, sans-serif;
    font-stretch: 125%;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
    pointer-events: none;
}

/* 좌우 긴 화살표 */
.side-nav {
    position: absolute; top: 50%; left: 0; transform: translateY(-50%);
    width: 100%; display: flex; justify-content: space-between;
    padding: 0 27%;        /* 11% → 27% : 가운데 카드와 옆 카드 사이 공간으로 이동 */
    z-index: 20; pointer-events: none;
}
.nav-btn { pointer-events: auto; cursor: pointer; color: #ddd; transition: color 0.3s, transform 0.3s; }
.nav-btn svg { width: 110px; height: 24px; display: block; }
.nav-btn:hover { color: #fff; }
#prev-btn:hover { transform: translateX(-6px); }
#next-btn:hover { transform: translateX(6px); }

/* =========================================
   하단 서브 카피 + 카피라이트
   ========================================= */
.sub-copy {
    position: absolute; bottom: 58px; width: 100%;
    text-align: center; z-index: 100;
    font-family: 'Archivo', 'Pretendard Variable', Arial, sans-serif;
    font-stretch: 125%;
    font-weight: 700;
    font-size: clamp(0.8rem, 1.45vw, 1.35rem);
    line-height: 1.45;
    letter-spacing: 0.3px;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
    padding: 0 20px;
}

.footer-info {
    position: absolute; bottom: 16px; width: 100%; text-align: center;
    z-index: 100; font-family: Arial, sans-serif;
}
.footer-info .copy-text { font-size: 0.7rem; color: rgba(255,255,255,0.3); letter-spacing: 0.5px; }

/* =========================================
   상세 모달 (좌 이미지 고정 / 우 화이트 패널만 스크롤)
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: none; align-items: center; justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal-content {
    background: #111;
    width: min(1380px, 94vw);
    height: 90vh;                  /* 모달 전체 고정 높이 */
    display: flex;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    overflow: hidden;
}
.close-btn {
    position: absolute; top: 24px; right: 28px;
    font-size: 22px; line-height: 1;
    cursor: pointer; color: #333; z-index: 20;
    transition: transform 0.3s, color 0.3s;
}
.close-btn:hover { transform: rotate(90deg); color: #000; }

/* 모달 콘텐츠 컨테이너 — 자체 스크롤 제거, 좌우 분리 컨테이너 역할만 */
.modal-dynamic-area {
    width: 100%;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 0;
}

/* 본문: 좌 이미지(고정) / 우 화이트 패널(스크롤) */
.detail-body {
    display: flex;
    height: 100%;
    align-items: stretch;
    min-height: 0;
}

.detail-visual {
    flex: 0 0 40%;
    background: #161616;
    position: relative;          /* 라벨 절대배치 기준 */
    overflow: hidden;
    height: 100%;                /* 모달 풀 높이로 고정 */
}
.detail-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 좌측 비주얼 우하단 카테고리 라벨 (스크롤과 무관하게 항상 노출) */
.detail-label {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 80px 32px 28px;
    text-align: right;
    font-family: 'Archivo', Arial, sans-serif;
    font-stretch: 125%;
    font-weight: 900;
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* 우측 패널 — 여기서만 스크롤 */
.detail-desc {
    flex: 1;
    min-width: 0;
    background: #fff;
    color: #333;
    padding: 60px 70px 70px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #c9c9c9 #f5f5f5;
}
.detail-desc::-webkit-scrollbar { width: 6px; }
.detail-desc::-webkit-scrollbar-track { background: #f5f5f5; }
.detail-desc::-webkit-scrollbar-thumb { background: #c9c9c9; border-radius: 3px; }
.detail-desc::-webkit-scrollbar-thumb:hover { background: #aaa; }

.detail-desc p {
    font-size: 0.98rem; color: #444; line-height: 1.95;
    margin: 0 0 22px; word-break: keep-all;
}
.detail-desc p:last-child { margin-bottom: 0; }

/* 타이틀 (화이트 패널 안) */
.detail-head { margin-bottom: 38px; }
.detail-eng {
    font-size: 0.78rem; font-weight: 700; letter-spacing: 3px;
    text-transform: uppercase; color: #aaa; margin-bottom: 10px;
    font-family: 'Archivo', Arial, sans-serif; font-stretch: 125%;
}
.detail-kor {
    font-family: 'Archivo', 'Pretendard Variable', Arial, sans-serif;
    font-stretch: 125%;
    font-weight: 900;
    font-size: clamp(1.9rem, 3.6vw, 3.4rem);
    line-height: 1.05;
    color: #111;
}

/* 비즈니스 파트너 (ABOUT) — 화이트 패널 안 */
.partner-area { margin-top: 42px; padding-top: 34px; border-top: 1px solid #ececec; }
.partner-title {
    font-size: 0.8rem; font-weight: 700; letter-spacing: 2px; color: #aaa;
    margin-bottom: 22px;
    font-family: 'Archivo', Arial, sans-serif; font-stretch: 125%;
}
.partner-logos { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.partner-logos img {
    height: 100px; width: auto; max-width: 150px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 10px 18px;
}

/* 썸네일 갤러리 — 화이트 패널 안 */
.detail-gallery {
    background: transparent;
    border-radius: 0;
    padding: 34px 0 0;
    margin-top: 42px;
    border-top: 1px solid #ececec;
    min-width: 0;
}
.gallery-label {
    font-size: 0.8rem; font-weight: 700; letter-spacing: 2px; color: #aaa;
    margin-bottom: 22px;
    font-family: 'Archivo', Arial, sans-serif; font-stretch: 125%;
}
.gallery-swiper { width: 100%; max-width: 100%; overflow: hidden; }
.gallery-item { display: flex; flex-direction: column; }
.gallery-item a { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.gallery-item img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
    border-radius: 4px; border: 1px solid #e5e5e5;
    background: #f5f5f5;
    transition: transform 0.3s, border-color 0.3s;
    display: block;
}
.gallery-item a:hover img { transform: translateY(-4px); border-color: #999; }

.gallery-caption {
    font-size: 0.85rem; color: #333; font-weight: 600;
    margin-top: 12px; line-height: 1.5; word-break: keep-all;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 갤러리 화살표 + 페이지 표기 (5/16) */
.gallery-nav {
    display: flex; align-items: center; justify-content: center; gap: 24px;
    margin-top: 22px;
}
.gallery-prev, .gallery-next {
    cursor: pointer; color: #999; font-size: 1.5rem; line-height: 1;
    transition: color 0.3s; user-select: none; padding: 4px 10px;
}
.gallery-prev:hover, .gallery-next:hover { color: #111; }

.gallery-prev.swiper-button-disabled, .gallery-next.swiper-button-disabled { opacity: 0.25; cursor: default; }
.gallery-fraction {
    font-size: 0.85rem; color: #999; letter-spacing: 2px;
    font-family: 'Archivo', Arial, sans-serif;
    width: auto; min-width: 60px; text-align: center;
}

/* =========================================
   모바일 반응형
   ========================================= */
@media (max-width: 768px) {
    header { padding: 18px 16px 0; }
    .header-bar { flex-direction: column; gap: 12px; margin-top: 16px; }
    .gnb { gap: 16px; flex-wrap: wrap; justify-content: center; }
    .gnb span { font-size: 0.75rem; letter-spacing: 1px; }

    .main-slide { width: 68vw; height: 50vh; transform: scale(0.85); }
    .main-slide.swiper-slide-active { transform: scale(1.05); }
    .card-label { font-size: 1.1rem; padding: 40px 14px 12px; }

    .side-nav { padding: 0 14px; }
    .nav-btn svg { width: 56px; height: 18px; }

    .sub-copy { bottom: 46px; font-size: 0.68rem; line-height: 1.5; }
    .footer-info { bottom: 12px; }
    .footer-info .copy-text { font-size: 0.6rem; }

    /* 모달: 위 비주얼(고정) / 아래 화이트 패널(스크롤) — 세로 스택 */
    .modal-content { width: 94vw; height: 92vh; }
    .modal-dynamic-area { height: 100%; overflow: hidden; padding: 0; }
    .close-btn { top: 14px; right: 16px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
    .close-btn:hover { color: #fff; }

    .detail-body { flex-direction: column; height: 100%; min-height: 0; }
    .detail-visual {
        flex: none;
        width: 100%;
        height: 28vh;
        min-height: 180px;
        max-height: 280px;
    }
    .detail-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .detail-label { padding: 50px 18px 16px; font-size: 1.2rem; }

    .detail-desc {
        flex: 1;
        overflow-y: auto;
        padding: 36px 22px 40px;
    }
    .detail-desc p { font-size: 0.9rem; line-height: 1.8; margin-bottom: 16px; }
    .detail-head { margin-bottom: 24px; }

    .partner-area { margin-top: 30px; padding-top: 26px; }
    .partner-logos { gap: 10px; }
    .partner-logos img { height: 42px; padding: 8px 14px; }
    .detail-gallery { margin-top: 30px; padding: 24px 0 0; }
    .gallery-nav { margin-top: 18px; gap: 16px; }
}