@charset 'utf-8';

/* ===================== 기본 ===================== */
:root {
    --header-top-h: 64px;
    --header-nav-h: 44px;
    --header-h: 108px;
    --header-pad: 20px;

    --bg: #0d0d0d;
    --surface: #161616;
    --surface-2: #1e1e1e;
    --border: #2b2b2b;
    --text: #eaeaea;
    --text-dim: #9a9a9a;
    --accent: #4da3ff;
    --danger: #ff5c5c;
    --success: #4ecb8f;
}

html {
    font-family: "Noto Sans KR", "Noto Sans", sans-serif;
    font-size: 14px;
    color: var(--text);
}

body {
    overflow-x: hidden;
    letter-spacing: -0.03rem;
    background: var(--bg);
}

a {
    text-decoration: none;
    color: var(--text);
}

/* ===================== 헤더 ===================== */
.site-header {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10000;

    width: 100%;
    background: #000;
    border-bottom: 1px solid var(--border);
}

/* --- 1행 : 로고 / 검색 / 계정 --- */
.header-top {
    display: flex;
    align-items: center;
    gap: 24px;

    height: var(--header-top-h);
    padding: 0 var(--header-pad);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-sub {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;

    flex: 1 1 auto;
    max-width: 420px;
    margin: 0 auto;
    height: 40px;
    padding: 0 6px 0 16px;

    background: #fff;
    border: 1px solid #ccc;
    border-radius: 999px;
}

.search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: #111;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.search-btn img {
    width: 18px;
    height: 18px;
}

.search-btn:hover {
    background: #eee;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
    margin-left: auto;
}

.user-nav-item {
    font-size: 0.9rem;
    color: #ddd;
    white-space: nowrap;
}

.user-nav-item:hover {
    color: #fff;
}

.user-nav-name {
    font-size: 0.9rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.cart-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 5px;
    margin-left: 4px;
    border-radius: 999px;

    background: var(--accent);
    color: #001;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.logout-btn {
    font-size: 0.9rem;
    color: #ddd;
    font-family: inherit;
    padding: 0;
}

.logout-btn:hover {
    color: #fff;
}

/* --- 2행 : 메인 메뉴 --- */
.global-nav {
    border-top: 1px solid var(--border);
}

.global-nav-links {
    display: flex;
    align-items: center;
    gap: 40px;

    height: var(--header-nav-h);
    padding: 0 var(--header-pad);
}

.global-nav-item {
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    color: #eee;
    line-height: var(--header-nav-h);
    border-bottom: 2px solid transparent;
}

.global-nav-item:hover,
.global-nav-item.active {
    color: #fff;
    border-bottom-color: #fff;
}

.global-nav-item.admin {
    color: var(--accent);
    margin-left: auto;
}

/* ===================== 페이지 공통 ===================== */
.page {
    /* 고정 헤더에 가리지 않도록 */
    padding-top: calc(var(--header-h) + 32px);
    padding-bottom: 60px;
    min-height: 70vh;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--header-pad);
}

.container-narrow {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 0 var(--header-pad);
}

.page-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.page-desc {
    color: var(--text-dim);
    margin-bottom: 26px;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

/* ===================== 알림 ===================== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(78, 203, 143, 0.12);
    border: 1px solid rgba(78, 203, 143, 0.4);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 92, 92, 0.12);
    border: 1px solid rgba(255, 92, 92, 0.4);
    color: var(--danger);
}

/* ===================== 버튼 ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;

    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #06121f;
    font-weight: 700;
}

.btn-primary:hover {
    background: #6fb6ff;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: #555;
    background: var(--surface-2);
}

.btn-danger {
    background: transparent;
    border-color: rgba(255, 92, 92, 0.5);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(255, 92, 92, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

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

/* ===================== 폼 ===================== */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
}

textarea.form-control {
    min-height: 130px;
    resize: vertical;
    line-height: 1.6;
}

.form-row {
    display: flex;
    gap: 14px;
}

.form-row > .form-group {
    flex: 1;
}

.field-error {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--danger);
}

/* display:block 이 hidden 속성을 덮어쓰므로 따로 눌러준다.
   (비밀번호 불일치 안내처럼 JS 로 켜고 끄는 문구에 필요) */
.field-error[hidden] {
    display: none;
}

.form-footer {
    display: flex;
    gap: 10px;
    margin-top: 26px;
}

.form-hint {
    margin-top: 18px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.form-hint a {
    color: var(--accent);
}

/* ===================== 상품 카드 ===================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 22px;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    border-color: #444;
}

.product-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 이미지가 없는 상품은 카테고리명을 대신 보여준다 */
.thumb-placeholder {
    font-size: 1.1rem;
    font-weight: 700;
    color: #3d3d3d;
    letter-spacing: 0.05em;
}

.sold-out-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.62);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.product-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 16px 18px;
}

.product-brand {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.product-name {
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin-top: 4px;
    font-size: 1.15rem;
    font-weight: 700;
}

/* ===================== 공연 카드 =====================
   목록(/tickets)과 랜딩에서 함께 쓴다. 상세 화면 전용 스타일만 ticket.css 에 둔다. */
.perf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 24px;
}

.perf-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.perf-card:hover {
    border-color: #444;
}

.perf-poster {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.perf-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 포스터가 없을 때 공연명으로 대신 채운다 */
.poster-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    text-align: center;
    background: linear-gradient(160deg, #232323 0%, #141414 100%);
    width: 100%;
    height: 100%;
}

.poster-cat {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--accent);
}

.poster-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
    color: #6d6d6d;
}

.perf-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px 16px 18px;
}

.perf-cat {
    font-size: 0.76rem;
    color: var(--accent);
    letter-spacing: 0.04em;
}

.perf-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.perf-venue,
.perf-date {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.perf-price {
    margin-top: 6px;
    font-size: 1.05rem;
    font-weight: 700;
}

/* ===================== 표 ===================== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.table th,
.table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: var(--text-dim);
    font-weight: 500;
    border-bottom-color: #3a3a3a;
    white-space: nowrap;
}

.table .num {
    text-align: right;
}

.table .center {
    text-align: center;
}

.table-wrap {
    overflow-x: auto;
}

/* ===================== 상태 배지 ===================== */
.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}

.status-ORDERED { color: #ffd166; border-color: rgba(255, 209, 102, 0.4); }
.status-PAID { color: var(--accent); border-color: rgba(77, 163, 255, 0.4); }
.status-SHIPPING { color: #c58bff; border-color: rgba(197, 139, 255, 0.4); }
.status-DELIVERED { color: var(--success); border-color: rgba(78, 203, 143, 0.4); }
.status-CANCELLED { color: var(--text-dim); }

/* 공연 예매 */
.status-BOOKED { color: var(--accent); border-color: rgba(77, 163, 255, 0.4); }
.status-USED { color: var(--success); border-color: rgba(78, 203, 143, 0.4); }

/* ===================== 필터 / 페이지네이션 ===================== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.chip {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-dim);
}

.chip:hover {
    border-color: #555;
    color: var(--text);
}

.chip.active {
    background: var(--text);
    border-color: var(--text);
    color: #000;
    font-weight: 700;
}

.filter-spacer {
    margin-left: auto;
}

.select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.pagination .current {
    background: var(--text);
    border-color: var(--text);
    color: #000;
    font-weight: 700;
}

.pagination .disabled {
    opacity: 0.35;
}

/* 안내 문구 상자 — 주문/예매 유의사항 등 */
.notice-box {
    margin-top: 22px;
    padding: 16px 18px;
    background: var(--surface-2);
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--text-dim);
}

/* 비회원 주문번호 */
.order-number-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 20px 22px;
    background: var(--surface-2);
    border: 1px dashed var(--accent);
    border-radius: 10px;
}

.order-number {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--accent);
    word-break: break-all;
}

.empty {
    padding: 80px 20px;
    text-align: center;
    color: var(--text-dim);
}

.empty-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

/* ===================== 푸터 ===================== */
.site-footer {
    display: flex;
    justify-content: center;
    background-color: #000;
    border-top: 1px solid var(--border);
}

.footer-textbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 30px 20px;
    color: var(--text-dim);
    width: 100%;
    max-width: 1100px;
}

.dl-1,
.dl-2,
.dl-3 {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
}

.dl-1 dt, .dl-1 dd,
.dl-2 dt, .dl-2 dd,
.dl-3 dt, .dl-3 dd {
    margin: 0;
    padding: 0;
    white-space: nowrap;
    line-height: 1.6;
}

.site-footer dt {
    color: #ddd;
    font-weight: bold;
}

.site-footer dd {
    color: var(--text-dim);
}

/* ===================== 반응형 ===================== */
@media (max-width: 900px) {
    :root {
        --header-pad: 12px;
    }

    .search-container {
        max-width: 240px;
    }

    .brand-sub {
        display: none;
    }
}

@media (max-width: 640px) {
    :root {
        --header-top-h: 56px;
        --header-h: 100px;
    }

    .search-container {
        display: none;
    }

    .global-nav-links {
        gap: 22px;
        overflow-x: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}


/* ===== 상품상세 / 장바구니 / 주문 ===== */
/* 상품 상세 / 장바구니 / 주문서 전용 스타일 */

/* ===== 상품 상세 ===== */
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.detail-image {
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.detail-image .thumb-placeholder {
    font-size: 1.6rem;
}

.detail-brand {
    color: var(--text-dim);
    margin-bottom: 8px;
}

.detail-name {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 18px;
}

.detail-price {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 26px;
}

.detail-meta {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    margin-bottom: 24px;
}

.detail-meta-row {
    display: flex;
    gap: 16px;
    padding: 7px 0;
    font-size: 0.95rem;
}

.detail-meta-row dt {
    width: 90px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.qty-input {
    width: 90px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

.detail-actions {
    display: flex;
    gap: 12px;
}

.detail-actions .btn {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
}

.detail-description {
    margin-top: 60px;
    padding-top: 34px;
    border-top: 1px solid var(--border);
}

.detail-description h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.detail-description p {
    color: #c9c9c9;
    line-height: 1.9;
    white-space: pre-line;
}

/* ===== 장바구니 / 주문 ===== */
.cart-thumb {
    width: 68px;
    height: 68px;
    border-radius: 8px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-thumb .thumb-placeholder {
    font-size: 0.72rem;
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cart-product-name {
    font-weight: 500;
    line-height: 1.4;
}

.cart-product-brand {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.qty-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-form .qty-input {
    width: 70px;
    padding: 7px 10px;
    font-size: 0.88rem;
}

.summary-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    padding: 26px 4px;
    border-top: 2px solid var(--border);
    margin-top: 8px;
}

.summary-label {
    color: var(--text-dim);
}

.summary-total {
    font-size: 1.7rem;
    font-weight: 700;
}

.cart-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.cart-actions .btn {
    min-width: 150px;
    padding: 14px 20px;
    font-size: 1rem;
}

/* ===== 주문서 ===== */
.order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}

.order-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

.order-summary-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--border);
}

.order-summary-item span:first-child {
    color: #c9c9c9;
}

.order-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 2px solid var(--border);
}

.order-summary-total strong {
    font-size: 1.5rem;
}

/* ===== 주문 상세 ===== */
.order-info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
    margin-bottom: 34px;
}

.order-info-row {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    font-size: 0.95rem;
}

.order-info-row dt {
    width: 110px;
    color: var(--text-dim);
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .detail-grid,
    .order-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .order-summary-card {
        position: static;
    }

    .detail-name {
        font-size: 1.5rem;
    }

    .detail-price {
        font-size: 1.6rem;
    }
}

