/*
* 파일명: style.css
* 경로: /assets/css/
* 기능: 컴페어 메인 스타일시트 (그린 테마 통합)
* 작성일: 2025-10-05
* 수정일: 2025-10-08
*/

/* ===================================
* CSS 변수 정의 (그린 테마)
* =================================== */
:root {
    /* 메인 컬러 */
    --primary-dark: #2C5F2D;
    --primary-light: #97BC62;
    --primary-hover: #234a24;
    --primary-soft: #b8d89e;
    
    /* 배경 컬러 */
    --bg-primary: #f5f9f3;
    --bg-secondary: #ffffff;
    --bg-gradient-start: #2C5F2D;
    --bg-gradient-end: #97BC62;
    
    /* 텍스트 컬러 */
    --text-primary: #1a3a1b;
    --text-secondary: #4a6b4d;
    --text-muted: #7a9b7d;
    --text-white: #ffffff;
    
    /* 강조 컬러 */
    --accent-color: #97BC62;
    --accent-hover: #7da350;
    --favorite-color: #d4af37;
    --hot-color: #e85d75;
    --notice-bg: #e8f5e9;
    --notice-border: #81c784;
    --notice-text: #2e7d32;
    
    /* 보더 & 그림자 */
    --border-color: #d4e5ce;
    --shadow-sm: 0 2px 4px rgba(44, 95, 45, 0.08);
    --shadow-md: 0 4px 6px rgba(44, 95, 45, 0.12);
    --shadow-lg: 0 10px 15px rgba(44, 95, 45, 0.15);
    
    /* 반경 & 전환 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
* 기본 스타일 설정
* =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* ===================================
* 레이아웃
* =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
* 헤더 (고정)
* =================================== */
.main-header {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    box-shadow: var(--shadow-md);
}

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-spacer {
    height: 190px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 30px;
}

.header-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
}

.header-logo:hover {
    color: var(--text-white);
    opacity: 0.9;
}

/* 검색창 */
.search-container {
    flex: 1;
    max-width: 600px;
}

.search-form {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    font-size: 15px;
    outline: none;
}

.search-button {
    padding: 12px 24px;
    background: var(--primary-dark);
    color: var(--text-white);
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.search-button:hover {
    background: var(--primary-hover);
}

/* 카테고리 네비게이션 */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 0;
}

.category-item {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.category-item:hover,
.category-item.active {
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-white);
}

/* ===================================
* 가격 안내 배너 (그린 테마)
* =================================== */
.price-notice-compact {
    background: linear-gradient(135deg, var(--notice-bg), #f1f8e9);
    border-left: 4px solid var(--notice-border);
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    color: var(--notice-text);
    box-shadow: var(--shadow-sm);
}

.notice-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.notice-item:last-child {
    margin-bottom: 0;
}

.notice-item i {
    font-size: 18px;
    color: var(--primary-light);
    flex-shrink: 0;
    margin-top: 0;
    line-height: 1.6;
}

.notice-item strong {
    color: var(--primary-dark);
    font-weight: 700;
}

/* ===================================
* 핫딜 섹션
* =================================== */
.hot-deals-section {
    margin: 10px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fff5f8, #ffe8ef);
    border-radius: var(--radius-lg);
    border: 2px solid var(--hot-color);
    box-shadow: var(--shadow-md);
}

.hot-deals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.hot-deal-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
}

.hot-deal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--hot-color);
}

.hot-deal-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.hot-deal-info {
    padding: 15px;
}

.hot-deal-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-deal-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.hot-deal-badge {
    display: inline-block;
    background: var(--hot-color);
    color: var(--text-white);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    margin-left: 5px;
}

/* ===================================
* 섹션 스타일
* =================================== */
.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.section-title-highlight {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-white);
    padding: 5px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 500;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sort-options {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 5px 0;
}

.sort-options::-webkit-scrollbar {
    height: 4px;
}

.sort-options::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.sort-options::-webkit-scrollbar-track {
    background: transparent;
}

.sort-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sort-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.sort-btn.active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--text-white);
}

.search-info {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* ===================================
* 상품 목록
* =================================== */
.products-section {
    margin: 40px 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 10px 0;
}

.product-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* 상단 정보 바 (이미지 밖) */
.product-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #2C5F2D;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.product-top-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* NEW 배지 */
.new-badge {
    background: var(--hot-color);
    color: var(--text-white);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* 조회수 */
.product-view-count {
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.product-view-count i {
    font-size: 14px;
}

/* 카테고리 */
.product-category-badge {
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-category-badge i {
    font-size: 12px;
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-image-placeholder {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-placeholder i {
    font-size: 48px;
    color: var(--text-muted);
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 48px;
}

.product-name a {
    color: var(--text-primary);
}

.product-name a:hover {
    color: var(--primary-dark);
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.price-from {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-right: 6px;
    vertical-align: middle;
}

.discount-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--text-white);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    margin-left: 8px;
}

.product-original-price {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-bottom: 12px;
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

/* ===================================
* 버튼 스타일
* =================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-small {
    padding: 10px 16px;
    font-size: 14px;
    flex: 1;
}

.btn-primary {
    background: var(--primary-dark);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    color: var(--text-white);
}

.btn-secondary {
    background: var(--primary-light);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: var(--accent-hover);
    color: var(--text-white);
}

/* ===================================
* 빈 상태
* =================================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin: 40px 0;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-muted);
}

/* ===================================
* 푸터
* =================================== */
.main-footer {
    background: var(--primary-dark);
    color: var(--text-white);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
}

.footer-disclaimer {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
}

/* ===================================
* 반응형 디자인
* =================================== */

/* 태블릿 (1024px 이하) */
@media (max-width: 1024px) {
    .product-grid,
    .hot-deals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 태블릿 & 모바일 (768px 이하) */
@media (max-width: 768px) {
    .fixed-header {
        position: relative;
    }
    
    .header-spacer {
        display: none;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-container {
        width: 100%;
        max-width: none;
    }
    
    .product-grid,
    .hot-deals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .sort-options {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }
    
    .sort-btn {
        white-space: nowrap;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .search-info {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        gap: 15px;
    }
    
    .price-notice-compact {
        padding: 12px 15px;
    }
    
    .notice-item {
        font-size: 13px;
        gap: 10px;
        margin-bottom: 8px;
    }
    
    .notice-item i {
        font-size: 16px;
    }
    
    .section-title-highlight {
        font-size: 24px;
        padding: 12px 20px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
}

/* 모바일 (480px 이하) */
@media (max-width: 480px) {
    .header-logo {
        font-size: 24px;
    }
    
    .category-nav {
        padding-bottom: 5px;
    }
    
    .category-item {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hot-deals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .hot-deals-section {
        padding: 20px;
    }
    
    .product-name {
        font-size: 15px;
        min-height: 45px;
    }
    
    .product-price {
        font-size: 20px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .hot-deal-image {
        height: 120px;
    }
    
    .hot-deal-name {
        font-size: 13px;
    }
    
    .hot-deal-price {
        font-size: 16px;
    }
    
    .hot-deal-info {
        padding: 12px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .sort-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .empty-state {
        padding: 60px 15px;
    }
    
    .empty-state i {
        font-size: 48px;
    }
    
    .empty-state h3 {
        font-size: 20px;
    }
    
    .main-footer {
        padding: 30px 0;
        margin-top: 60px;
    }
    
    .footer-disclaimer {
        font-size: 13px;
    }
    
    .price-notice-compact {
        padding: 10px 12px;
    }
    
    .notice-item {
        font-size: 12px;
        gap: 8px;
        line-height: 1.5;
        margin-bottom: 8px;
    }
    
    .notice-item i {
        font-size: 15px;
    }
    
    .section-title-highlight {
        font-size: 20px;
        padding: 10px 15px;
    }
    
    .section-subtitle {
        font-size: 13px;
        margin-top: 8px;
    }
    
    .price-from {
        font-size: 12px;
        padding: 2px 6px;
        margin-right: 4px;
    }
    
    .discount-badge {
        font-size: 12px;
        padding: 3px 6px;
    }
}