/* ---------------------------------------------------------------------------
   AliExpress Hot Deals — marketplace commerce look
   Accent: coral / marketplace red · Type: Sora + Outfit
--------------------------------------------------------------------------- */

:root {
  --bg-deep: #0f1419;
  --bg-mid: #1a222c;
  --surface: #ffffff;
  --surface-soft: #f7f4f1;
  --ink: #1c2430;
  --ink-muted: #5c6675;
  --accent: #e62e04;
  --accent-deep: #c42500;
  --accent-soft: rgba(230, 46, 4, 0.12);
  --sale: #e62e04;
  --strike: #8a93a0;
  --border: rgba(28, 36, 48, 0.08);
  --shadow: 0 12px 32px rgba(15, 20, 25, 0.12);
  --shadow-lift: 0 20px 40px rgba(15, 20, 25, 0.18);
  --radius: 14px;
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Outfit", "Segoe UI", sans-serif;
  --max: 1120px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Atmosphere background */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(230, 46, 4, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 0%, rgba(255, 140, 60, 0.18), transparent 50%),
    radial-gradient(ellipse 70% 40% at 50% 100%, rgba(40, 70, 100, 0.35), transparent 55%),
    linear-gradient(165deg, #121820 0%, #1e2834 45%, #162028 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* Header — page entrance */
.site-header {
  padding: 2.75rem 1.25rem 1.5rem;
  animation: fade-rise 0.7s var(--ease-out) both;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.15;
}

.tagline {
  margin: 0.65rem 0 0;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 400;
}

.header-cta {
  margin: 0.85rem 0 0;
}

.tg-link {
  color: #ffb89a;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  font-size: 0.92rem;
  font-weight: 500;
}

.tg-link:hover {
  color: #ffd0bc;
}

.page-shop .site-footer a {
  color: #ffb89a;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.site-header--shop .header-inner {
  text-align: center;
}

.brand--admin {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
}

.nav-link--shop {
  color: #ffb89a !important;
  font-weight: 600 !important;
}

.site-main {
  padding: 0.5rem 1.25rem 3rem;
  animation: fade-rise 0.75s var(--ease-out) 0.12s both;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.site-main--shop {
  gap: 0;
}

.deals-section {
  width: 100%;
}

.section-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  text-align: center;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.section-head .section-title {
  margin-bottom: 0.35rem;
}

.section-count {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* 분류 탭 (캠핑용품 / 스마트기기 / 홈데코) */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.category-tab {
  padding: 0.5rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.category-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.category-tab.is-active {
  background: #fff;
  border-color: #fff;
  color: #14121f;
  font-weight: 600;
}

.load-more {
  display: block;
  margin: 2rem auto 0;
  padding: 0.85rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.load-more:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.page-admin .site-footer a {
  color: #ffb89a;
  text-decoration: underline;
}

/* Panels */
.panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.panel__head {
  margin-bottom: 1.25rem;
}

.panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.panel__desc {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Stats dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  animation: card-in 0.5s var(--ease-out) both;
}

.stat-card--wide {
  grid-column: 1 / -1;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
}

.stat-card__label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

.stat-card__hint {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
}

.stat-card--error .stat-card__label {
  color: #ffc9b8;
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.stat-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  background: rgba(230, 46, 4, 0.2);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
}

/* Search form */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.search-form__row {
  display: flex;
  gap: 0.65rem;
}

.search-form__row input[type="search"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.search-form__row input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.search-form__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.search-form__filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}

.search-form__filters select,
.search-form__filters input[type="number"] {
  padding: 0.45rem 0.65rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  min-width: 120px;
}

.btn {
  padding: 0.75rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s var(--ease-out);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, #f03a12 0%, var(--accent-deep) 100%);
  white-space: nowrap;
}

.btn--primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Orders table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.orders-table th,
.orders-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.orders-table th {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.orders-table td {
  color: rgba(255, 255, 255, 0.85);
}

.orders-table code {
  font-size: 0.78rem;
  color: rgba(255, 200, 180, 0.9);
}

.orders-table__empty,
.orders-table__error {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 2rem !important;
}

.commission-cell {
  color: #ffb89a;
  font-weight: 600;
}

.order-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  white-space: nowrap;
}

/* Link tool */
.link-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  resize: vertical;
}

.link-results {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.link-result {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.link-result__src {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  word-break: break-all;
}

.link-result__promo {
  font-size: 0.85rem;
  color: #ffb89a;
  word-break: break-all;
}

.link-results__error {
  color: #ffc9b8;
}

.product-card__meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.product-card__desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__cta--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.footer-note {
  margin-top: 0.5rem !important;
  font-size: 0.75rem !important;
  color: rgba(255, 255, 255, 0.35) !important;
}

.footer-note code {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Status: loading / empty / error */
.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 220px;
  padding: 2rem 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.status[hidden] {
  display: none;
}

.status--error {
  color: #ffc9b8;
  border-color: rgba(230, 46, 4, 0.35);
  background: rgba(230, 46, 4, 0.12);
}

.status--empty .status__text {
  color: rgba(255, 255, 255, 0.78);
}

.status__spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.status:not(.status--loading) .status__spinner {
  display: none;
}

.status__text {
  font-size: 1.05rem;
  max-width: 28rem;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-grid[hidden] {
  display: none;
}

/* Cards */
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
  animation: card-in 0.55s var(--ease-out) both;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}

.product-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.product-card__media {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #ebe6e1, #f5f2ee);
  overflow: hidden;
}

.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out), transform 0.45s var(--ease-out);
}

.product-card__img.is-loaded {
  opacity: 1;
}

.product-card:hover .product-card__img.is-loaded {
  transform: scale(1.04);
}

.product-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1;
  padding: 0.28rem 0.55rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.65rem;
  padding: 1rem 1rem 1.15rem;
}

.product-card__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.product-card__pricing {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.65rem;
  margin-top: auto;
}

.product-card__price {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sale);
  letter-spacing: -0.02em;
}

.product-card__original {
  font-size: 0.85rem;
  color: var(--strike);
  text-decoration: line-through;
}

.product-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, #f03a12 0%, var(--accent-deep) 100%);
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s var(--ease-out);
}

.product-card__cta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.product-card__cta:active {
  transform: translateY(0);
}

.product-card__cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-footer {
  padding: 1.5rem 1.25rem 2.5rem;
  text-align: center;
  animation: fade-rise 0.7s var(--ease-out) 0.2s both;
}

.site-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Motions */
@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 520px) {
  .site-header {
    padding-top: 2rem;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-form__row {
    flex-direction: column;
  }

  .panel {
    padding: 1.1rem;
  }

  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .product-card__body {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .product-card__name {
    font-size: 0.82rem;
    min-height: 2.5em;
  }

  .product-card__price {
    font-size: 1.05rem;
  }

  .product-card__cta {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .product-card:hover {
    transform: none;
  }

  .product-card:hover .product-card__img.is-loaded {
    transform: none;
  }
}
