/* ==========================================================================
   Components — 버튼, 폼, 테이블, 카드, 뱃지, 페이지네이션
   ========================================================================== */

/* ====================================================================
   Buttons
   ==================================================================== */
   .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius);
    transition: all var(--transition);
    background-color: #fff;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1.4;
  }
  
  .btn--primary {
    background: var(--primary);
    color: var(--white);
  }
  .btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
  }
  
  .btn--outline {
    background: var(--white);
    color: var(--primary);
    border-color: var(--primary);
  }
  .btn--outline:hover {
    background: var(--primary-light);
  }
  
  .btn--gray {
    background: var(--gray-100);
    color: var(--gray-600);
    border-color: var(--gray-200);
  }
  .btn--gray:hover {
    background: var(--gray-200);
    color: var(--gray-800);
  }
  
  .btn--accent {
    background: var(--accent);
    color: var(--white);
  }
  .btn--accent:hover {
    background: var(--accent-dark);
  }
  
  .btn--lg {
    padding: 14px 36px;
    font-size: var(--text-md);
  }
  
  .btn--sm {
    padding: 6px 14px;
    font-size: var(--text-sm);
  }
  
  .btn--full {
    width: 100%;
  }
  
  .btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
  }
  
  /* ====================================================================
     Forms
     ==================================================================== */
  .form-group {
    margin-bottom: 20px;
  }
  
  .form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 6px;
  }
  
  .form-label .required {
    color: var(--red);
    margin-left: 2px;
  }
  
  .form-input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    color: var(--black);
    transition: all var(--transition);
  }
  .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
    background: var(--white);
  }
  .form-input::placeholder {
    color: var(--gray-400);
  }
  
  .form-select {
    width: 100%;
    height: 46px;
    padding: 0 40px 0 16px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    color: var(--black);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: all var(--transition);
  }
  .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
    background-color: var(--white);
  }
  
  .form-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    color: var(--black);
    resize: vertical;
    transition: border-color var(--transition);
  }
  .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
  }
  
  .form-row {
    display: flex;
    gap: 12px;
  }
  .form-row > * {
    flex: 1;
  }
  
  .form-hint {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 4px;
  }
  
  .form-error {
    font-size: var(--text-xs);
    color: var(--red);
    margin-top: 4px;
  }
  
  .form-section {
    margin-bottom: 36px;
  }
  
  .form-section__title {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--black);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
  }
  
  /* File Upload */
  .file-upload {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .file-upload__btn {
    padding: 10px 20px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition);
  }
  .file-upload__btn:hover {
    background: var(--gray-200);
  }
  .file-upload__name {
    font-size: var(--text-sm);
    color: var(--gray-400);
  }
  .file-upload input[type="file"] {
    display: none;
  }
  
  /* ====================================================================
     Tables
     ==================================================================== */
  .table-wrap {
    overflow-x: auto;
  }
  
  .table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }
  
  .table thead th {
    padding: 14px 12px;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-100);
    text-align: center;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  .table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
  }
  .table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
  }
  
  .table tbody td {
    padding: 14px 12px;
    font-size: var(--text-sm);
    color: var(--gray-800);
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
  }

@media (min-wdith:768px){
  .table tbody tr:hover td {
    background: var(--primary-light);
  }
}
  
  
  .table tbody tr {
    cursor: pointer;
    transition: all var(--transition);
  }
  
  .table tbody tr.row--featured td {
    /* background: rgba(49, 130, 246, 0.03); */
  }
  .table tbody tr.row--featured:hover td {
    background: var(--primary-light);
  }
  
  /* 테이블 내 특정 컬럼 스타일 */
  .table .col-no {
    color: var(--gray-400);
    font-size: var(--text-xs);
  }
  
  .table .col-category {
    font-weight: 500;
    color: var(--primary);
  }
  
  .table .col-location {
    text-align: left;
    font-weight: 500;
  }
  
  .table .col-price {
    font-weight: 700;
    color: var(--black);
  }
  
  .table .col-date {
    font-size: var(--text-xs);
    color: var(--gray-400);
  }
  
  /* 추천 매물 행 */
  .table .row--featured {
    border-left: 3px solid var(--primary);
  }

  /* ====================================================================
     Cards
     ==================================================================== */
  .card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
  }
  .card:hover {
    border-color: var(--gray-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
  
  .card__body {
    padding: 16px;
  }
  
  .card__category {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
  }
  
  .card__location {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-bottom: 4px;
  }
  
  .card__info {
    display: flex;
    gap: 12px;
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-bottom: 10px;
  }
  
  .card__price {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--black);
    letter-spacing: -0.5px;
  }
  
  .card__price small {
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--gray-400);
    margin-left: 2px;
  }
  
  /* 추천 카드 */
  .card--featured {
    border-color: var(--primary);
  }
  
  /* ====================================================================
     Badges
     ==================================================================== */
  .badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: -0.2px;
    line-height: 1.3;
  }
  
  .badge--primary {
    background: var(--primary-light);
    color: var(--primary);
  }
  
  .badge--accent {
    background: #eef7dd;
    color: var(--accent-dark);
  }
  
  .badge--red {
    background: #fdeaea;
    color: var(--red);
  }
  
  .badge--gray {
    background: var(--gray-100);
    color: var(--gray-600);
  }
  
  /* ====================================================================
     Pagination
     ==================================================================== */
  .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
  }
  
  .pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: var(--text-sm);
    color: var(--gray-600);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
  }
  .pagination__item:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
  }
  .pagination__item--active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    font-weight: 600;
  }
  .pagination__item--active:hover {
    background: var(--primary-dark);
    color: var(--white);
  }
  .pagination__item--disabled {
    color: var(--gray-200);
    pointer-events: none;
  }
  
  /* ====================================================================
     Section Title
     ==================================================================== */
  .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }
  
  .section-title__text {
    font-size: 22px;
    font-weight: 800;
    color: var(--black);
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  
  .section-title__icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
    flex-shrink: 0;
  }
  
  .section-title__more {
    font-size: var(--text-sm);
    color: var(--gray-400);
    font-weight: 500;
    transition: color var(--transition);
  }
  .section-title__more:hover {
    color: var(--primary);
  }
  
  /* ====================================================================
     Tabs
     ==================================================================== */
  .tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .tab-item {
    padding: 8px 18px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition);
  }
  .tab-item:hover {
    color: var(--primary);
    border-color: var(--primary);
  }
  .tab-item--active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    font-weight: 600;
  }
  
  /* ====================================================================
     View Toggle (테이블/카드)
     ==================================================================== */
  .view-toggle {
    display: flex;
    gap: 4px;
  }
  
  .view-toggle__btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--transition);
  }
  .view-toggle__btn:hover,
  .view-toggle__btn--active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
  }
  
  /* ====================================================================
     Desktop Enhancement — PC 가독성 강화
     ==================================================================== */
  @media (min-width: 1200px) {
    /* 테이블 — 더 넉넉한 셀 패딩 */
    .table thead th {
      padding: 10px;
      font-size: 13px;
    }
  
    .table tbody td {
      padding: 10px;
      font-size: 13px;
    }
  
    /* 카드 — 더 넉넉한 본문 */
    .card__body {
      padding: 20px;
    }
  
    .card__category {
      font-size: 14px;
      margin-bottom: 8px;
    }
  
    .card__location {
      font-size: 14px;
      margin-bottom: 6px;
    }
  
    .card__info {
      font-size: 13px;
      gap: 14px;
      margin-bottom: 14px;
    }
  
    .card__price {
      font-size: 22px;
    }
  
    /* 뱃지 — 살짝 키움 */
    .badge {
      padding: 4px 10px;
      font-size: 12px;
    }
  
    /* 페이지네이션 — 더 넉넉한 크기 */
    .pagination {
      gap: 6px;
      margin-top: 40px;
    }
  
    .pagination__item {
      min-width: 40px;
      height: 40px;
      font-size: 14px;
    }
  
    /* 섹션 타이틀 — 더 큰 폰트 */
    .section-title {
      margin-bottom: 24px;
    }
  
    .section-title__text {
      font-size: 22px;
    }
  
    .section-title__more {
      font-size: 14px;
    }
  
    /* 탭 — 더 넉넉한 크기 */
    .tab-item {
      padding: 10px 22px;
      font-size: 14px;
    }
  
    /* 버튼 — 살짝 넉넉 */
    .btn {
      padding: 12px 28px;
      font-size: var(--text-base);
    }
  
    .btn--lg {
      padding: 16px 40px;
      font-size: var(--text-md);
    }
  
    /* 폼 — 더 넉넉한 높이 */
    .form-input {
      height: 46px;
      padding: 0 16px;
    }
  
    .form-select {
      height: 46px;
      padding: 0 40px 0 16px;
    }
  }
  
  /* ====================================================================
     Responsive
     ==================================================================== */
  @media (max-width: 767px) {
    .form-select {
      padding: 0 28px 0 10px;
      background-position: right 8px center;
    }

    /* ===== 모바일 매물 카드 ===== */
    .table {
      border-top: none;
    }
    .table thead {
      display: none;
    }
    .table tbody tr {
      display: block;
      padding: 14px 16px;
      margin-bottom: 8px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      position: relative;
      background: var(--white);
    }
    .table tbody td {
      display: inline;
      padding: 0;
      text-align: left;
      border: none;
      font-size: var(--text-sm);
    }
    .table tbody tr:hover td {
    }
  
    /* 번호: 숨김 */
    .table .col-no {
      display: none;
    }
  
    /* 분류: 뱃지 */
    .table .col-category {
      display: inline-block;
      font-size: 11px;
      font-weight: 700;
      color: var(--white);
      background: var(--primary);
      padding: 2px 8px;
      border-radius: 3px;
      vertical-align: middle;
    }
  
    /* 지역: 뱃지 옆 */
    .table .col-location {
      display: inline;
      font-size: 13px;
      font-weight: 500;
      color: var(--gray-600);
      margin-left: 6px;
      vertical-align: middle;
    }
  
    /* 날짜: 우상단 */
    .table .col-date {
      position: absolute;
      top: 14px;
      right: 16px;
      font-size: 11px;
      color: var(--gray-400);
    }
  
    /* 매물명: 제목 */
    .table .col-title {
      display: block;
      font-size: 15px;
      font-weight: 700;
      color: var(--black);
      white-space: normal;
      max-width: none;
      overflow: visible;
      text-overflow: unset;
      margin: 8px 0;
      line-height: 1.4;
    }
    .table .col-title .badge {
      vertical-align: middle;
    }
  
    /* 면적 · 원생: 한 줄 텍스트 */
    .table tbody td:nth-child(5) {
      display: inline;
      font-size: 13px;
      color: var(--gray-800);
      font-weight: 500;
    }
    .table tbody td:nth-child(5)::after {
      content: "평";
    }
    .table tbody td:nth-child(6) {
      display: inline;
      font-size: 13px;
      color: var(--gray-800);
      font-weight: 500;
    }
    .table tbody td:nth-child(5) + td::before {
      content: "  ·  ";
      color: var(--gray-300);
      font-weight: 400;
    }
  
    /* 보증금/월세: 라벨 + 값 한 줄 */
    .table tbody td:nth-child(7) {
      display: inline;
      font-size: 13px;
      color: var(--gray-800);
      font-weight: 500;
    }
    .table tbody td:nth-child(7)::before {
      content: "\A보증/월  ";
      white-space: pre;
      font-size: 12px;
      font-weight: 600;
      color: var(--gray-500);
    }
    .table tbody td:nth-child(7)::after {
      content: " / ";
      color: var(--gray-300);
    }
    .table tbody td:nth-child(8) {
      display: inline;
      font-size: 13px;
      color: var(--gray-800);
      font-weight: 500;
    }
  
    /* 권리금(매매가): 가장 크게 */
    .table .col-price {
      display: block;
      font-size: 20px;
      font-weight: 800;
      color: var(--primary);
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border-light);
      letter-spacing: -0.5px;
    }
    .table .col-price::before {
      content: "권리금 ";
      font-size: 12px;
      font-weight: 600;
      color: var(--gray-400);
      letter-spacing: 0;
    }
  
    /* 추천 행: 좌측 보더만 */
    .table .row--featured {
      border-left: 3px solid var(--primary);
    }
  
    /* --- 기존 반응형 유지 --- */
    .form-row {
      flex-direction: column;
      gap: 0;
    }
  
    .pagination {
      gap: 2px;
      margin-top: 16px;
    }
    .pagination__item {
      min-width: 32px;
      height: 32px;
      font-size: var(--text-xs);
    }
  
    .btn--lg {
      padding: 12px 24px;
      font-size: var(--text-base);
    }
  
    .tabs {
      overflow-x: auto;
      flex-wrap: nowrap;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .tabs::-webkit-scrollbar {
      display: none;
    }
    .tab-item {
      flex-shrink: 0;
      padding: 6px 14px;
      font-size: var(--text-xs);
    }
  }
  
  /* ====================================================================
     Button Ripple Effect
     ==================================================================== */
  .btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
  }
  
  @keyframes ripple {
    to {
      transform: translate(-50%, -50%) scale(40);
      opacity: 0;
    }
  }
  