/* =========================================================
   Pudica.net/catalog — 카탈로그 페이지
   Theme: Sky Blue / Light Mode
   ========================================================= */

:root {
    --sky-50:  #f0f9ff;
    --sky-100: #e0f2fe;
    --sky-200: #bae6fd;
    --sky-300: #7dd3fc;
    --sky-400: #38bdf8;
    --sky-500: #0ea5e9;
    --sky-600: #0284c7;
    --sky-700: #0369a1;
    --sky-800: #075985;
    --sky-900: #0c4a6e;

    --ink:      #0f2438;
    --ink-soft: #475c70;
    --white:    #ffffff;
    --border:   rgba(14, 165, 233, 0.16);
    --shadow:   0 14px 36px -16px rgba(2, 132, 199, 0.4);
    --shadow-h: 0 22px 48px -16px rgba(2, 132, 199, 0.5);

    --font-display: "Outfit", "Noto Sans KR", sans-serif;
    --font-body:    "Noto Sans KR", "Outfit", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: linear-gradient(160deg, var(--sky-100) 0%, var(--sky-50) 50%, #ffffff 100%);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.sky-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(72px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}
.sky-orb-1 { width: 440px; height: 440px; top: -130px; right: -110px; background: radial-gradient(circle, var(--sky-300), transparent 70%); }
.sky-orb-2 { width: 370px; height: 370px; bottom: -140px; left: -120px; background: radial-gradient(circle, var(--sky-200), transparent 70%); }

.container {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 30px 20px 48px;
}

/* Back nav */
.back-nav { margin-bottom: 20px; }
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sky-700);
    text-decoration: none;
    background: var(--white);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 14px -8px rgba(2,132,199,0.4);
    transition: background 0.2s, transform 0.2s;
}
.btn-back:hover { background: var(--sky-50); transform: translateX(-2px); }
.btn-back svg { width: 17px; height: 17px; }

/* Header */
header { text-align: center; margin-bottom: 28px; }
.logo-wrap { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.logo-text { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; letter-spacing: 0.04em; color: var(--sky-800); }
.logo-dot { color: var(--sky-400); font-weight: 600; }
.service-badge {
    font-family: var(--font-display);
    font-weight: 600; font-size: 0.66rem; letter-spacing: 0.13em;
    color: var(--white);
    background: linear-gradient(135deg, var(--sky-400), var(--sky-600));
    padding: 4px 10px; border-radius: 7px;
}
header h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 5vw, 1.95rem); color: var(--sky-900); margin-bottom: 8px; }
.tagline { font-size: 0.92rem; color: var(--ink-soft); max-width: 460px; margin: 0 auto; }

/* State boxes (loading / empty / error) */
.state-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 44px 24px;
    text-align: center;
}
.state-box .state-icon { font-size: 3rem; margin-bottom: 14px; }
.state-box h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--sky-900); margin-bottom: 9px; }
.state-box p { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.65; }
.spinner {
    width: 42px; height: 42px;
    border: 4px solid var(--sky-100);
    border-top-color: var(--sky-500);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-retry {
    margin-top: 16px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--white);
    background: linear-gradient(135deg, var(--sky-500), var(--sky-600));
    border: none;
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s;
}
.btn-retry:hover { transform: translateY(-2px); }

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0;
    font: inherit;
    color: inherit;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-h); }

.product-image {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--sky-200), var(--sky-400));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-image .emoji-fallback { font-size: 3.4rem; transform: rotate(-10deg); filter: drop-shadow(0 6px 10px rgba(0,0,0,.2)); }
.product-tag {
    position: absolute;
    top: 10px; left: 10px;
    background: rgba(255,255,255,0.94);
    color: var(--sky-700);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 4px 10px;
    border-radius: 999px;
}
.product-soldout {
    position: absolute;
    inset: 0;
    background: rgba(15, 36, 56, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
}

.product-body { padding: 14px 15px 16px; flex: 1; display: flex; flex-direction: column; }
.product-brand { font-size: 0.72rem; color: var(--sky-500); font-weight: 600; margin-bottom: 3px; }
.product-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--sky-900);
    margin-bottom: 8px;
    line-height: 1.35;
}
.product-meta { margin-top: auto; }
.product-price { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--sky-600); }
.product-price .price-unit { font-size: 0.78rem; font-weight: 500; color: var(--ink-soft); }
.product-sizes { font-size: 0.74rem; color: var(--ink-soft); margin-top: 4px; }

/* Live CTA */
.live-cta {
    margin-top: 26px;
    padding: 22px;
    text-align: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.live-cta p { font-size: 0.86rem; color: var(--ink-soft); margin-bottom: 12px; }
.btn-live-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: var(--white);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 11px 22px;
    border-radius: 999px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 22px -10px rgba(225,29,72,0.8);
}
.btn-live-link:hover { transform: translateY(-2px); }
.btn-live-link svg { width: 17px; height: 17px; }

/* Footer */
footer { text-align: center; margin-top: 36px; font-size: 0.76rem; color: var(--ink-soft); opacity: 0.8; }

/* ===================== Detail Modal ===================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 74, 110, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.modal-backdrop.active { opacity: 1; visibility: visible; }
.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 22px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 28px 64px -18px rgba(2,132,199,0.55);
    transform: translateY(18px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.26, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.modal-backdrop.active .modal-content { transform: translateY(0) scale(1); }
.modal-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--sky-700);
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.modal-close:hover { background: #fff; transform: rotate(90deg); }
.modal-close svg { width: 19px; height: 19px; }

.detail-image {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--sky-200), var(--sky-400));
    display: flex; align-items: center; justify-content: center;
    border-radius: 22px 22px 0 0;
    overflow: hidden;
}
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-image .emoji-fallback { font-size: 5rem; transform: rotate(-10deg); }
.detail-info { padding: 20px 22px 24px; }
.detail-brand { font-size: 0.78rem; color: var(--sky-500); font-weight: 600; margin-bottom: 4px; }
.detail-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--sky-900); margin-bottom: 10px; }
.detail-price { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--sky-600); margin-bottom: 14px; }
.detail-price .price-unit { font-size: 0.85rem; font-weight: 500; color: var(--ink-soft); }
.detail-desc { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.7; margin-bottom: 16px; white-space: pre-wrap; }
.detail-row { display: flex; gap: 10px; font-size: 0.85rem; margin-bottom: 8px; }
.detail-row .detail-label { color: var(--ink-soft); min-width: 70px; }
.detail-row .detail-value { color: var(--sky-900); font-weight: 500; }

/* ===================== Color Swatches ===================== */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.swatch {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--ink-soft);
    font-size: 0.69rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    white-space: nowrap;
    font-family: var(--font-body);
    line-height: 1;
}
.swatch.active {
    border-color: var(--sky-500);
    background: var(--sky-500);
    color: var(--white);
}
.swatch:hover:not(.active) {
    border-color: var(--sky-300);
    background: var(--sky-50);
}

.color-label {
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--ink-soft);
}

/* ===================== Image Gallery ===================== */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    background: rgba(255, 255, 255, 0.88);
    border: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.14);
    transition: background 0.18s;
}
.gallery-nav svg { width: 16px; height: 16px; stroke: var(--sky-700); }
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }
.gallery-nav.hidden { display: none; }

.gallery-dots {
    position: absolute;
    bottom: 8px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 5px;
    z-index: 3;
}
.gallery-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: background 0.18s;
}
.gallery-dot.active { background: rgba(255,255,255,0.95); }

/* ===================== Detail Modal — color row ===================== */
.detail-color-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.detail-color-row .detail-label {
    flex-shrink: 0;
    min-width: 70px;
    padding-top: 4px;
}
.modal-swatches { margin-top: 0; }

.emoji-fallback.big { font-size: 5rem; transform: rotate(-10deg); }

/* Responsive */
@media (max-width: 520px) {
    .product-grid { gap: 12px; }
    .product-name { font-size: 0.9rem; }
    .product-price { font-size: 0.98rem; }
}
@media (max-width: 360px) {
    .product-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
