/* 리셋 및 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #1c1c1e;
    color: #ffffff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* PC용 페이지 */
#pc-page {
    display: none;
}

.pc-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    padding: 20px;
}

.pc-container h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #ff6f0f;
}

.pc-container p {
    font-size: 1.2rem;
    color: #999;
    margin: 10px 0;
}

/* 모바일/태블릿용 페이지 */
#mobile-page {
    display: block;
    min-height: 100vh;
    padding-bottom: 70px;
}

/* 상단바 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #1c1c1e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    font-weight: 600;
}

.location {
    color: #ffffff;
}

.dropdown-arrow {
    font-size: 12px;
    color: #ffffff;
}

.header-right {
    display: flex;
    gap: 8px;
}

.header-icon {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.header-icon:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-icon .material-symbols-outlined {
    font-size: 24px;
}

/* 카테고리 필터 */
.category-filter {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background-color: #1c1c1e;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    z-index: 999;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #3a3a3c;
    background-color: #2c2c2e;
    color: #aaaaaa;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    flex-shrink: 0;
}

.category-btn.active {
    background-color: #ffffff;
    color: #1c1c1e;
    border-color: #ffffff;
    font-weight: 600;
}

.category-btn:not(.active):active {
    background-color: #3a3a3c;
}

/* 메인 컨텐츠 */
.main-content {
    margin-top: 120px;
    padding: 0;
    min-height: calc(100vh - 190px);
}

.product-list {
    display: flex;
    flex-direction: column;
}

/* 상품 아이템 */
.product-item {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.product-item:active {
    background-color: rgba(255, 255, 255, 0.05);
}

.product-image {
    width: 110px;
    height: 110px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #2c2c2e;
}

.product-info {
    flex: 1;
    margin-left: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 4px;
}

.product-title {
    font-size: 16px;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-location {
    font-size: 13px;
    color: #8e8e93;
    margin-bottom: 6px;
}

.product-price {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-top: auto;
}

.product-meta {
    position: absolute;
    bottom: 16px;
    right: 16px;
}

.product-stats {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 2px;
    color: #8e8e93;
    font-size: 13px;
}

.stat-item .icon-chat,
.stat-item .icon-heart,
.stat-item .icon-people {
    font-size: 14px;
    filter: grayscale(100%);
    opacity: 0.7;
}

.more-btn {
    position: absolute;
    top: 16px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: #8e8e93;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
}

.more-btn:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.more-btn .material-symbols-outlined {
    font-size: 20px;
}

/* 플로팅 버튼 */
.floating-btn {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: auto;
    min-width: 56px;
    height: 56px;
    padding: 0 20px;
    background-color: #ff6f0f;
    border: none;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 111, 15, 0.4);
    z-index: 998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-btn:active {
    transform: scale(0.95);
}

.plus-icon {
    font-size: 24px;
    line-height: 1;
    font-weight: 300;
}

.btn-text {
    font-size: 15px;
    font-weight: 600;
}

/* 하단 네비게이션 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #1c1c1e;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 0 8px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: #8e8e93;
    transition: color 0.2s;
    cursor: pointer;
    padding: 8px 0;
}

.nav-item.active {
    color: #ffffff;
}

.nav-item:active:not(.active) {
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item .material-symbols-outlined {
    font-size: 24px;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 10px;
    font-weight: 500;
}

/* 반응형 디자인 */
@media screen and (max-width: 768px) {
    /* 모바일 최적화 */
    .product-image {
        width: 100px;
        height: 100px;
    }

    .product-title {
        font-size: 15px;
    }

    .product-price {
        font-size: 15px;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* 태블릿 최적화 */
    .main-content {
        max-width: 768px;
        margin-left: auto;
        margin-right: auto;
    }

    .product-image {
        width: 120px;
        height: 120px;
    }
}

/* PC에서 접속시 - 반응형 적용 */
@media screen and (min-width: 1025px) {
    #pc-page {
        display: none;
    }

    #mobile-page {
        display: block;
        max-width: 600px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        position: relative;
        min-height: 100vh;
        background-color: #1c1c1e;
    }

    .header {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
    }

    .category-filter {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
    }

    .main-content {
        max-width: 600px;
        margin: 120px auto 0;
    }

    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
    }

    .floating-btn {
        right: calc(50% - 280px);
    }

    .product-image {
        width: 120px;
        height: 120px;
    }

    .product-title {
        font-size: 16px;
    }

    .product-price {
        font-size: 16px;
    }

    body {
        background-color: #0a0a0a;
    }
}

/* iOS 안전영역 대응 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(56px + env(safe-area-inset-bottom));
    }

    .floating-btn {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }

    #mobile-page {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}