/* ================================
   CSS Variables (Modern Design System)
   ================================ */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    --text-dark: #1e293b;
    --text-light: #64748b;
    --text-white: #ffffff;
    
    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.15);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   Reset & Base
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================
   Background Effects
   ================================ */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    opacity: 0.15;
    z-index: -2;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(252, 70, 107, 0.3) 0%, transparent 50%);
    z-index: -1;
}

/* ================================
   Glassmorphism
   ================================ */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow);
}

.glass-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ================================
   Header
   ================================ */
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.logo h1 {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ================================
   Hero Section
   ================================ */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero-title {
    font-size: 56px;
    font-weight: 900;
    margin-bottom: 16px;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 48px;
}

/* ================================
   Search Box
   ================================ */
.search-box {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px;
    border-radius: var(--radius-lg);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.search-input-wrapper:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.search-icon {
    font-size: 24px;
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-dark);
}

#searchInput::placeholder {
    color: var(--text-light);
}

.btn-search {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.4);
}

.btn-search:active {
    transform: translateY(0);
}

/* Quick Tags */
.quick-tags {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.tag:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* ================================
   Loading
   ================================ */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* ================================
   Results Section
   ================================ */
.results-section {
    padding: 40px 0 80px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.results-header h3 {
    font-size: 32px;
    font-weight: 800;
}

.filters {
    display: flex;
    gap: 12px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    background: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

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

/* Lowest Price Card */
.lowest-card {
    padding: 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border: 2px solid rgba(99, 102, 241, 0.3);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 280px);
    gap: 24px;
    justify-content: center;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
}

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

.product-card img,
.product-image {
    width: 100%;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    object-fit: contain;
    object-position: center;
    background: #fafafa;
    padding: 15px;
    box-sizing: border-box;
}

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-mall {
    display: inline-block;
    width: fit-content;
    padding: 4px 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 8px;
    line-height: 1.2;
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 8px;
}

.product-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-rocket {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
}

.badge-discount {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.badge-shipping {
    background: #e0e7ff;
    color: var(--primary);
}

/* ================================
   Deals Section
   ================================ */
.deals-section {
    padding: 60px 0;
    background: rgba(255, 255, 255, 0.5);
}

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

.section-header h3 {
    font-size: 32px;
    font-weight: 800;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.view-all:hover {
    transform: translateX(4px);
}

.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.deal-card {
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    position: relative;
}

.deal-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.deal-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
}

.deal-card h4 {
    font-size: 14px;
    margin-bottom: 8px;
}

.deal-price {
    font-size: 20px;
    font-weight: 900;
    color: var(--primary);
}

/* ================================
   Footer
   ================================ */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer p {
    opacity: 0.7;
    font-size: 14px;
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .nav-links {
        gap: 16px;
    }
    
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .btn-search {
        width: 100%;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        flex: 1;
    }
}

/* ================================
   Pagination
   ================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.page-btn {
    padding: 10px 16px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 44px;
}

.page-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

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

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-count {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin-top: 10px;
}

/* ================================
   Category Tags
   ================================ */
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.category-tag {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.category-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.category-tag.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}


/* ================================
   Goldbox Section
   ================================ */
.goldbox-section {
    padding: 80px 0;
    background: rgba(255, 255, 255, 0.02);
}

.deal-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}


/* ================================
   Responsive - 작은 화면
   ================================ */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .product-card {
        width: 100%;
        min-width: unset;
        max-width: 320px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 280px);
    }
}

@media (min-width: 1025px) and (max-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(3, 280px);
    }
}

@media (min-width: 1401px) {
    .products-grid {
        grid-template-columns: repeat(4, 280px);
    }
}
