/*
Theme Name: 할인정보 게시판
Theme URI: https://example.com
Author: 준
Description: 상품 할인정보를 리스트형으로 보여주는 커스텀 워드프레스 테마. 커스텀 포스트타입(할인상품) 기반, 한 페이지에 50개씩 표시, AJAX로 빠르게 다음 페이지로 이동할 수 있습니다.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: discount-board
*/

:root {
    --dbt-primary: #2563eb;
    --dbt-text: #1f2937;
    --dbt-muted: #6b7280;
    --dbt-border: #e5e7eb;
    --dbt-bg: #ffffff;
    --dbt-discount: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
    color: var(--dbt-text);
    background: #f9fafb;
}

a { text-decoration: none; color: inherit; }
ul { margin: 0; padding: 0; }

/* Header */
.dbt-header {
    background: #fff;
    border-bottom: 1px solid var(--dbt-border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.dbt-header-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dbt-logo { font-weight: 700; font-size: 18px; }
.primary-menu { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }
.primary-menu a {
    font-size: 15px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
}
.primary-menu a:hover,
.primary-menu li.current-menu-item a { background: #eff6ff; color: var(--dbt-primary); }

/* Board (게시판) */
.dbt-board-wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 60px; }
.dbt-board-title { font-size: 20px; margin: 0 0 16px; }

.dbt-product-list {
    list-style: none;
    border-top: 1px solid var(--dbt-border);
    transition: opacity .15s ease;
}
.dbt-product-list.dbt-loading { opacity: .4; pointer-events: none; }

.dbt-product-item { border-bottom: 1px solid var(--dbt-border); }
.dbt-product-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 6px;
}
.dbt-product-link:hover { background: #f3f4f6; }

.dbt-thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dbt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dbt-thumb-placeholder { font-size: 10px; color: var(--dbt-muted); }

.dbt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dbt-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dbt-price { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dbt-discount-rate { color: var(--dbt-discount); font-weight: 700; }
.dbt-sale-price { font-weight: 700; }
.dbt-original-price { color: var(--dbt-muted); text-decoration: line-through; font-size: 12px; }

.dbt-empty { padding: 40px 0; text-align: center; color: var(--dbt-muted); }

/* Pagination (빠른 페이지 이동) */
.dbt-pagination-wrap { margin-top: 20px; display: flex; justify-content: center; }
.dbt-pagination { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.dbt-page-link {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid var(--dbt-border);
    background: #fff;
}
.dbt-page-link:hover { background: #f3f4f6; }
.dbt-page-link.active { background: var(--dbt-primary); color: #fff; border-color: var(--dbt-primary); }
.dbt-page-ellipsis { padding: 0 4px; color: var(--dbt-muted); }
.dbt-prev, .dbt-next { font-weight: 600; }

/* Single product fallback page */
.dbt-single-product { max-width: 480px; margin: 0 auto; padding: 20px 16px 60px; }
.dbt-single-product img { width: 100%; border-radius: 8px; }
.dbt-single-price { font-size: 18px; margin: 12px 0; }
.dbt-buy-btn {
    display: inline-block;
    background: var(--dbt-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
}

/* Footer */
.dbt-footer { border-top: 1px solid var(--dbt-border); padding: 20px 16px; text-align: center; color: var(--dbt-muted); font-size: 13px; }

@media (max-width: 480px) {
    .dbt-header-inner, .dbt-board-wrap { padding-left: 12px; padding-right: 12px; }
    .dbt-title { font-size: 13px; }
}
