/* 홈(main_dashboard.html)만 쓰는 스타일: 히어로와 검색 상자, 모바일 홈(할인·바로가기·인기 상품·쿠폰 배너),
 * 핫딜 격자, 보기 전환(격자·목록)과 목록 보기. base.css 다음에 싣는다. */

.mobile-home-shell {
    display: none;
}

/* Hero Section */
.hero-section {
    padding: 48px 0;
    background: var(--bg-primary);
    margin-bottom: 48px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    display: block;
    font-size: 20px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Search Container */
.search-container {
    margin: 32px 0;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.section-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.section-link:hover {
    gap: 8px;
}

.mobile-home-section {
    margin-bottom: 24px;
}

.mobile-home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.mobile-home-section-header h2 {
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1.3;
}

.mobile-home-section-link {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.mobile-featured-deals {
    display: grid;
    gap: 12px;
}

.mobile-featured-card,
.mobile-trending-card,
.mobile-shortcut-card {
    color: inherit;
    text-decoration: none;
}

.mobile-featured-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.mobile-featured-image,
.mobile-trending-image {
    background: #FFFFFF;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mobile-featured-image {
    height: 104px;
}

.mobile-featured-image img,
.mobile-trending-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.mobile-featured-content,
.mobile-trending-content {
    min-width: 0;
}

.mobile-featured-discount {
    display: inline-flex;
    margin-bottom: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-color);
    font-size: 12px;
    font-weight: 800;
}

.mobile-featured-content h3,
.mobile-trending-content h3 {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mobile-featured-content p,
.mobile-trending-content p {
    margin-top: 8px;
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 800;
}

.mobile-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.mobile-shortcut-card {
    min-height: 44px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.mobile-trending-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mobile-trending-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.mobile-trending-image {
    height: 132px;
}

.mobile-trending-content {
    padding: 10px;
}

/* Hot Deals Grid */
.hot-deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* View Options */
.view-options {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.view-option {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.view-option:hover {
    background: var(--bg-secondary);
}

.view-option.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* List View */
.products-grid.list-view {
    grid-template-columns: 1fr;
    gap: 8px;
}

.products-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    align-items: center; /* 수직 중앙 정렬 */
    height: auto;
    min-height: 88px;
}

.products-grid.list-view .product-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    display: flex; /* 컨테이너 자체를 중앙 정렬 */
    align-items: center; /* 수직 중앙 */
    justify-content: center; /* 수평 중앙 */
    padding: 8px; /* 내부 패딩은 컨테이너에 주고, 이미지는 패딩 제거 */
}

.products-grid.list-view .product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 12px;
    gap: 2px;
    min-width: 0;
}

/* 리스트뷰에서는 그리드용 상단 보더 숨김 */
.products-grid.list-view .product-content::before {
    display: none;
}

.products-grid.list-view .product-name {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    margin-bottom: 2px;
    font-size: 14px;
}

/* 리스트뷰 이미지가 좌우로 치우치지 않도록 이미지 패딩 제거 및 최대 크기 제약 */
.products-grid.list-view .product-image img {
    padding: 0 !important;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.products-grid.list-view .product-variant {
    font-size: 12px;
    margin: 0 0 4px 0;
}

.products-grid.list-view .product-brand {
    font-size: 11px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.products-grid.list-view .stock-status {
    font-size: 11px;
    padding: 2px 8px;
}

.products-grid.list-view .sale-badge{
    top: 4px;
    right: 4px;
    width: 48px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 36px;
    }

    .hot-deals-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .mobile-home-shell {
        display: block;
        padding-bottom: 8px;
    }

    .hero-section {
        padding: 32px 0;
        margin-bottom: 32px;
    }

    .hero-section .search-container {
        display: none;
    }

    .hero-content {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    body[data-page="home"] .all-products-section {
        display: none;
    }
}
.mobile-coupon-promo { display: grid; grid-template-columns: 56px minmax(0, 1fr) 24px; align-items: center; gap: 12px; padding: 14px; border: 1px solid rgba(255, 107, 53, 0.22); border-radius: 8px; background: rgba(255, 107, 53, 0.08); color: inherit; text-decoration: none; }
.mobile-coupon-promo-image { width: 56px; height: 56px; }
.mobile-coupon-promo-image img { width: 100%; height: 100%; object-fit: contain; }
.mobile-coupon-promo-copy { min-width: 0; }
.mobile-coupon-promo-copy strong,
.mobile-coupon-promo-copy span { display: block; }
.mobile-coupon-promo-copy strong { color: var(--text-primary); font-size: 15px; }
.mobile-coupon-promo-copy span { margin-top: 4px; color: var(--text-secondary); font-size: 13px; }
.mobile-coupon-promo-arrow { color: var(--primary-color); }

@media (max-width: 480px) {
    .hot-deals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
