/* 기본 레이아웃 */
* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Arial, 'Noto Sans KR', sans-serif;
  background: #f5f7fb;
  color: #1f2937;
  line-height: 1.5;
}

.wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 18px;
}

.narrow {
  max-width: 560px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.brand {
  font-size: 24px;
  font-weight: 800;
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
  margin-bottom: 18px;
}

h1, h2 {
  margin: 0 0 14px;
  line-height: 1.25;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
}

input, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
}

textarea {
  resize: vertical;
}

button, .btn {
  display: inline-block;
  margin-top: 14px;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.btn.secondary {
  background: #111827;
}

.btn.light {
  background: #e5e7eb;
  color: #111827;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  align-items: start;
}

.product-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  word-break: keep-all;
}

.muted {
  color: #6b7280;
  font-size: 14px;
}

.linkbox {
  background: #f9fafb;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  word-break: break-all;
  font-size: 13px;
}

.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px;
  border-radius: 10px;
}

.ok {
  background: #dcfce7;
  color: #166534;
  padding: 10px;
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  background: #f3f4f6;
}

.pill {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

.warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 18px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.product-meta {
  margin: 10px 0;
}

.share-link-title {
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 6px;
}

/* 상품 대표이미지 */
.product-card {
  overflow: hidden;
}

.product-thumb {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: contain;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  margin: 0 0 12px;
}

.product-thumb.large {
  width: 100%;
  height: 260px;
  object-fit: contain;
}

.product-main-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  margin: 0 0 16px;
}

.image-preview-wrap {
  margin-top: 10px;
}

.hidden {
  display: none !important;
}

/* 이미지형 SNS 공유 버튼 */
.share-wrap {
  margin-top: 16px;
}

.share-title {
  font-weight: 800;
  margin: 8px 0 10px;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
}

/* 중요: 위쪽의 button 기본 CSS가 공유 이미지 버튼을 깨뜨리지 않도록 완전히 재정의 */
.share-icon-card,
button.share-icon-card,
a.share-icon-card {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 104px;
  margin: 0 !important;
  padding: 10px 6px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 15px !important;
  background: #ffffff !important;
  color: #111827 !important;
  text-decoration: none !important;
  box-shadow: 0 5px 14px rgba(15,23,42,.05);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  line-height: 1.2;
}

.share-icon-card img {
  display: block;
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
  margin: 0;
}

.share-icon-card span {
  display: block;
  width: 100%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  color: #111827;
  word-break: keep-all;
}

.share-icon-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(15,23,42,.08);
}

.share-icon-card:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.share-icon-card.kakao { background: #fffdf0 !important; }
.share-icon-card.facebook { background: #f5f9ff !important; }
.share-icon-card.x,
.share-icon-card.threads { background: #f8fafc !important; }
.share-icon-card.naver,
.share-icon-card.band,
.share-icon-card.line { background: #f2fff7 !important; }
.share-icon-card.telegram { background: #f3fbff !important; }
.share-icon-card.whatsapp { background: #f1fff7 !important; }
.share-icon-card.sms { background: #faf5ff !important; }
.share-icon-card.email { background: #f8fafc !important; }
.share-icon-card.copy { background: #f9fafb !important; }

.share-help {
  margin: 8px 0 0;
}

@media (max-width: 640px) {
  .wrap {
    padding: 18px 12px;
  }

  .top {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    font-size: 21px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .product-thumb {
    height: 210px;
  }

  .product-thumb.large {
    height: 230px;
  }

  .share-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .share-icon-card,
  button.share-icon-card,
  a.share-icon-card {
    min-height: 94px;
    padding: 8px 4px !important;
  }

  .share-icon-card img {
    width: 44px;
    height: 44px;
  }

  .share-icon-card span {
    font-size: 11px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}


.title-link{color:inherit;text-decoration:none}.title-link:hover{text-decoration:underline}.compact-actions{margin-top:8px}.compact-actions .btn{margin-top:0}.product-detail h1{line-height:1.28}.product-card h2.product-title{margin:8px 0 6px;font-size:18px;line-height:1.35}


/* v9 동영상 업로드/마우스오버 재생 */
.media-link {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-video,
.product-main-video {
  width: 100%;
  background: #000;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  display: block;
  object-fit: cover;
}

.product-video {
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
}

.product-video.preview {
  aspect-ratio: 16 / 9;
  max-height: 320px;
  margin-top: 10px;
  object-fit: contain;
}

.product-main-video {
  aspect-ratio: 16 / 9;
  max-height: 460px;
  object-fit: contain;
  margin-bottom: 16px;
}

.video-badge {
  position: absolute;
  left: 10px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(17,24,39,.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.video-preview-wrap {
  margin-top: 10px;
}

input[type="file"] {
  background: #fff;
}

@media (hover: hover) {
  .product-card:hover .video-badge {
    background: rgba(37,99,235,.9);
  }
}

@media (max-width: 640px) {
  .product-video,
  .product-thumb {
    aspect-ratio: 16 / 10;
  }

  .video-badge {
    bottom: 20px;
    font-size: 11px;
  }
}


/* v10 관리자 수정 기능 */
.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.manage-table th,
.manage-table td {
  vertical-align: middle;
}

.manage-media-cell {
  width: 110px;
}

.manage-thumb,
.manage-video {
  width: 92px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
  border: 1px solid #e5e7eb;
  display: block;
}

.btn.mini {
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1;
}

.btn.danger,
button.danger {
  background: #dc2626;
  color: #fff;
}

.danger-card {
  border-color: #fecaca;
  background: #fffafa;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-weight: 700;
}

.checkline input {
  width: auto;
}

.edit-video {
  margin-bottom: 10px;
}

@media (max-width: 640px) {
  .manage-media-cell {
    width: 86px;
  }

  .manage-thumb,
  .manage-video {
    width: 74px;
    height: 58px;
  }

  .manage-table th,
  .manage-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
}
