/* App-style mobile article detail */
:root {
  --ma-brand: #ff6600;
  --ma-brand-pressed: #ff9364;
  --ma-text: #1a1c20;
  --ma-muted: #586070;
  --ma-border: #eeeff1;
  --ma-bg: #ffffff;
  --ma-page: #f7f8f9;
  --ma-topbar: rgba(255, 255, 255, 0.92);
  --ma-action-h: 3.25rem;
  --ma-safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-smoothing: antialiased; }
body.mobile-article-page {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: var(--ma-text);
  background: var(--ma-bg);
}

.mobile-desktop-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--ma-page);
}
.mobile-desktop-gate[hidden] { display: none !important; }
.mobile-desktop-gate__card {
  max-width: 360px;
  padding: 28px 24px;
  border-radius: 16px;
  background: var(--ma-bg);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.mobile-desktop-gate__title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 700;
}
.mobile-desktop-gate__desc {
  margin: 0 0 20px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ma-muted);
}

.mobile-app-shell {
  min-height: 100dvh;
  padding-bottom: calc(var(--ma-action-h) + 16px + var(--ma-safe-bottom));
}
.mobile-app-shell.is-desktop-blocked { display: none; }

.mobile-app-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px;
  background: transparent;
  pointer-events: none;
}
.mobile-app-topbar__group {
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
}
.mobile-app-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-app-icon-btn svg {
  width: 32px;
  height: 32px;
}
.mobile-app-icon-btn:active { opacity: 0.72; }

.mobile-app-main { background: var(--ma-bg); }

.mobile-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #111;
}
.mobile-gallery .mobile-app-topbar {
  z-index: 3;
}
.mobile-gallery__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.28s cubic-bezier(0.35, 0, 0.35, 1);
}
.mobile-gallery__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}
.mobile-gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mobile-gallery__arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}
.mobile-gallery__arrow--prev { left: 10px; }
.mobile-gallery__arrow--next { right: 10px; }
.mobile-gallery__arrow[hidden] { display: none; }
.mobile-gallery__arrow:active { opacity: 0.72; }
.mobile-gallery__counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.mobile-seller-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--ma-border);
}
.mobile-seller-card__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.mobile-seller-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ma-page);
  flex-shrink: 0;
}
.mobile-seller-card__info { min-width: 0; }
.mobile-seller-card__name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}
.mobile-seller-card__manner {
  flex-shrink: 0;
  text-align: right;
}
.mobile-manner-temp {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.mobile-manner-temp__value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #ff9500;
}
.mobile-manner-temp__label {
  display: block;
  margin-top: 2px;
  font-size: 0.6875rem;
  color: var(--ma-muted);
}

.mobile-product-body { padding: 16px 16px 24px; }
.mobile-product-status {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e8f5ff;
  color: #007aff;
  font-size: 0.75rem;
  font-weight: 700;
}
.mobile-product-status.is-reserved { background: #fff4e5; color: #ff9500; }
.mobile-product-status.is-sold { background: #f3f4f5; color: #868b94; }
.mobile-product-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
.mobile-product-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mobile-product-price {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
}
.mobile-product-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.25rem;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--ma-brand);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.mobile-product-meta {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  color: var(--ma-muted);
}
.mobile-product-meta__sep { margin: 0 4px; }
.mobile-product-desc {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.mobile-product-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--ma-muted);
}

.mobile-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px calc(8px + var(--ma-safe-bottom));
  background: var(--ma-bg);
  border-top: 1px solid var(--ma-border);
}
.mobile-action-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: #7b838e;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-action-fav__icon {
  width: 28px;
  height: 28px;
  display: block;
}
.mobile-action-fav__icon path {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mobile-action-fav.is-active { color: #ff6600; }
.mobile-action-fav.is-active .mobile-action-fav__icon path {
  fill: #ff6600;
  stroke: #ff6600;
}
.mobile-action-bar__divider {
  width: 1px;
  height: 32px;
  background: var(--ma-border);
}
.mobile-action-btn {
  flex: 1;
  min-width: 0;
  height: var(--ma-action-h);
  border: none;
  border-radius: 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-action-btn--chat {
  background: #e1e5ea;
  color: var(--ma-text);
  box-shadow: inset 0 0 0 1px rgba(26, 28, 32, 0.04);
}
.mobile-action-btn--buy {
  background: var(--ma-brand);
  color: #fff;
}
.mobile-action-btn--buy:active { background: var(--ma-brand-pressed); }
.mobile-action-btn--chat:active { background: #d4dae1; }

/* 로그인 플로우 */
.mobile-login {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--ma-bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-login[hidden] { display: none !important; }
.mobile-login-step[hidden] { display: none !important; }

.mobile-login-welcome {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.mobile-login-welcome__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(96px, 22vh, 160px) 32px 32px;
  text-align: center;
}
.mobile-login-logo {
  width: 92px;
  margin-bottom: 44px;
}
.mobile-login-logo svg {
  width: 100%;
  height: auto;
  display: block;
}
.mobile-login-welcome__title {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.35;
  color: #1a1c20;
}
.mobile-login-welcome__desc {
  margin: 14px 0 0;
  max-width: 300px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #868b94;
}
.mobile-login-welcome__footer {
  flex: none;
  padding: 12px 24px calc(20px + env(safe-area-inset-bottom, 0px));
}
.mobile-login-welcome__btn {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 12px;
  background: #ff6600;
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-login-welcome__btn:active { background: #ff7a26; }

.mobile-login-topbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding:
    calc(6px + env(safe-area-inset-top, 0px))
    16px 6px;
}
.mobile-login-topbar__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ma-text);
}
.mobile-login-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ma-text);
  cursor: pointer;
}
.mobile-login-back svg {
  width: 24px;
  height: 24px;
  display: block;
}

.mobile-login-phone-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 0;
}
.mobile-login-phone-hero__art {
  flex: none;
  width: 88px;
  height: 88px;
}
.mobile-login-phone-hero__art svg {
  width: 100%;
  height: 100%;
  display: block;
}
.mobile-login-phone-hero__text {
  margin: 8px 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ma-muted);
}

.mobile-login-phone-form {
  padding: 28px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}
.mobile-login-phone-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--ma-border);
  border-radius: 10px;
  background: var(--ma-bg);
  font-size: 1rem;
  color: var(--ma-text);
  outline: none;
}
.mobile-login-phone-input::placeholder { color: #b0b3ba; }
.mobile-login-phone-input:focus {
  border-color: #c9ccd1;
}
.mobile-login-phone-submit {
  width: 100%;
  height: 52px;
  margin-top: 16px;
  border: none;
  border-radius: 10px;
  background: #e8eaed;
  color: #868b94;
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: not-allowed;
  transition: background 150ms ease, color 150ms ease;
}
.mobile-login-phone-submit:not(:disabled) {
  background: #2d2f36;
  color: #fff;
  cursor: pointer;
}
.mobile-login-phone-submit:not(:disabled):active {
  background: #1a1c20;
}

.mobile-login-redirect {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  background: #fff;
}
.mobile-login-redirect__logo {
  width: 112px;
  margin-bottom: 12px;
  animation: login-logo-breathe 1.8s ease-in-out infinite;
}
.mobile-login-redirect__logo svg {
  width: 100%;
  height: auto;
  display: block;
}
.mobile-login-redirect__text {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 500;
  color: #868b94;
  letter-spacing: -0.02em;
  animation: login-fade-in 0.4s ease both;
}
.mobile-login-redirect__loader {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.mobile-login-redirect__loader span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff6600;
  opacity: 0.28;
  animation: login-loader-wave 1.1s ease-in-out infinite;
}
.mobile-login-redirect__loader span:nth-child(2) { animation-delay: 0.18s; }
.mobile-login-redirect__loader span:nth-child(3) { animation-delay: 0.36s; }
@keyframes login-logo-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.88; }
}
@keyframes login-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes login-loader-wave {
  0%, 70%, 100% { opacity: 0.28; transform: scale(0.9); }
  35% { opacity: 1; transform: scale(1); }
}

@media (min-width: 768px) {
  .mobile-app-shell:not(.force-mobile) { display: none; }
  .mobile-desktop-gate:not([hidden]) { display: flex; }
}
