/* ============================================
   Supplier Detail — Template 1
   카페24 디자인 완전 복제
   ============================================ */

/* ─── Reset & Base ─── */
.ms-page {
  background: #fff;
  min-height: 100vh;
}

/* 부모 vendor__inner 제약 해제 */
.vendor__inner:has(.ms-page) {
  max-width: none;
  padding: 0;
}

.ms-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── ① 공지 띠배너 ─── */
.ms-notice-bar {
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  color: #fff;
  letter-spacing: -0.01em;
}

/* ─── ② 배너 (풀폭 + Swiper 슬라이드, PC/모바일 분기) ─── */
.ms-banner {
  width: 100%;
  overflow: hidden;
}

.ms-banner img {
  width: 100%;
  display: block;
}

.ms-banner--swiper {
  position: relative;
}

.ms-banner-swiper-pc,
.ms-banner-swiper-mobile {
  width: 100%;
}

.ms-banner-swiper-pc .swiper-slide img,
.ms-banner-swiper-mobile .swiper-slide img {
  width: 100%;
  display: block;
}

.ms-banner-pagination-pc .swiper-pagination-bullet,
.ms-banner-pagination-mobile .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: #fff;
  opacity: 0.6;
}

.ms-banner-pagination-pc .swiper-pagination-bullet-active,
.ms-banner-pagination-mobile .swiper-pagination-bullet-active {
  opacity: 1;
  background: #fff;
}

.ms-banner-prev-pc,
.ms-banner-next-pc {
  color: #fff !important;
  --swiper-navigation-size: 28px;
}

.ms-banner-prev-pc::after,
.ms-banner-next-pc::after {
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* PC/모바일 배너 표시 분기 */
.ms-banner--mobile { display: none; }
.ms-banner--pc { display: block; }

@media (max-width: 768px) {
  .ms-banner--pc { display: none; }
  .ms-banner--mobile { display: block; }
  .ms-banner-prev-pc,
  .ms-banner-next-pc { display: none; }
}

/* ─── ③ 카테고리 원형 아이콘 ─── */
.ms-cate-row {
  display: flex;
  justify-content: center;
  gap: 36px;
  padding: 48px 0 44px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ms-cate-row::-webkit-scrollbar {
  display: none;
}

.ms-cate-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 80px;
}

.ms-cate-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}

.ms-cate-circle img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.ms-cate-circle svg {
  color: #999;
  width: 28px;
  height: 28px;
}

.ms-cate-initial {
  font-size: 20px;
  font-weight: 700;
  color: #999;
}

.ms-cate-name {
  font-size: 13px;
  color: #666;
  text-align: center;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: color 0.2s;
}

.ms-cate-item:hover .ms-cate-circle {
  border-color: #111;
}

.ms-cate-item:hover .ms-cate-name {
  color: #111;
}

.ms-cate-item.active .ms-cate-circle {
  border-color: #111;
  background: #fafafa;
}

.ms-cate-item.active .ms-cate-name {
  color: #111;
  font-weight: 700;
}

/* 서브카테고리 */
.ms-subcate-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  padding-bottom: 20px;
}

.ms-subcate-tab {
  padding: 6px 16px;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #999;
  text-decoration: none;
  transition: all 0.15s;
  background: #fff;
}

.ms-subcate-tab:hover {
  border-color: #111;
  color: #111;
}

.ms-subcate-tab.active {
  background: #111;
  border-color: #111;
  color: #fff;
  font-weight: 600;
}

/* ─── ④ 프로모 카드 2열 ─── */
.ms-promo-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.ms-promo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 36px;
  border-radius: 16px;
  min-height: 140px;
}

.ms-promo-card--hours {
  background: #f8f7f4;
}

.ms-promo-card--ship {
  background: linear-gradient(135deg, #fef3f2, #fef0ec);
}

.ms-promo-text {
  flex: 1;
}

.ms-promo-label {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.ms-promo-value {
  font-size: 13px;
  color: #888;
  margin: 0;
  line-height: 1.6;
  word-break: keep-all;
}

.ms-promo-icon {
  flex-shrink: 0;
  margin-left: 20px;
  color: #ccc;
}

.ms-promo-icon svg {
  width: 56px;
  height: 56px;
}

/* ─── 구분선 ─── */
.ms-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 0 0 56px;
}

/* ─── ⑤ 섹션 타이틀 — 카페24 스타일 ─── */
.ms-section-header {
  text-align: center;
  margin-bottom: 44px;
}

.ms-section-title {
  font-size: 26px;
  font-weight: 700;
  color: #111;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ms-section-sub {
  font-size: 14px;
  color: #aaa;
  margin: 0;
  font-weight: 400;
}

/* ─── 검색바 ─── */
.ms-search-bar {
  margin-bottom: 32px;
}

.ms-search-bar form {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.ms-search-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 4px 4px 12px;
  max-width: 300px;
  flex: 1;
  transition: border-color 0.15s;
}

.ms-search-inner:focus-within {
  border-color: #111;
}

.ms-search-inner svg {
  flex-shrink: 0;
  color: #ccc;
}

.ms-search-inner input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #333;
  outline: none;
  padding: 8px 0;
  min-width: 0;
}

.ms-search-inner input::placeholder {
  color: #ccc;
}

.ms-search-inner button {
  padding: 8px 18px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ms-search-inner button:hover {
  background: #000;
}

.ms-search-clear {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 12px;
  color: #999;
  text-decoration: none;
}

.ms-search-clear:hover {
  border-color: #111;
  color: #111;
}

/* ─── ⑥ 상품 그리드 4열 ─── */
.ms-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 24px;
}

/* ─── 상품 카드 — 카페24 완전 복제 ─── */
.ms-prd {
  display: flex;
  flex-direction: column;
}

/* 썸네일: 정사각, 배경 #f5f5f5, 라디우스 0 */
.ms-prd-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 0;
}

.ms-prd-thumb img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.ms-prd:hover .ms-prd-thumb img {
  opacity: 0.92;
}

/* 뱃지 */
.ms-prd-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.ms-prd-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* 품절 */
.ms-prd-soldout {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.ms-prd-soldout span {
  padding: 6px 16px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.ms-prd-soldout--partial span {
  background: rgba(255,152,0,0.85);
}

/* 상품 정보 영역 */
.ms-prd-info {
  padding: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 상품명 — 카페24: 작은 사이즈, 일반 weight, 2줄 */
.ms-prd-name {
  font-size: 13px;
  font-weight: 400;
  color: #333;
  text-decoration: none;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.ms-prd-name:hover {
  text-decoration: underline;
}

/* 가격 — 카페24: 할인%(빨강 볼드) + 가격(검정 볼드), 원가(회색 취소선) */
.ms-prd-price {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ms-price-original {
  font-size: 12px;
  color: #ccc;
  text-decoration: line-through;
  font-weight: 400;
  line-height: 1.4;
}

.ms-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.ms-price-percent {
  font-size: 16px;
  font-weight: 800;
  color: #e8344e;
  letter-spacing: -0.5px;
}

.ms-price-sale {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

/* 쿠폰가 */
.ms-coupon-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
}

.ms-coupon-percent {
  font-size: 12px;
  font-weight: 700;
  color: #3b82f6;
}

.ms-coupon-price {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
}

.ms-coupon-label {
  font-size: 10px;
  color: #999;
  padding: 1px 4px;
  background: #f0f4ff;
  border-radius: 2px;
}

/* ─── 빈 상태 ─── */
.ms-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  text-align: center;
}

.ms-empty svg {
  margin-bottom: 12px;
}

.ms-empty p {
  font-size: 14px;
  color: #aaa;
  margin: 0;
}

/* ─── 페이지네이션 — 카페24 스타일 ─── */
.ms-pagination {
  margin-top: 60px;
  padding-bottom: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.ms-pagination > * {
  list-style: none;
}

.ms-pagination li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 400;
  color: #aaa;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 0;
  transition: color 0.15s;
}

.ms-pagination a {
  text-decoration: none;
}

.ms-pagination a:hover li:not(.disabled):not(.active) {
  color: #111;
}

.ms-pagination li.active {
  color: #111;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ms-pagination li.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.ms-pagination .arrow {
  font-size: 0;
}

.ms-pagination .arrow::before {
  font-family: sans-serif;
  font-size: 14px;
  line-height: 1;
}

.ms-pagination .arrow-prev-2::before { content: "\00AB"; }
.ms-pagination .arrow-prev::before { content: "\2039"; font-size: 16px; }
.ms-pagination .arrow-next::before { content: "\203A"; font-size: 16px; }
.ms-pagination .arrow-next-2::before { content: "\00BB"; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1200px) {
  .ms-product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 16px;
  }
}

@media (max-width: 1024px) {
  .ms-container {
    padding: 0 20px;
  }

  .ms-cate-row {
    gap: 24px;
    padding: 36px 0 32px;
  }

  .ms-cate-circle {
    width: 68px;
    height: 68px;
  }

  .ms-cate-circle img {
    width: 38px;
    height: 38px;
  }

  .ms-promo-card {
    padding: 28px;
  }
}

@media (max-width: 768px) {
  .ms-container {
    padding: 0 16px;
  }

  .ms-cate-row {
    justify-content: flex-start;
    gap: 16px;
    padding: 28px 0;
  }

  .ms-cate-circle {
    width: 56px;
    height: 56px;
  }

  .ms-cate-circle img {
    width: 30px;
    height: 30px;
  }

  .ms-cate-name {
    font-size: 11px;
  }

  .ms-promo-cards {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 32px;
  }

  .ms-promo-card {
    padding: 24px;
    min-height: auto;
  }

  .ms-promo-icon svg {
    width: 40px;
    height: 40px;
  }

  .ms-section-title {
    font-size: 20px;
  }

  .ms-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 14px;
  }

  .ms-prd-name {
    font-size: 12px;
  }

  .ms-price-percent,
  .ms-price-sale {
    font-size: 14px;
  }

  .ms-price-original {
    font-size: 11px;
  }

  .ms-search-inner {
    max-width: 100%;
  }

  .ms-pagination {
    margin-top: 40px;
  }

  .ms-divider {
    margin-bottom: 36px;
  }
}

@media (max-width: 480px) {
  .ms-container {
    padding: 0 12px;
  }

  .ms-cate-row {
    gap: 14px;
    padding: 24px 0;
  }

  .ms-cate-circle {
    width: 52px;
    height: 52px;
  }

  .ms-cate-name {
    font-size: 10px;
  }

  .ms-promo-card {
    padding: 18px;
    border-radius: 10px;
  }

  .ms-promo-label {
    font-size: 13px;
  }

  .ms-section-title {
    font-size: 18px;
  }

  .ms-product-grid {
    gap: 24px 10px;
  }

  .ms-prd-name {
    font-size: 11px;
  }

  .ms-price-percent,
  .ms-price-sale {
    font-size: 13px;
  }
}