﻿
/* ==================================================
   SafeGG - AI 급매·특가 브리핑
   ================================================== */

/* --------------------------------------------------
   01. 전체 페이지 및 제목
   -------------------------------------------------- */

.deals-page {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 18px 16px 60px;
    color: #351820;
    box-sizing: border-box;
}

.deals-header {
    margin-bottom: 20px;
}

.deals-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 7px;
}

.deals-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: #32131c;
}

.deals-header p {
    margin: 0;
    font-size: 16px;
    color: #65545a;
}

/* 이용 가이드 열기 버튼 */

.deals-guide-open {
    padding: 8px 13px;
    border: 1px solid #b51f3e;
    border-radius: 7px;
    background: #fff7f8;
    color: #9b1e39;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

    .deals-guide-open:hover {
        background: #fae5e9;
    }


/* --------------------------------------------------
   02. 상단 분석 요약
   -------------------------------------------------- */

.deals-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #ecd4d5;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(70, 20, 30, 0.04);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 15px 18px;
}

    .summary-item:not(:last-child) {
        border-right: 1px solid #eddcdd;
    }

.summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #faedda;
    color: #d6a24d;
    font-size: 20px;
}

.summary-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 15px;
    line-height: 1.3;
    color: #49333a;
}

.summary-item strong {
    margin-left: auto;
    color: #b51f3e;
    font-size: 23px;
    white-space: nowrap;
}


/* --------------------------------------------------
   03. 게임 / 카테고리 / 서버 / 정렬 필터
   -------------------------------------------------- */

.deals-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.deals-filters label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 37px;
    padding: 0 10px;
    background: #fffafb;
    border: 1px solid #ecd6d8;
    border-radius: 8px;
}

    .deals-filters label > span {
        color: #76666b;
        font-size: 16px;
    }

.deals-filters select {
    min-width: 0;
    padding: 8px 3px;
    background: transparent;
    border: none;
    outline: none;
    color: #382129;
    font-size: 15px;
    cursor: pointer;
}

.sort-group {
    margin-left: auto;
}


/* --------------------------------------------------
   04. 추천 상품 목록 제목
   -------------------------------------------------- */

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

    .section-heading h3 {
        margin: 0;
        font-size: 22px;
        font-weight: 800;
        color: #32131c;
    }

    .section-heading > span {
        color: #75636a;
        font-size: 14px;
        text-align: right;
    }


/* --------------------------------------------------
   05. 상품 목록 및 카드 전체
   -------------------------------------------------- */

.deals-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.deal-card {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr) minmax(240px, 0.95fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 112px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #eed8da;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(65, 20, 30, 0.04);
}


/* --------------------------------------------------
   06. 상품 이미지 및 급매·특가 배지
   -------------------------------------------------- */

.deal-image {
    position: relative;
    width: 125px;
    height: 96px;
    overflow: hidden;
    border-radius: 8px;
    background: #f5e8e9;
}

.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f5e8e9;
    color: #ad9399;
    font-size: 14px;
}

.deal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deal-badge {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    min-width: 58px;
    padding: 5px 12px;
    border-radius: 0 0 16px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
}

    .deal-badge.urgent {
        background: #c62143;
        color: #fff;
    }

    .deal-badge.special {
        background: #f0cb83;
        color: #53351c;
    }


/* --------------------------------------------------
   07. 상품 이름 / 게임 / 서버 / 카테고리
   -------------------------------------------------- */

.deal-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
    min-width: 0;
    padding: 0;
}

.deal-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 5px;
}

    .deal-title h4 {
        margin: 0;
        color: #28151b;
        font-size: 18px;
        font-weight: 800;
        line-height: 1.35;
    }

.game-tag {
    padding: 3px 7px;
    border-radius: 5px;
    background: #f4f1f1;
    color: #66575c;
    font-size: 14px;
    white-space: nowrap;
}

.deal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 0;
    color: #68565d;
    font-size: 14px;
    line-height: 1.4;
}

.meta-divider {
    color: #d3c4c8;
}


/* --------------------------------------------------
   08. 평균 거래가 / 판매가 / 할인율
   -------------------------------------------------- */


/* 가격 영역: 제목과 숫자 높이 통일 */
.deal-prices {
    display: grid;
    grid-template-columns: 115px 120px 60px;
    column-gap: 10px;
    align-items: end;
    margin-top: 12px;
}

/* 가격 정보 2행 정렬 */
.price-block {
    display: grid;
    grid-template-rows: 18px 26px;
    row-gap: 2px;
    align-items: center;
    min-width: 0;
}

    /* 두 가격 제목은 동일한 크기와 높이 */
    .price-block small {
        display: block;
        margin: 0;
        font-size: 14px;
        line-height: 18px;
        color: #6f5d63;
        white-space: nowrap;
    }

    /* 최근 평균 거래가 */
    .price-block del {
        display: block;
        margin: 0;
        font-size: 16px;
        font-weight: 500;
        line-height: 26px;
        color: #786a70;
        white-space: nowrap;
        text-decoration-thickness: 1px;
    }

    /* 현재 판매가 강조 */
    .price-block strong {
        display: block;
        margin: 0;
        font-size: 19px;
        font-weight: 900;
        line-height: 26px;
        color: #a50028;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }

/* 할인율은 가격 숫자 행에 정렬 */
.deal-discount {
    justify-self: start;
    align-self: end;
    margin-bottom: 2px;
    padding: 5px 9px;
    border-radius: 20px;
    background: #bd2345;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}


/* 상품 정보가 좁아지면 할인율을 아래 행에 배치해 가격 겹침 방지 */
.deal-info {
    container-type: inline-size;
}

@container (max-width: 310px) {
    .deal-prices {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 10px;
    }

    .deal-discount {
        grid-column: 2;
        margin-top: 0;
    }
}


/* --------------------------------------------------
   09. AI 시세 분석 영역
   -------------------------------------------------- */

.deal-ai {
    display: flex;
    flex-direction: column;
    align-self: center;
    min-width: 0;
    min-height: 94px;
    padding: 9px 11px;
    border: 1px solid #f5e6e8;
    border-radius: 9px;
    background: #fff4f5;
}

    .deal-ai h5 {
        margin: 0 0 5px;
        color: #a51e3c;
        font-size: 14px;
        font-weight: 800;
    }

    .deal-ai p {
        margin: 0;
        color: #493a40;
        font-size: 14px;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

.deal-detail-btn {
    align-self: flex-end;
    margin-top: auto;
    padding: 6px 11px;
    border: none;
    border-radius: 6px;
    background: #811b32;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

    .deal-detail-btn:hover {
        background: #a52343;
    }


/* --------------------------------------------------
   10. 이용 가이드 패널
   -------------------------------------------------- */

.deals-guide-panel {
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 12px;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #ecd6d8;
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(60, 20, 30, 0.08);
    color: #351820;
}

/* 가이드 제목 및 닫기 버튼 */

.deals-guide-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

    .deals-guide-header h3 {
        margin: 0;
        color: #351820;
        font-size: 16px;
        font-weight: 800;
        line-height: 1.45;
    }

.deals-guide-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 25px;
    height: 25px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #583943;
    font-size: 23px;
    cursor: pointer;
}

    .deals-guide-close:hover {
        background: #f8e9ec;
        color: #b51f3e;
    }

/* 서비스 소개 */

.deals-guide-intro {
    margin: 0 0 18px;
    color: #67565b;
    font-size: 14px;
    line-height: 1.7;
}

/* 가이드 설명 영역 */

.deals-guide-section {
    padding: 13px 0;
    border-top: 1px solid #f0e4e6;
}

    .deals-guide-section h4 {
        margin: 0 0 11px;
        color: #351820;
        font-size: 15px;
        font-weight: 800;
    }

.deals-guide-description {
    margin: 0;
    color: #67565b;
    font-size: 14px;
    line-height: 1.65;
}

/* 급매·특가 기준 */

.deals-guide-rule {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 9px;
    color: #59464d;
    font-size: 14px;
    line-height: 1.5;
}

    .deals-guide-rule:last-child {
        margin-bottom: 0;
    }

.guide-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 43px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 800;
}

    .guide-badge.urgent {
        background: #c62143;
        color: #fff;
    }

    .guide-badge.special {
        background: #f0cb83;
        color: #53351c;
    }

/* 이용 전 확인사항 */

.deals-guide-notice {
    margin-top: 8px;
    padding: 13px;
    border: 1px solid #f5e2e5;
    border-radius: 9px;
    background: #fff0f2;
}

    .deals-guide-notice h4 {
        margin: 0 0 8px;
        color: #b51f3e;
        font-size: 14px;
        font-weight: 800;
    }

    .deals-guide-notice p {
        margin: 0;
        color: #655258;
        font-size: 14px;
        line-height: 1.7;
    }

/* 다시 보지 않기 체크박스 */

.deals-guide-footer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0e4e6;
}

    .deals-guide-footer label {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #59464d;
        font-size: 14px;
        cursor: pointer;
    }

    .deals-guide-footer input[type="checkbox"] {
        width: 15px;
        height: 15px;
        margin: 0;
        accent-color: #a51e3c;
        cursor: pointer;
    }


/* --------------------------------------------------
   11. 반응형 디자인
   -------------------------------------------------- */

/* 화면 폭 1200px 이하 */

@media (max-width: 1200px) {

    .deal-card {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .deal-image {
        width: 110px;
        height: 95px;
    }

    .deal-ai {
        grid-column: 1 / -1;
        min-height: 0;
    }
}

/* 화면 폭 850px 이하 */

@media (max-width: 850px) {

    .deals-summary {
        grid-template-columns: 1fr;
    }

    .summary-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid #eddcdd;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* 화면 폭 600px 이하 */

@media (max-width: 600px) {

    .deals-page {
        padding: 18px 12px 40px;
    }

    .deals-header h2 {
        font-size: 22px;
    }

    .deals-header-top {
        align-items: flex-start;
    }

    .deals-filters {
        align-items: flex-start;
        flex-direction: column;
    }

    .sort-group {
        margin-left: 0;
    }

    .deal-card {
        grid-template-columns: 1fr;
    }

    .deal-image {
        width: 100%;
        height: 150px;
    }

    .deal-ai {
        grid-column: auto;
    }
}

/* --------------------------------------------------
   12. 페이지 하단 중앙 - 추천 상품 페이지 이동
   -------------------------------------------------- */

/* 상품이 적을 때도 페이지 번호를 아래쪽에 배치 */
.deals-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 120px);
}

.deals-section {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    min-width: 0;
}

.deals-pagination {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin: auto 0 0;
    padding: 16px 0 0;
    box-sizing: border-box;
}

.deals-page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
}

.deals-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: #60444d;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

    .deals-page-btn:hover:not(:disabled):not(.active) {
        background: #f8e5e9;
        color: #ac2342;
    }

    .deals-page-btn.active {
        background: #b51f3e;
        border-color: #b51f3e;
        color: #fff;
        box-shadow: 0 3px 8px rgba(181,31,62,0.18);
    }

    .deals-page-btn.arrow {
        background: rgba(255,255,255,0.95);
        border-color: #eed9dc;
        color: #69424d;
        font-size: 20px;
    }

    .deals-page-btn:disabled {
        opacity: 0.35;
        cursor: default;
    }

    .deals-page-btn:focus-visible {
        outline: 2px solid #b51f3e;
        outline-offset: 2px;
    }

.deals-page-size {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 12px;
    border: 1px solid #ecd6d8;
    border-radius: 7px;
    background: #fffafb;
    color: #60444d;
    font-size: 14px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .deals-pagination {
        flex-direction: column;
        gap: 10px;
    }

    .deals-page-size {
        position: static;
        transform: none;
    }
}

/* 페이지 표시 개수 안내 숨기기 */
.deals-page-size {
    display: none;
}

/* 상세 보기 버튼 밑줄 제거 */
.deal-detail-btn,
.deal-detail-btn:hover,
.deal-detail-btn:focus,
.deal-detail-btn:visited {
    text-decoration: none;
}