:root {
    --bg: #0b0f1a;
    --bg-elevated: #10162a;
    --surface: rgba(255,255,255,.04);
    --surface-hover: rgba(255,255,255,.07);
    --text: #e8ecf5;
    --text-muted: #8b93a7;
    --border: rgba(255,255,255,.08);
    --cyan: #22d3ee;
    --pink: #f472b6;
    --violet: #a78bfa;
    --amber: #fbbf24;
    --emerald: #34d399;
    --radius: 16px;
    --shadow-glow: 0 0 0 1px rgba(34,211,238,.15), 0 8px 30px rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(34,211,238,.10), transparent 60%),
        radial-gradient(1000px 500px at 100% 0%, rgba(244,114,182,.08), transparent 55%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 상단 고지 배너 */
.disclaimer {
    background: linear-gradient(90deg, #1a1230 0%, #0f1a2e 100%);
    color: #c9b8ff;
    font-size: .8rem;
    padding: 10px 0;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.disclaimer .track {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 28s linear infinite;
    font-weight: 500;
    letter-spacing: .3px;
}
@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .disclaimer .track { animation: none; }
}

/* 컨테이너 */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

/* 타일 그리드 */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-flow: dense;
    gap: 12px;
    margin-top: 8px;
}
.tile--span2 { grid-column: span 2; }
.tile--full { grid-column: 1 / -1; }
.tiles--widgets {
    gap: 8px;
    margin-bottom: 16px;
    align-items: start;
}

.tile {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

/* 상품 타일 */
.tile--product {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.tile--product:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(34,211,238,.35);
    background: var(--surface-hover);
}
.tile--product img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: linear-gradient(135deg, #182036 0%, #0f1526 100%);
}
.tile--product .body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.tile--product h3 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -.2px;
}
.tile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.price-note {
    font-size: .74rem;
    color: var(--amber);
    font-weight: 700;
}
.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .3px;
    color: #1a0d1f;
    background: linear-gradient(135deg, var(--pink), #fb7185);
    box-shadow: 0 4px 14px rgba(244,114,182,.4);
}

/* 이벤트/프로모션 배너 타일 (product와 같은 url 링크, 렌더만 배너 스타일) */
.tile--banner {
    text-decoration: none;
    color: inherit;
    display: block;
    border: none;
}
.tile--banner:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}
.tile--banner img {
    width: 100%;
    aspect-ratio: 3 / 1;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #241a3a 0%, #1a1230 100%);
}
.tile--banner .banner-fallback {
    aspect-ratio: 3 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
    background: linear-gradient(135deg, rgba(244,114,182,.18), rgba(34,211,238,.12));
}
.tile--banner .banner-caption {
    padding: 12px 16px;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
}
@media (max-width: 600px) {
    .tile--banner img, .tile--banner .banner-fallback { aspect-ratio: 16 / 9; }
}

/* 임베드 타일 (검색위젯/카테고리/다이나믹 배너/iframe으로 등록한 상품·이벤트) — 라벨 없이 배너 실제 크기만큼만 차지 */
.tile--embed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    overflow: visible;
}
.embed-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow-x: auto;
}
.embed-wrap iframe { border: 0; max-width: 100%; }
.embed-wrap iframe.embed-frame--fluid { width: 100%; max-width: none; }

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 72px 20px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* 푸터 */
.site-footer {
    text-align: center;
    margin-top: 56px;
    color: #565f76;
    font-size: .82rem;
}
.site-footer a { color: var(--cyan); text-decoration: none; font-weight: 500; }

/* 반응형 */
@media (max-width: 720px) {
    .tile--span2, .tile--full { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .container { padding: 32px 16px 48px; }
    .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .tile--product .body { padding: 12px 14px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .tile, .tile--product { transition: none; }
}
