/* Used Market Styles — public/css/used.css */
/* Mobile-first, consistent with 9bi design system */

/* 1. Header Sell Button */
.used_header_sell_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  box-sizing: border-box;
  /* R4-14: white on #d32f2f was 3.2:1 */
  background: #d32f2f;
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  line-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 6px rgba(255, 82, 82, 0.25);
  margin-left: 0;
  white-space: nowrap;
}
.used_header_sell_btn:hover {
  background: #b71c1c;
  transform: translateY(-1px);
}
.used_header_sell_btn_sm {
  /* R4-14: 36px tap target */
  height: 36px !important;
  line-height: 36px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  margin: 0 !important;
}

/* 2. Grid & Cards */
.used_grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 10px 0;
}
@media (min-width: 768px) {
  .used_grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}
@media (min-width: 1024px) {
  .used_grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

.used_card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ebebeb;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.used_card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.used_card_thumb_wrap {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  background: #f7f7f7;
  overflow: hidden;
}
.used_card_thumb_wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.used_card:hover .used_card_thumb_wrap img {
  transform: scale(1.03);
}

/* Badges & Overlay */
.used_badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  z-index: 2;
  color: #fff;
}
.used_badge_reserved {
  background: #ff9800;
}
.used_badge_sold {
  background: #616161;
}
/* R4-4: bottom-right only — with .used_badge also on the element (top/left set too) it stretched over the photo */
.used_badge_condition {
  position: absolute;
  top: auto;
  left: auto;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 4px;
  z-index: 2;
}

.used_dim_overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  z-index: 1;
}

.used_card_body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.used_card_title {
  font-size: 14px;
  font-weight: 500;
  color: #212121;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 6px;
}
.used_card_price {
  font-size: 17px;
  font-weight: 800;
  color: #111;
  margin-bottom: 6px;
}
.used_card_price small {
  font-size: 13px;
  font-weight: 400;
}
.used_card_meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #6b6b6b;
  margin-top: auto;
}
.used_card_region {
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. Used Write / Edit Page */
.used_write_container {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}
.used_write_title {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin-bottom: 24px;
  border-bottom: 2px solid #222;
  padding-bottom: 12px;
}
.used_form_row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
@media (min-width: 768px) {
  .used_form_row {
    flex-direction: row;
    gap: 20px;
  }
  .used_form_label {
    width: 140px;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 15px;
    padding-top: 8px;
  }
  .used_form_field {
    flex: 1;
  }
}
.used_form_label {
  font-weight: 600;
  font-size: 14px;
  color: #222;
}
.used_form_label .req {
  color: #d32f2f;
  margin-left: 2px;
}
.used_form_input,
.used_form_select,
.used_form_textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
/* reset.css input[type="text"|"number"|…] { padding: 0 10px; border-color: #dcdcdc } outranks a single class */
.used_form_input[type] {
  padding: 10px 12px;
  border: 1px solid #ddd;
}
.used_form_input:focus,
.used_form_select:focus,
.used_form_textarea:focus {
  border-color: #d32f2f;
}
.used_form_textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

/* Image Upload Preview Grid */
.used_image_grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.used_image_slot {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  border: 1px solid #ddd;
  overflow: hidden;
  background: #fafafa;
}
.used_image_slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.used_image_slot[draggable='true'] {
  cursor: grab;
}
.used_image_move {
  position: absolute;
  top: 4px;
  left: 4px;
  display: flex;
  gap: 2px;
}
.used_image_move button {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 18px;
  height: 18px;
  font-size: 9px;
  line-height: 18px;
  padding: 0;
  cursor: pointer;
}
.used_image_del_btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}
.used_image_upload_btn {
  width: 90px;
  height: 90px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b6b6b;
  font-size: 12px;
  background: #fff;
  transition: border-color 0.2s;
}
.used_image_upload_btn:hover {
  border-color: #d32f2f;
  color: #d32f2f;
}

/* Condition Chips */
.used_chip_group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.used_chip_btn {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #555;
  transition: all 0.2s;
}
.used_chip_btn.active {
  border-color: #d32f2f;
  background: #fff5f5;
  color: #d32f2f;
  font-weight: 700;
}

/* Bottom Action Bar for Mobile & Desktop */
.used_bottom_bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.used_bottom_bar_inner {
  max-width: 828px; /* = .used_write_container 860px minus its 16px side padding: buttons line up with the form */
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.used_cancel_btn {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #ced4da;
  border-radius: 8px;
  padding: 12px 28px;
  height: 48px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: background 0.2s;
}
.used_cancel_btn:hover {
  background: #e9ecef;
}
.used_submit_btn {
  background: #d32f2f;
  color: #fff;
  border: 1px solid #d32f2f;
  border-radius: 8px;
  padding: 12px 28px;
  height: 48px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: background 0.2s;
}
.used_submit_btn:hover {
  background: #e04040;
}
.used_submit_btn:disabled {
  background: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

/* 4. Used Filters Bar */
.used_filter_bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: #fdfdfd;
  border: 1px solid #eee;
  border-radius: 8px;
}
.used_filter_chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.used_filter_chip {
  /* R4-6: chips keep their width and go to the next line instead of shrinking */
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 12px; /* R4-16: 32px tap target */
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  border-radius: 999px;
  font-size: 13px;
  background: #f0f0f0;
  color: #444;
  text-decoration: none;
  transition: all 0.2s;
}
.used_filter_chip.active {
  background: #222;
  color: #fff;
  font-weight: 600;
}

/* 5. Used Detail Enhancements */
.used_detail_badge_row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.used_detail_condition_tag {
  display: inline-block;
  padding: 4px 10px;
  background: #f0f4ff;
  color: #2b569a;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
}
.used_detail_info_grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #f9f9f9;
  padding: 14px 18px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 13px;
}
.used_detail_info_item {
  display: flex;
  gap: 8px;
}
.used_detail_info_label {
  color: #6b6b6b;
  width: 70px;
  flex-shrink: 0;
}
.used_detail_info_value {
  color: #222;
  font-weight: 600;
}

/* ===== M2-1 shop page (/shop/[m_idx]) ===== */
.shop_wrap { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
.shop_head { display: flex; gap: 16px; align-items: flex-start; padding: 20px 0; border-bottom: 1px solid #eee; }
.shop_avatar { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 50%; background: #f1f1f1 url('/img/ico/profile_blank.png') center / cover no-repeat; border: 1px solid #e5e5e5; display: inline-block; }
.shop_avatar.sm { width: 36px; height: 36px; vertical-align: middle; margin-right: 8px; }
.shop_head_info { flex: 1 1 auto; min-width: 0; }
.shop_name { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shop_type { font-size: 12px; font-weight: 500; border: 1px solid #ccc; color: #666; border-radius: 4px; padding: 1px 6px; }
.shop_type.corp { border-color: #3d6afe; color: #3d68f6; }
.shop_stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; color: #555; }
.shop_stats small { color: #767676; font-size: 12px; }
.shop_stars { color: #ffb400; letter-spacing: 1px; }
.shop_stars .off { color: #ddd; }
.shop_intro { margin-top: 10px; font-size: 13px; color: #444; white-space: pre-wrap; line-height: 1.6; }
.shop_head_btn { flex: 0 0 auto; }
.shop_follow_btn { border: 1px solid #222; background: #fff; color: #222; border-radius: 4px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.shop_follow_btn.on { background: #222; color: #fff; }
.shop_follow_btn:disabled { opacity: 0.6; cursor: default; }
.shop_follow_cnt { margin-left: 6px; font-weight: 400; opacity: 0.8; }
.shop_tabs { display: flex; border-bottom: 1px solid #ddd; margin: 16px 0 20px; overflow-x: auto; }
.shop_tabs a { padding: 12px 16px; font-size: 15px; color: #666; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.shop_tabs a.on { color: #111; font-weight: 700; border-bottom-color: #111; }
.shop_tabs a em { font-style: normal; margin-left: 4px; color: #d32f2f; font-size: 13px; }
.shop_empty { padding: 60px 0; text-align: center; color: #6b6b6b; font-size: 14px; }
.shop_review_list li { padding: 16px 0; border-bottom: 1px solid #f0f0f0; }
.shop_review_head { display: flex; gap: 10px; align-items: center; font-size: 13px; color: #6b6b6b; }
.shop_review_goods { margin-top: 6px; font-size: 12px; color: #6b6b6b; }
.shop_review_text { margin-top: 6px; font-size: 14px; color: #333; white-space: pre-wrap; line-height: 1.6; }
.shop_follower_list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shop_follower_list a { display: flex; align-items: center; padding: 10px; border: 1px solid #eee; border-radius: 8px; font-size: 14px; color: #333; }
.used_seller_link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 768px) {
  .shop_avatar { width: 96px; height: 96px; }
  .shop_follower_list { grid-template-columns: repeat(4, 1fr); }
}

/* ===== M2/M3 item detail extras: follow, 채팅하기, 가격제안, 신고 ===== */
.used_detail_follow { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.used_detail_follow .shop_follow_btn { padding: 5px 10px; font-size: 12px; }
/* 신고하기 beside 팔로우: same height and corner, still drawn as a text link */
.used_detail_follow .used_report_link { min-height: 30px; border-radius: 4px; box-sizing: border-box; }
@media screen and (max-width: 768px) { .used_detail_follow .used_report_link { min-height: 32px; } }
.used_report_link { background: none; border: none; color: #6b6b6b; font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }
.view_top .vit_btn_wrap button.used_chat_btn,
.view_top .vit_btn_wrap button.used_offer_btn { flex: 1 1 0; height: 58px; border: 1px solid #222; background: #fff; color: #222; font-size: 18px; font-weight: 500; cursor: pointer; }
.view_top .vit_btn_wrap button.used_offer_btn { border-color: #e5322d; color: #d32f2f; }
.item_cartbtn .used_extra_li { display: flex; gap: 6px; }
.item_cartbtn .used_chat_btn,
.item_cartbtn .used_offer_btn { flex: 1 1 0; height: 100%; min-height: 48px; border: 1px solid #222; background: #fff; color: #222; font-size: 14px; font-weight: 600; }
.item_cartbtn .used_offer_btn { border-color: #e5322d; color: #d32f2f; }
.used_modal_dim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.used_modal { background: #fff; border-radius: 8px; width: 100%; max-width: 400px; padding: 22px 20px; }
.used_modal h4 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.used_modal_desc { font-size: 13px; color: #666; margin-bottom: 10px; }
.used_modal .used_form_input, .used_modal .used_form_textarea { width: 100%; box-sizing: border-box; }
.used_modal_btns { display: flex; gap: 8px; margin-top: 16px; }
.used_modal_btns button { flex: 1 1 0; height: 44px; border: 1px solid #ccc; background: #fff; border-radius: 4px; font-size: 14px; cursor: pointer; }
.used_modal_btns button.primary { background: #222; border-color: #222; color: #fff; font-weight: 600; }
.used_report_reasons { margin-bottom: 10px; }
.used_report_reasons li { padding: 5px 0; font-size: 14px; }
/* R4-6: the frame (border, radius, hover) is the wrapper, so the seller's name sits inside the card; it stays its own
   link next to the card's link (no <a> inside <a>) */
.used_card_wrap { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid #ebebeb; border-radius: 8px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.used_card_wrap:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); }
.used_card_wrap .used_card { flex: 1 1 auto; border: 0; border-radius: 0; }
.used_card_wrap .used_card:hover { transform: none; box-shadow: none; }
.used_card_seller { display: block; padding: 0 12px 12px; font-size: 12px; color: #6b6b6b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.used_card_seller:hover { color: #222; text-decoration: underline; }

/* ===== mypage: 가격제안 / 키워드 알림 ===== */
.used_offer_list li { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #f0f0f0; }
.used_offer_thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; }
.used_offer_info { flex: 1 1 auto; min-width: 0; }
.used_offer_title { display: block; font-size: 14px; color: #222; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.used_offer_price { margin-top: 4px; font-size: 13px; color: #6b6b6b; }
.used_offer_price strong { font-size: 15px; color: #d32f2f; }
.used_offer_meta { margin-top: 4px; font-size: 12px; color: #6b6b6b; }
.used_offer_meta .st_P { color: #3d68f6; }
.used_offer_meta .st_A { color: #0e8742; }
.used_offer_btns { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.used_offer_btns button, .used_offer_chat { min-width: 64px; height: 32px; border: 1px solid #ccc; background: #fff; border-radius: 4px; font-size: 13px; text-align: center; line-height: 30px; cursor: pointer; color: #333; }
.used_offer_btns button.primary { background: #222; border-color: #222; color: #fff; }
.used_keyword_form { display: flex; gap: 8px; }
.used_keyword_form input { flex: 1 1 auto; }
.used_keyword_form button { flex: 0 0 auto; padding: 0 18px; border: none; background: #222; color: #fff; border-radius: 4px; font-size: 14px; cursor: pointer; }
.used_keyword_form button:disabled { background: #bbb; cursor: default; }
.used_keyword_list { display: flex; flex-wrap: wrap; gap: 8px; }
.used_keyword_list li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #ddd; border-radius: 20px; font-size: 13px; }
.used_keyword_list button { border: none; background: none; color: #6b6b6b; font-size: 15px; cursor: pointer; line-height: 1; }

/* ===== M3-1 header popular keywords ===== */
.hd_popular { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 12px; color: #666; max-width: 520px; }
.hd_popular a { color: #555; white-space: nowrap; }
.hd_popular a:hover { color: #0068f0; }
.hd_popular a { display: inline-flex; align-items: center; }
/* rank badge: reset.css sets body letter-spacing -0.04em, which shrinks the digit box and pushes the digit right;
   use 0 spacing + equal-width digits so 1–10 all sit in the middle */
.hd_popular a em { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 16px; height: 16px; padding: 0 3px; margin-right: 5px; border-radius: 8px; box-sizing: border-box; background: #0068f0; color: #fff; font-style: normal; font-size: 12px; font-weight: 700; line-height: 16px; letter-spacing: 0; text-indent: 0; text-align: center; font-variant-numeric: tabular-nums; font-family: Arial, Helvetica, sans-serif; }
.hd_popular_tit { font-weight: 700; color: #222; }
.hd_popular.mo { padding: 10px 16px 14px; max-width: none; background: #fff; }
/* PC: the popular row sits under the search box. With it the top bar grows by 16px (92 → 108) and the menu bar
   moves down by the same amount, so the row keeps 8px from the search box and 10px from the menu below. */
.search_btn_wrap { position: relative; }
.search_btn_wrap > .hd_popular { position: absolute; top: 100%; left: 0; right: 0; margin-top: 8px; z-index: 5; overflow: hidden; height: 18px; line-height: 18px; }
#header02.has_popular { padding-top: 168px; }
#header02.has_popular .top { height: 108px; }
#header02.has_popular .bottom { top: 89px; }

/* mobile drawer: DB service links (tbl_header_menu) — longer labels wrap instead of overflowing the 110px column */
@media screen and (max-width: 768px) {
  #header_mobile .header_bot .mnb_list .tablist li.mnb_service a { line-height: 1.35 !important; padding-top: 15px !important; padding-bottom: 15px !important; padding-right: 8px !important; word-break: keep-all; }
}

/* mobile header: the Next-only buttons (랜딩페이지 제작 / 판매하기) take the right half, so the centred logo ran under
   them (390px: logo 140–250, buttons from 188). Logo sits next to the menu button instead; below 360px the
   랜딩페이지 제작 button hides (it is also in the drawer menu) */
@media screen and (max-width: 768px) {
  #header_mobile .inner { justify-content: flex-start !important; }
  #header_mobile .inner .logo { margin-left: 46px !important; } /* .inner has 15px padding: logo from 61px, 10px after the 36px menu button */
  #header_mobile .inner .logo a { max-width: 100px !important; }
}
@media screen and (max-width: 374px) {
  #header_mobile .hd_r_wrap .lp_builder_link_sm { display: none !important; }
}

/* very narrow phones (280–360px): the filter rows shrink to the bar instead of running past it */
@media (max-width: 360px) {
  .used_filter_bar div { min-width: 0; max-width: 100%; }
  .used_filter_bar input { max-width: 28vw; min-width: 0; }
}
