/* ============================================
   NOX cookie - iOS Style Design
   White/Black tone
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;800&display=swap');

:root {
    --black: #000000;
    --white: #ffffff;
    --bg: #f2f2f7;
    --card: #ffffff;
    --text: #1c1c1e;
    --text-secondary: #8e8e93;
    --text-tertiary: #aeaeb2;
    --separator: rgba(60,60,67,0.1);
    --separator-opaque: #c6c6c8;
    --fill: rgba(120,120,128,0.08);
    --accent: #1c1c1e;
    --red: #ff3b30;
    --green: #34c759;
    --blue: #007aff;
    --orange: #ff9500;
    --radius: 14px;
    --radius-sm: 10px;
    --max-w: 1080px;
    --header-h: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --shadow-card: 0 2px 16px rgba(0,0,0,0.06);
    --shadow-float: 0 8px 32px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, 'SF Pro Display', 'SF Pro Text', 'Noto Sans KR', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ===== 헤더 (iOS Navigation Bar) ===== */
.shop-header {
    background: rgba(255,255,255,0.85);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--separator);
    position: sticky; top: 0; z-index: 100;
}
.shop-header-inner {
    max-width: var(--max-w); margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    height: var(--header-h);
}
.shop-logo {
    font-size: 20px; font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--black);
}
.shop-nav { display: flex; gap: 24px; }
.shop-nav a {
    font-size: 15px; font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
    padding: 4px 0;
}
.shop-nav a:hover, .shop-nav a.active { color: var(--black); }
.shop-icons { display: flex; align-items: center; gap: 16px; }
.shop-icons a {
    position: relative; color: var(--text);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.shop-icons a:hover { background: var(--fill); }
.cart-count {
    position: absolute; top: 0; right: 0;
    background: var(--red); color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 8px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
}

/* ===== 히어로 ===== */
.hero {
    background: var(--black);
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
}
.hero-content { position: relative; z-index: 2; }
.hero-content h1 {
    font-size: 44px; font-weight: 800;
    color: #fff; letter-spacing: -0.04em;
    line-height: 1.1; margin-bottom: 12px;
}
.hero-content p {
    font-size: 17px; color: rgba(255,255,255,0.7);
    font-weight: 400;
}

/* ===== 섹션 ===== */
.section { padding: 32px 0; }
.section-header {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 20px;
}
.section-title {
    font-size: 22px; font-weight: 700;
    letter-spacing: -0.03em;
}
.section-link {
    font-size: 15px; color: var(--blue);
    font-weight: 500;
}

/* ===== 상품 그리드 ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.25s;
    cursor: pointer;
}
.product-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-float);
}
.product-card:active { transform: scale(0.98); }
.product-card .thumb {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg);
    position: relative;
}
.product-card .thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
}
.product-card:hover .thumb img { transform: scale(1.06); }
.product-card .thumb .sale-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--red); color: #fff;
    padding: 3px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 700;
}
.product-card .info { padding: 14px; }
.product-card .name {
    font-size: 14px; font-weight: 500;
    line-height: 1.4; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 6px;
}
.product-card .price-wrap { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.product-card .price { font-size: 16px; font-weight: 700; color: var(--black); }
.product-card .original-price { font-size: 12px; color: var(--text-tertiary); text-decoration: line-through; }
.product-card .discount { font-size: 14px; font-weight: 700; color: var(--red); }

/* ===== iOS Card Style ===== */
.ios-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 16px;
}
.ios-card-header {
    padding: 16px 20px 12px;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.ios-card-body { padding: 0 20px 20px; }
.ios-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 13px 0;
    border-bottom: 0.5px solid var(--separator);
}
.ios-row:last-child { border-bottom: none; }
.ios-row .label { color: var(--text); font-size: 15px; }
.ios-row .value { color: var(--text-secondary); font-size: 15px; text-align: right; }

/* ===== iOS Input ===== */
.ios-input-group { margin-bottom: 12px; }
.ios-input-group label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 6px; padding-left: 4px;
}
.ios-input {
    width: 100%; padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-sm);
    font-size: 16px; font-family: inherit;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}
.ios-input:focus {
    outline: none;
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.ios-input::placeholder { color: var(--text-tertiary); }
.ios-select {
    width: 100%; padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-sm);
    font-size: 16px; font-family: inherit;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238e8e93' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ===== iOS Buttons ===== */
.ios-btn {
    display: flex; align-items: center; justify-content: center;
    width: 100%; padding: 16px;
    border: none; border-radius: var(--radius);
    font-size: 17px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.ios-btn:active { transform: scale(0.98); opacity: 0.85; }
.ios-btn-primary { background: var(--black); color: #fff; }
.ios-btn-secondary { background: var(--fill); color: var(--text); }
.ios-btn-outline { background: transparent; border: 1.5px solid var(--black); color: var(--black); }
.ios-btn-sm { padding: 10px 20px; font-size: 15px; width: auto; border-radius: var(--radius-sm); }
.ios-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.ios-btn-row { display: flex; gap: 10px; }
.ios-btn-row .ios-btn { flex: 1; }

/* ===== 상품 상세 ===== */
.product-detail { padding: 0 0 40px; }
.product-detail-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 40px; padding: 24px 0;
}
.product-gallery { position: sticky; top: 72px; }
.product-gallery .main-image {
    aspect-ratio: 1; border-radius: var(--radius);
    overflow: hidden; background: var(--bg); margin-bottom: 10px;
}
.product-gallery .main-image img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery .thumb-list { display: flex; gap: 8px; }
.product-gallery .thumb-item {
    width: 64px; height: 64px; border-radius: 10px;
    overflow: hidden; border: 2px solid transparent;
    cursor: pointer; transition: border-color 0.2s;
}
.product-gallery .thumb-item.active { border-color: var(--black); }
.product-gallery .thumb-item img { width: 100%; height: 100%; object-fit: cover; }

.product-info .breadcrumb { font-size: 13px; color: var(--text-tertiary); margin-bottom: 8px; }
.product-info .product-name { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 16px; }
.product-info .price-area {
    padding: 20px; background: var(--bg);
    border-radius: var(--radius-sm); margin-bottom: 20px;
}
.product-info .final-price { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.product-info .final-price span { font-size: 16px; font-weight: 400; }

.qty-control {
    display: inline-flex; align-items: center;
    background: var(--fill); border-radius: var(--radius-sm);
    overflow: hidden;
}
.qty-control button {
    width: 40px; height: 40px; border: none;
    background: transparent; font-size: 18px;
    cursor: pointer; color: var(--text);
    display: flex; align-items: center; justify-content: center;
}
.qty-control button:active { background: var(--separator); }
.qty-control input {
    width: 48px; height: 40px; text-align: center;
    border: none; background: transparent;
    font-size: 16px; font-weight: 600; font-family: inherit;
}

/* ===== 장바구니 ===== */
.cart-item {
    display: flex; gap: 14px; padding: 16px 0;
    border-bottom: 0.5px solid var(--separator);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 80px; height: 80px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--bg); }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.cart-item-name { font-size: 15px; font-weight: 500; }
.cart-item-option { font-size: 13px; color: var(--text-secondary); }
.cart-item-price { font-size: 16px; font-weight: 700; }
.cart-item-remove {
    background: none; border: none; color: var(--text-tertiary);
    font-size: 20px; cursor: pointer; padding: 4px; align-self: flex-start;
}

/* ===== 배송조회 타임라인 ===== */
.tracking-steps {
    display: flex; padding: 20px; gap: 0;
    position: relative;
}
.tracking-step {
    flex: 1; text-align: center; position: relative; z-index: 1;
}
.tracking-step .dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--separator-opaque);
    margin: 0 auto 8px; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--text-tertiary);
    transition: all 0.3s;
}
.tracking-step.active .dot {
    background: var(--black); border-color: var(--black); color: #fff;
}
.tracking-step.done .dot {
    background: var(--green); border-color: var(--green); color: #fff;
}
.tracking-step .label { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.tracking-step.active .label, .tracking-step.done .label { color: var(--text); font-weight: 600; }
.tracking-line {
    position: absolute; top: 34px;
    left: 10%; right: 10%;
    height: 2px; background: var(--separator-opaque);
    z-index: 0;
}

.timeline-item {
    position: relative; padding: 0 0 24px 28px;
    border-left: 2px solid var(--separator);
}
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before {
    content: ''; position: absolute; left: -6px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--separator-opaque);
}
.timeline-item.active::before { background: var(--green); }
.timeline-item.active { border-left-color: var(--green); }
.timeline-item .time { font-size: 12px; color: var(--text-tertiary); }
.timeline-item .status { font-size: 14px; font-weight: 600; }
.timeline-item .message { font-size: 13px; color: var(--text-secondary); }

/* ===== 페이지 타이틀 ===== */
.page-title {
    font-size: 34px; font-weight: 800;
    letter-spacing: -0.04em;
    padding: 16px 0 20px;
}

/* ===== 배지 ===== */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 600;
}

/* ===== 토스트 ===== */
.toast {
    position: fixed; bottom: 40px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 14px 24px; border-radius: 14px;
    color: #fff; font-size: 15px; font-weight: 500;
    z-index: 9999; opacity: 0;
    transition: all 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
    box-shadow: var(--shadow-float);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--black); }
.toast-error { background: var(--red); }

/* ===== 푸터 ===== */
.shop-footer {
    background: var(--black); color: rgba(255,255,255,0.5);
    padding: 40px 0; margin-top: 60px; font-size: 13px; line-height: 1.8;
}
.shop-footer .footer-inner {
    max-width: var(--max-w); margin: 0 auto; padding: 0 20px;
    display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px;
}
.shop-footer h4 { color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.shop-footer a { color: rgba(255,255,255,0.5); transition: color 0.2s; }
.shop-footer a:hover { color: #fff; }
.shop-footer .copyright {
    max-width: var(--max-w); margin: 24px auto 0; padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
}

/* ===== 빈 상태 ===== */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-tertiary);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 15px; }

/* ===== 인증 페이지 ===== */
.auth-page {
    max-width: 400px; margin: 0 auto;
    padding: 60px 20px;
}
.auth-page .logo {
    text-align: center; font-size: 28px; font-weight: 800;
    margin-bottom: 8px; letter-spacing: -0.03em;
}
.auth-page .sub { text-align: center; color: var(--text-secondary); margin-bottom: 32px; font-size: 15px; }
.auth-tabs {
    display: flex; background: var(--fill); border-radius: 10px;
    padding: 3px; margin-bottom: 24px;
}
.auth-tab {
    flex: 1; padding: 8px; text-align: center;
    font-size: 14px; font-weight: 600;
    border: none; background: transparent; cursor: pointer;
    border-radius: 8px; transition: all 0.2s;
    font-family: inherit; color: var(--text-secondary);
}
.auth-tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* ===== 반응형 ===== */
@media (max-width: 960px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .product-detail-grid { grid-template-columns: 1fr; gap: 24px; }
    .product-gallery { position: static; }
    .shop-footer .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .shop-nav { display: none; }
    .hero { padding: 48px 20px; }
    .hero-content h1 { font-size: 30px; }
    .product-card .info { padding: 10px 12px; }
    .product-card .name { font-size: 13px; }
    .product-card .price { font-size: 14px; }
    .page-title { font-size: 28px; }
    .section-title { font-size: 20px; }
}
