/* =====================================================
   Blackship Theme
   읽기 쉬운 정적 쇼핑 페이지용 CSS
===================================================== */
:root {
    --bg: #f7f7f2;
    --card: #fff;
    --ink: #1f2933;
    --muted: #697586;
    --line: #e5e7eb;
    --accent: #111827;
    --soft: #fef3c7;
    --danger: #b91c1c;
    --shadow: 0 14px 30px rgba(15, 23, 42, .08);
}

/* Reset */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }

/* Header: 스크롤 시 본문과 겹치지 않도록 배경/경계 추가 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 16px clamp(18px, 4vw, 48px);
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .06);
    backdrop-filter: blur(8px);
}
.logo {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.nav a {
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--muted);
    font-size: .95rem;
    font-weight: 700;
}
.nav a:hover { background: var(--soft); color: var(--ink); }

/* Page Layout: 좌우 여백 확보 */
main {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 34px 0 48px;
}
main > h1 {
    margin: 0 0 22px;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    line-height: 1.2;
}

/* Hero Section */
.hero {
    margin-bottom: 30px;
    padding: clamp(28px, 6vw, 56px);
    background: linear-gradient(135deg, #fff, #fef3c7);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 6vw, 4rem);
    line-height: 1.05;
    letter-spacing: -.05em;
}
.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

/* Product Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}
.card,
.product-card {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.product-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .12);
}

/* Product Image: 이미지가 없어도 같은 자리 유지 */
.image-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eef0f3;
    border-bottom: 1px solid var(--line);
}
.image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.image-wrap.image-missing::before,
.image-placeholder {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    background:
        linear-gradient(135deg, rgba(255,255,255,.45), rgba(255,255,255,0)),
        #eef0f3;
}
.no-image { display: none; }

/* Product Info */
.product-body,
.card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}
.product-body h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}
.product-body h2 a:hover { text-decoration: underline; }
.price-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}
.price {
    color: var(--danger);
    font-size: 1.05rem;
    font-weight: 900;
}
.original,
.original-price {
    color: var(--muted);
    font-size: .9rem;
    text-decoration: line-through;
}
.buy-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 12px;
    font-weight: 900;
    text-align: center;
}
.buy-button:hover { filter: brightness(1.15); }

/* Detail Page */
.detail {
    display: grid;
    grid-template-columns: minmax(260px, 430px) 1fr;
    gap: 28px;
    align-items: start;
    padding: clamp(18px, 4vw, 32px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.detail .detail-image {
    border: 1px solid var(--line);
    border-radius: 18px;
}
.detail h1 {
    margin: 0 0 14px;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1.2;
}
.detail p { color: var(--muted); }
.detail .price {
    color: var(--danger);
    font-size: 1.4rem;
}

/* Footer */
.site-footer {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0 42px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: .9rem;
    text-align: center;
}

.site-footer p {
    margin: 4px 0;
    text-align: center;
}

/* Tablet */
@media (max-width: 860px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .nav {
        justify-content: flex-start;
    }
    .detail {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 560px) {
    .site-header {
        padding: 14px 16px;
    }
    .nav a {
        padding: 6px 8px;
        font-size: .9rem;
    }
    main {
        width: min(100% - 24px, 1180px);
        padding-top: 22px;
    }
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
