/**
 * 만두 가격비교 - 할인정보 페이지 스타일
 */

/* ========================================
   섹션 헤더
======================================== */

.section-header {
    margin-bottom: 24px;
}

.section-description {
    color: var(--text-gray);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-top: 8px;
    font-weight: 500;
}

/* ========================================
   필터 영역
======================================== */

.discount-filters {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.08);
    border: 2px solid var(--border-light);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0;
}

.filter-group select {
    padding: 11px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.filter-group select:hover {
    border-color: var(--primary-color);
    cursor: pointer;
}

.btn-reset-filter {
    display: inline-block;
    padding: 11px 20px;
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset-filter:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* ========================================
   결과 요약
======================================== */

.discount-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 0;
}

.result-count {
    font-size: 0.875rem;
    color: #666;
    font-weight: 400;
}

.result-count strong {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.9375rem;
}

.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #e8f4ff;
    color: #0066cc;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #d0e8ff;
}

.filter-tag a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 700;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.filter-tag a:hover {
    opacity: 1;
}

/* ========================================
   할인상품 그리드 (가로형 리스트)
======================================== */

.discount-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

/* 모바일에서는 세로형 카드 그리드로 변경 */
@media (max-width: 768px) {
    .discount-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ========================================
   할인 카드 (가로형 레이아웃)
======================================== */

.discount-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: relative;
    cursor: pointer;
}

.discount-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #d0d0d0;
}

/* 전체 카드 클릭 가능하도록 설정 */
.discount-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* 카드 내부의 다른 링크들이 작동하도록 상대적 z-index 설정 */
.discount-card a {
    position: relative;
    z-index: 2;
}

/* 모바일에서는 세로형 카드 */
@media (max-width: 768px) {
    .discount-card {
        flex-direction: column;
    }

    .discount-card:hover {
        transform: translateY(-4px);
    }
}

/* 카드 이미지 (가로형 레이아웃) */
.card-image-link {
    text-decoration: none;
    flex-shrink: 0;
    width: 160px;
    height: 160px;
}

.card-image {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fafafa;
    overflow: hidden;
    border-right: 1px solid #f0f0f0;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.discount-card:hover .card-image img {
    transform: scale(1.05);
}

.card-image .no-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 0.875rem;
    text-align: center;
}

/* 카테고리 아이콘 스타일 */
.card-image .category-icon {
    font-size: 4rem;
    margin-bottom: 8px;
}

/* 모바일에서는 세로형 이미지 */
@media (max-width: 768px) {
    .card-image-link {
        width: 100%;
        height: auto;
        padding-top: 100%; /* 1:1 비율 */
        position: relative;
    }

    .card-image {
        position: absolute;
        top: 0;
        left: 0;
    }
}

/* 할인율 배지 */
.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e53935;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: -0.3px;
}

/* 출처 배지 */
.source-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: -0.2px;
}

/* 카드 내용 (가로형 레이아웃) */
.card-content {
    padding: 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* flex 아이템 텍스트 overflow 방지 */
    justify-content: center;
}

/* 모바일에서는 기존 스타일 */
@media (max-width: 768px) {
    .card-content {
        padding: 14px;
        gap: 6px;
    }
}

/* 카테고리 */
.card-category {
    font-size: 0.75rem;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* 상품명 */
.card-title {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 600;
    color: #1a1a1a;
}

.card-title a {
    color: inherit;
    text-decoration: none;
}

.card-title a:hover {
    color: #0066cc;
}

/* 모바일에서는 작은 폰트 */
@media (max-width: 768px) {
    .card-title {
        font-size: 0.875rem;
        font-weight: 500;
    }
}

/* 가격 (가로형 레이아웃) */
.card-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 2px;
}

.sale-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e53935;
    letter-spacing: -0.3px;
}

.original-price {
    font-size: 0.875rem;
    color: #aaa;
    text-decoration: line-through;
    font-weight: 400;
}

/* 모바일에서는 세로 배치 */
@media (max-width: 768px) {
    .card-price {
        flex-direction: column;
        gap: 4px;
    }

    .sale-price {
        font-size: 1.25rem;
    }

    .original-price {
        font-size: 0.875rem;
    }
}

/* 배지 */
.card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    font-size: 0.6875rem;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.badge-rocket {
    background: #e53935;
    color: white;
}

.badge-free {
    background: #1e88e5;
    color: white;
}

/* 평점 */
.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.rating-stars {
    color: #ff9500;
    font-weight: 600;
}

.rating-count {
    color: #999;
    font-weight: 400;
}

/* 메타 정보 */
.card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.6875rem;
    color: #bbb;
    padding-top: 8px;
    margin-top: auto;
    border-top: 1px solid #f5f5f5;
}

/* ========================================
   빈 상태
======================================== */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 8px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    color: #666;
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color, #007bff);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
}

.btn-primary:hover {
    background: #0056b3;
}

/* ========================================
   페이지네이션
======================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.page-btn,
.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.page-btn:hover,
.page-num:hover {
    border-color: var(--primary-color, #007bff);
    color: var(--primary-color, #007bff);
}

.page-num.active {
    background: var(--primary-color, #007bff);
    border-color: var(--primary-color, #007bff);
    color: white;
    font-weight: 600;
}

.page-dots {
    padding: 0 8px;
    color: #999;
}

/* ========================================
   모바일 최적화
======================================== */

@media (max-width: 768px) {
    .discount-filters {
        padding: 15px;
    }

    .filter-form {
        gap: 10px;
    }

    .filter-group {
        flex: 1 1 calc(50% - 5px);
        min-width: 120px;
    }

    .filter-group select {
        min-width: auto;
        width: 100%;
    }

    .discount-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .discount-grid {
        gap: 15px;
    }

    .card-content {
        padding: 12px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .page-btn,
    .page-num {
        min-width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
}

/* ========================================
   구매 정보 섹션
======================================== */

.purchase-info-section {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    margin-top: 20px;
}

.info-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.info-card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
}

.info-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e8e8e8;
}

.info-card-content {
    padding: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row:first-child {
    padding-top: 0;
}

.info-label {
    font-size: 0.8125rem;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 0.8125rem;
    color: #1a1a1a;
    font-weight: 600;
}

.info-value.highlight {
    color: #e53935;
    font-size: 0.9375rem;
    font-weight: 700;
}

.info-value.discount {
    color: #e53935;
    font-weight: 700;
}

.info-value.save {
    color: #1e88e5;
    font-weight: 700;
}

.info-value.urgent {
    color: #ff6f00;
    font-weight: 700;
}

@media (max-width: 768px) {
    .purchase-info-section {
        padding: 16px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .info-card-title {
        font-size: 0.8125rem;
        padding: 10px 14px;
    }

    .info-card-content {
        padding: 12px;
    }

    .info-row {
        padding: 6px 0;
    }

    .info-label,
    .info-value {
        font-size: 0.75rem;
    }

    .info-value.highlight {
        font-size: 0.875rem;
    }
}

/* ========================================
   다크모드 지원 (선택사항)
======================================== */

@media (prefers-color-scheme: dark) {
    .discount-filters,
    .discount-card,
    .empty-state {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .filter-group label,
    .card-category,
    .card-meta {
        color: #aaa;
    }

    .filter-group select {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }

    .card-title a {
        color: #e0e0e0;
    }

    .page-btn,
    .page-num {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
}

/* ========================================
   할인 상세 페이지
======================================== */

.discount-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 32px;
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    margin-bottom: 20px;
}

/* 상품 이미지 */
.detail-image {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.detail-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #eee;
}

.detail-image .no-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1.2rem;
}

/* 상품 정보 */
.detail-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.discount-badge-large {
    display: inline-block;
    background: #e53935;
    color: white;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    width: fit-content;
    letter-spacing: -0.3px;
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0;
    letter-spacing: -0.3px;
}

.detail-source {
    display: flex;
    gap: 10px;
}

.source-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
}

.source-badge.shopping {
    background: #e8e8e8;
    color: #1a1a1a;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
}

/* 배송/평점 정보 */
.detail-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.detail-badges .badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 3px;
    font-weight: 600;
}

.detail-badges .badge-rocket {
    background: #e53935;
    color: white;
}

.detail-badges .badge-free {
    background: #1e88e5;
    color: white;
}

.detail-badges .badge-rating {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

/* 가격 정보 */
.detail-price {
    background: #fafafa;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.price-original {
    font-size: 0.8125rem;
    color: #999;
    margin-bottom: 6px;
}

.price-original del {
    text-decoration: line-through;
}

.price-sale {
    font-size: 1.75rem;
    font-weight: 700;
    color: #e53935;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.price-save {
    font-size: 0.9375rem;
    color: #1e88e5;
    font-weight: 600;
}

/* 상품 설명 */
.detail-description {
    padding: 16px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-description h3 {
    font-size: 0.9375rem;
    margin-bottom: 10px;
    color: #1a1a1a;
    font-weight: 700;
}

.detail-description p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #666;
}

/* 할인 종료일 */
.detail-enddate {
    background: #fff8e1;
    border: 1px solid #ffe082;
    padding: 12px;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.days-left {
    color: #ff6b6b;
    font-weight: 600;
    margin-left: 8px;
}

/* 메타 정보 */
.detail-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: #bbb;
    padding: 12px 0;
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 액션 버튼 */
.detail-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
}

.btn-buy {
    flex: 1;
    display: inline-block;
    padding: 12px 24px;
    background: #1e88e5;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-buy:hover {
    background: #1976d2;
}

.btn-back {
    padding: 12px 24px;
    background: white;
    color: #666;
    text-decoration: none;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-back:hover {
    border-color: #999;
    color: #333;
}

/* 관련 상품 */
.related-products {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.related-products h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* 반응형 */
@media (max-width: 1024px) {
    .detail-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .detail-image {
        position: relative;
        top: 0;
        max-width: 500px;
        margin: 0 auto;
    }

    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .detail-title {
        font-size: 1.4rem;
    }

    .price-sale {
        font-size: 2rem;
    }

    .detail-actions {
        flex-direction: column;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .discount-detail-container {
        padding: 10px;
    }

    .detail-content {
        padding: 20px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}
