@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Pinyon+Script&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url("https://use.typekit.net/vzz6djc.css");

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

:root {
  --header-h: 40px;
  --line: #e9e9e9;
  --text: #111;
  --gray: #999;
  --bg-soft: #f5f5f5;
}

html, body { height: 100%; }
body {
  font-family: 'futura-pt', 'Pretendard', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
ul { list-style: none; }

/* ===== Header ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.logo { font-family: 'Pinyon Script', cursive; font-size: 26px; line-height: 1; }
.gnb { display: flex; gap: 50px; padding-left: 0; }
.gnb a:hover, .util a:hover, .sub-nav a:hover { opacity: .5; }
.util { display: flex; justify-content: flex-end; gap: 52px; }

main { padding-top: var(--header-h); }

/* ===== Home ===== */
.hero { position: relative; height: calc(100vh - var(--header-h)); overflow: hidden; }
.hero img { height: 100%; object-fit: cover; object-position: center top; }
.hero-copy {
  position: absolute; left: 12px; bottom: 24px;
  font-size: 30px; font-weight: 500; letter-spacing: .02em;
  color: #111;
}

/* ===== Shop ===== */
.sub-nav {
  position: sticky; top: var(--header-h); z-index: 50;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  height: 36px; align-items: center;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 12px;
}
.sub-nav ul { grid-column: 2; display: flex; gap: 50px; }
.sub-nav a.active { text-decoration: underline; text-underline-offset: 3px; }

.product-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; padding: 12px 12px 80px;
  background: #fff;
}
.product-card .thumb { aspect-ratio: 386 / 499; overflow: hidden; background: #eef0f5; }
.product-card .thumb img { height: 100%; object-fit: cover; transition: transform .6s; }
.product-card:hover .thumb img { transform: scale(1.03); }
.product-card .info { display: flex; justify-content: space-between; padding: 14px 12px 14px 0; }
.product-card.hide { display: none; }

/* ===== Product detail ===== */
.detail {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  min-height: calc(100vh - var(--header-h));
  border-bottom: 1px solid var(--line);
}
.detail > div + div { border-left: 1px solid var(--line); }
.breadcrumb { align-self: start; padding: 12px; font-size: 13px;  display: flex; gap: 8px; align-items: center; }
.breadcrumb .home { color: var(--gray); }
.breadcrumb .arrow { color: #ccc; font-weight: 400; }
.detail-img { padding: 8px 10px; }
.detail-img img { aspect-ratio: 386 / 499; object-fit: cover; }

.detail-info { padding: 22px 16px; }
.detail-info .row { display: flex; justify-content: space-between; align-items: center; }
.detail-info .title { margin-bottom: 22px; }
.option-box { background: var(--bg-soft); border-top: 1px solid var(--line); }
.option-box .label { padding: 12px 10px; font-size: 11px; border-bottom: 1px solid var(--line); }
.option-box .row { padding: 10px; }
.qty { display: flex; border: 1px solid #ddd; background: #fff; }
.qty button, .qty input { width: 24px; height: 22px; text-align: center; }
.qty input { border: 0; border-left: 1px solid #ddd; border-right: 1px solid #ddd; font: inherit; font-size: 11px; }
.qty button { font-size: 12px; color: #666; }
.detail-info .total { padding: 20px 0; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btns button { height: 38px; font-weight: 600; letter-spacing: .02em; border: 1px solid #000; }
.btn-buy { background: #000; color: #fff; }
.btn-bag { background: #fff; border-color: #ddd !important; }

.accordion { margin-top: 56px; }
.acc-head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 4px 0; text-align: left; }
.acc-head .icon { font-size: 20px; font-weight: 400; line-height: 1; }
.acc-body { display: none; padding: 8px 0 14px; font-size: 12px; line-height: 1.7; color: #555; }
.acc-item.open .acc-body { display: block; }

/* ===== Collection ===== */
.collection {
  display: grid; grid-template-columns: 1fr 2fr;
  min-height: calc(100vh - var(--header-h));
  border-bottom: 1px solid var(--line);
}
.collection-text { padding: 12px; border-right: 1px solid var(--line); }
.collection-text h2 { font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.collection-text p { line-height: 1.5; }
.collection-visual { position: relative; padding: 8px 10px; }
.collection-visual img { aspect-ratio: 782 / 520; object-fit: cover; }

/* ===== Footer ===== */
.footer {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 30px 12px 60px;
  font-size: 13px; line-height: 1.85;
}
.footer-links a:hover { opacity: .5; }
.footer-copy { text-align: right; }

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .header { grid-template-columns: auto 1fr; gap: 12px; }
  .gnb { gap: 16px; justify-content: center; }
  .util { display: none; }
  .sub-nav { grid-template-columns: 1fr; overflow-x: auto; }
  .sub-nav ul { grid-column: 1; gap: 20px; margin: 0; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .detail, .collection { grid-template-columns: 1fr; }
  .detail > div + div, .collection-text { border: 0; }
}

/* ===== Right Drawer ===== */
.util button { font-size: 13px; }
.util button.on { text-decoration: underline; text-underline-offset: 3px; }
.bag-count:not(:empty)::before { content: ' ('; }
.bag-count:not(:empty)::after { content: ')'; }

.dim {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 90;
  background: rgba(255,255,255,.55);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.drawer {
  position: fixed; top: var(--header-h); right: 0; bottom: 0; z-index: 95;
  width: 20%; min-width: 360px;
  background: #fff; border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .4s cubic-bezier(.2,.7,.2,1);
  overflow-y: auto;
}
body.drawer-open { overflow: hidden; }
body.drawer-open .dim { opacity: 1; visibility: visible; }
body.drawer-open .drawer { transform: none; }

.drawer-close { position: absolute; top: 22px; right: 16px; font-size: 12px; color: var(--gray); }
.drawer-close:hover { color: var(--text); }
.panel { display: none; padding: 22px 16px 40px; min-height: 100%; flex-direction: column; }
.panel.active { display: flex; }
.panel-title { font-size: 13px; font-weight: 500; margin-bottom: 36px; }
.muted { color: var(--gray); font-size: 12px; }

.field {
  width: 100%; height: 40px; border: 0; border-bottom: 1px solid #ddd;
  font: inherit; font-size: 13px; outline: none; background: transparent;
}
.field:focus { border-bottom-color: #000; }
.field::placeholder { color: #bbb; }

.btn { width: 100%; height: 40px; font-weight: 600; letter-spacing: .02em; border: 1px solid #000; }
.btn-black { background: #000; color: #fff; }
.btn-line { background: #fff; border-color: #ddd; }
.btn:hover { opacity: .8; }

/* Search */
.search-keywords { margin-top: 28px; }
.search-keywords ul { display: flex; gap: 18px; margin-top: 10px; }
.search-keywords button:hover { opacity: .5; }
.search-result { margin-top: 28px; display: grid; gap: 14px; }
.search-result a { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.search-result img, .bag-item img { aspect-ratio: 386/499; object-fit: cover; background: #eef0f5; }
.search-result .none { color: var(--gray); font-size: 12px; }

/* Login */
.login-form { display: grid; gap: 8px; }
.login-opt { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 22px; font-size: 12px; color: #666; }
.login-opt label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.login-opt input { accent-color: #000; }
.login-opt a:hover { color: #000; }
.link-guest { margin-top: 24px; text-decoration: underline; text-underline-offset: 3px; }

/* Bag */
.bag-list { display: grid; gap: 18px; }
.bag-item { display: grid; grid-template-columns: 80px 1fr; gap: 14px; }
.bag-item .meta { display: flex; flex-direction: column; justify-content: space-between; }
.bag-item .row { display: flex; justify-content: space-between; align-items: center; }
.bag-item .remove { font-size: 11px; color: var(--gray); text-decoration: underline; }
.bag-empty { display: none; }
.panel.is-empty .bag-empty { display: block; }
.panel.is-empty .bag-foot { display: none; }
.bag-foot { margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.bag-foot .row { display: flex; justify-content: space-between; }
.bag-foot .muted { margin-bottom: 10px; }

@media (max-width: 768px) {
  .drawer { width: 100%; min-width: 0; }
  .footer { grid-template-columns: 1fr; gap: 24px; }
  .footer-copy { text-align: left; }
  .hero { height: auto; }
  .hero img { height: auto; }
}

/* ===== Mobile Menu ===== */
.menu-btn, .m-login { display: none; }
@media (max-width: 768px) {
  .header { grid-template-columns: 1fr auto 1fr; gap: 0; }
  .menu-btn { display: flex; flex-direction: column; gap: 5px; width: 20px; justify-self: start; }
  .menu-btn span { display: block; height: 1px; background: #111; transition: transform .3s; }
  body.menu-open .menu-btn span:first-child { transform: translateY(3px) rotate(45deg); }
  body.menu-open .menu-btn span:last-child { transform: translateY(-3px) rotate(-45deg); }
  .logo { justify-self: center; }
  .util { display: flex; gap: 14px; padding-right: 0; }
  .util [data-open="login"] { display: none; }
  .gnb {
    display: flex; flex-direction: column; justify-content: flex-start; gap: 20px;
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; z-index: 96;
    padding: 28px 12px; background: #fff; font-size: 15px;
    transform: translateX(-100%); transition: transform .4s cubic-bezier(.2,.7,.2,1);
  }
  body.menu-open { overflow: hidden; }
  body.menu-open .gnb { transform: none; }
  .m-login { display: block; text-align: left; margin-top: 16px; font-size: 15px; color: var(--gray); }
}