@charset "utf-8";

/* =========================================
   1. 기본 레이아웃 & PC 배경 설정
   ========================================= */
body {
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    margin: 0; padding: 0;
    background-color: #222; /* PC 배경: 다크 그레이 */
    color: #333;
    /* 화면 정중앙 정렬 */
    display: flex; justify-content: center; align-items: center;
    height: 100vh;
    overflow: hidden; /* 바깥 스크롤 방지 */
}

/* =========================================
   2. 아이폰 프레임 (Phone Frame) - 컨테이너
   ========================================= */
#app {
    width: 375px;  /* 아이폰 X/11/12 기준 너비 */
    height: 812px; /* 아이폰 세로 높이 */
    background: #fff;
    
    /* 외관 스타일 */
    border-radius: 40px; /* 둥근 모서리 */
    box-shadow: 0 0 60px rgba(0,0,0,0.6); /* 외부 그림자 */
    
    position: relative;
    overflow: hidden; /* 내용이 둥근 모서리 밖으로 나가는 것 방지 */
    transform: translateZ(0); /* GPU 가속 (렌더링 최적화) */
}

/* -----------------------------------------
   [핵심] 테두리 오버레이 (Overlay Frame)
   컨텐츠가 테두리를 덮지 못하도록 '액자'를 맨 위에 씌움
   ----------------------------------------- */
#app::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    
    /* 실제 검은 테두리 */
    border: 12px solid #111; 
    border-radius: 40px; /* 부모와 동일한 곡률 */
    
    z-index: 9998; /* 컨텐츠(999)보다 높게 설정 */
    pointer-events: none; /* [중요] 마우스 클릭은 통과시켜서 안쪽 버튼 작동 가능하게 함 */
}

/* -----------------------------------------
   상단 노치 (Notch) - M자 탈모 디자인
   ----------------------------------------- */
#app::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 150px; height: 30px;
    background: #111;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 9999; /* 테두리보다 더 위에 */
    pointer-events: none;
}

/* =========================================
   3. 모바일 기기 접속 시 (반응형)
   프레임 제거하고 전체 화면으로 확장
   ========================================= */
@media (max-width: 500px) {
    body {
        background-color: #fff;
        height: auto;
        display: block;
        overflow: auto; /* 기본 스크롤 복원 */
    }
    #app {
        width: 100%; height: auto; min-height: 100vh;
        border-radius: 0; box-shadow: none; border: none;
        overflow: visible;
    }
    #app::before { display: none; } /* 노치 제거 */
    #app::after { display: none; }  /* 테두리 제거 */
}

/* =========================================
   4. 내부 스크롤 영역 (App Scroll)
   ========================================= */
.scroll-container {
    height: 100%;
    overflow-y: auto; /* 세로 스크롤 */
    padding-top: 50px; /* 노치 영역 여백 */
    padding-bottom: 80px; /* 하단 여백 */
    box-sizing: border-box;
    width: 100%;
    
    /* 스크롤바 숨기기 */
    -ms-overflow-style: none; scrollbar-width: none;
}
.scroll-container::-webkit-scrollbar { display: none; }


/* =========================================
   5. 컨텐츠 스타일 (Header, Title)
   ========================================= */
header { text-align: center; margin-bottom: 20px; padding-top: 10px; }
.logo {
    font-family: 'Arial', sans-serif; font-weight: 900;
    font-size: 2rem; margin: 0; letter-spacing: -1px;
}
.logo span { color: #0056b3; }
header p { color: #666; font-size: 0.8rem; margin-top: 5px; }

.section-title {
    font-weight: bold; margin: 20px 20px 10px;
    border-left: 5px solid #0056b3; padding-left: 10px;
    font-size: 1.1rem;
}

/* =========================================
   6. 제품 슬라이더 (Drag & Swipe)
   ========================================= */
.product-slider {
    display: flex;
    gap: 15px;
    /* 왼쪽 패딩만 주고 오른쪽은 ::after로 처리 */
    padding: 10px 0 20px 20px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    cursor: grab; /* 손바닥 커서 */
    scroll-snap-type: x mandatory; /* 스냅 효과 */
    
    /* 스크롤바 숨김 */
    -ms-overflow-style: none; scrollbar-width: none;
}
.product-slider::-webkit-scrollbar { display: none; }
.product-slider:active { cursor: grabbing; /* 주먹 쥔 커서 */ }

/* 슬라이더 맨 끝 여백 공간 (잘림 방지) */
.product-slider::after {
    content: '';
    flex: 0 0 20px; /* 우측 여백 20px 확보 */
    height: 1px;
}

/* 카드 스타일 */
.product-card {
    flex: 0 0 240px; /* 카드 고정 너비 */
    scroll-snap-align: center; /* 스크롤 시 중앙 정렬 */
    border: 1px solid #eee; border-radius: 12px;
    background: #fff; overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
    user-select: none; /* 드래그 시 텍스트 선택 방지 */
}

.img-box { height: 150px; background: #eee; position: relative; pointer-events: none; }
.img-box img { width: 100%; height: 100%; object-fit: cover; }
.badge {
    position: absolute; top: 10px; left: 10px;
    background: #28a745; color: white;
    padding: 4px 8px; font-size: 11px; border-radius: 4px;
}
.badge.sold { background: #666; }

.info-box { padding: 15px; pointer-events: none; }
.info-box h3 {
    margin: 0 0 5px; font-size: 1rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meta { font-size: 0.8rem; color: #888; }
.price { color: #0056b3; font-weight: bold; font-size: 1rem; margin-top: 8px; }


/* =========================================
   7. UI 요소 (FAB, Modal, Form)
   ========================================= */

/* 플로팅 버튼 (Floating Action Button) */
.fab-btn {
    position: absolute;
    bottom: 25px; right: 25px;
    background-color: #0056b3; color: white;
    width: 55px; height: 55px; border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer; z-index: 100; font-size: 24px;
    display: flex; align-items: center; justify-content: center;
}

/* 모달 백그라운드 */
.modal-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 900; /* 테두리(9998)보다는 아래에 있어야 함 */
    display: flex; justify-content: center; align-items: center;
    border-radius: 40px; /* 프레임 곡률 맞춤 */
    overflow: hidden;
}

/* 모달 컨텐츠 */
.modal-content {
    background: #fff; width: 85%; max-height: 80%;
    border-radius: 15px; overflow-y: auto; position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
}
.modal-content::-webkit-scrollbar { display: none; }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.close-btn {
    position: absolute; top: 15px; right: 15px;
    font-size: 24px; cursor: pointer; z-index: 10;
    background: rgba(255,255,255,0.8);
    border-radius: 50%; width: 30px; height: 30px;
    text-align: center; line-height: 30px;
}

/* 제품 상세 모달 */
.modal-body img { width: 100%; height: 200px; object-fit: cover; }
.modal-info { padding: 20px; }
.specs-box {
    background: #f9f9f9; padding: 15px;
    border-radius: 8px; margin: 15px 0;
    font-size: 0.9rem; white-space: pre-line; color: #555;
}
.modal-btn {
    width: 100%; padding: 12px; background: #0056b3; color: white;
    border: none; border-radius: 8px; font-size: 1rem;
    cursor: pointer; font-weight: bold; margin-top: 10px;
}

/* 문의 폼 모달 */
.inquiry-modal-body { padding: 30px 20px; }
.inquiry-title {
    text-align: center; font-size: 1.3rem;
    font-weight: bold; margin-bottom: 20px; color: #0056b3;
}
.form-group { margin-bottom: 10px; }
input, textarea {
    width: 100%; padding: 10px;
    border: 1px solid #ddd; border-radius: 6px;
    box-sizing: border-box; font-family: inherit; font-size: 16px;
}
.submit-btn {
    width: 100%; padding: 12px; background: #333; color: white;
    border: none; border-radius: 8px; font-size: 1rem;
    cursor: pointer; font-weight: bold; margin-top: 10px;
}
.submit-btn:disabled { background: #ccc; }