/* =============================================
   PartsHub - 산업자재 마켓플레이스 공통 스타일
   ============================================= */

:root {
  --primary: #1a3c6e;       /* 진한 네이비 - 신뢰/산업 */
  --primary-dark: #0f2547;
  --primary-light: #2a5298;
  --secondary: #f97316;     /* 주황 - 액션/강조 */
  --secondary-dark: #ea580c;
  --accent: #06b6d4;        /* 시안 - 포인트 */
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --font: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 15px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

button {
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: var(--transition);
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

input, select, textarea {
  font-family: var(--font);
  outline: none;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ======== BUTTONS ======== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ======== BADGES ======== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.badge-primary { background: #dbeafe; color: var(--primary); }
.badge-success { background: #dcfce7; color: var(--success); }
.badge-warning { background: #fef3c7; color: var(--warning); }
.badge-danger { background: #fee2e2; color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-accent { background: #cffafe; color: #0e7490; }

/* ======== HEADER ======== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.header-top {
  background: var(--primary);
  padding: 6px 0;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-top a {
  color: rgba(255,255,255,0.7);
}

.header-top a:hover {
  color: var(--white);
}

.header-main {
  padding: 14px 0;
}

.header-main .container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--secondary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--secondary);
}

.header-search {
  flex: 1;
  max-width: 580px;
}

.search-bar {
  display: flex;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.search-bar input {
  flex: 1;
  padding: 11px 16px;
  border: none;
  font-size: 14px;
  background: transparent;
}

.search-bar select {
  padding: 0 12px;
  border: none;
  border-left: 1px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 13px;
  color: var(--gray-600);
  min-width: 110px;
}

.search-bar button {
  background: var(--secondary);
  color: var(--white);
  padding: 0 18px;
  font-size: 16px;
}

.search-bar button:hover {
  background: var(--secondary-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  border-radius: var(--radius-sm);
  background: transparent;
}

.header-icon-btn i {
  font-size: 18px;
}

.header-icon-btn:hover {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.header-icon-btn.active {
  color: var(--secondary);
}

.badge-count {
  position: relative;
}

.badge-count::after {
  content: attr(data-count);
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.badge-count[data-count="0"]::after,
.badge-count[data-count=""]::after {
  display: none;
}

/* ======== NAV ======== */
.nav {
  background: var(--white);
  border-bottom: 2px solid var(--gray-200);
}

.nav .container {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-item {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.nav-sell-btn {
  margin-left: auto;
  padding: 8px 18px;
  background: var(--secondary);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
}

.nav-sell-btn:hover {
  background: var(--secondary-dark);
  color: var(--white);
}

/* ======== SECTION TITLE ======== */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-800);
}

.section-title h2 span {
  color: var(--primary);
}

.section-title a {
  font-size: 13px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-title a:hover {
  color: var(--primary);
}

/* ======== CARDS ======== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.part-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.part-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.part-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--gray-100);
}

.part-card-img-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--gray-400);
}

.part-card-body {
  padding: 14px;
}

.part-card-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.part-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-card-model {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.part-card-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.part-card-price small {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
}

.part-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
  font-size: 12px;
  color: var(--gray-500);
}

/* ======== 검증 배지 (카드용) ======== */
.part-card-verify-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  margin-bottom: 8px;
  width: fit-content;
}

.part-card-verify-badge.verify-pending-card {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

/* 검증완료인데 가품 판정(카드용) */
.part-card-verify-badge.verify-fake-card {
  color: #dc2626;
  background: #fee2e2;
  border-color: #fecaca;
}

/* ======== 판매완료 배지 (카드용) ======== */
.part-card-soldout-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--danger);
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-full);
  padding: 3px 8px;
  margin-bottom: 8px;
  width: fit-content;
}

/* ======== 검증 배지 (상세·검색용) ======== */
.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.verify-done {
  background: #e0f2fe;
  color: #0369a1;
  border: 1.5px solid #7dd3fc;
}

.verify-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1.5px solid #fde68a;
}

/* ERP 재고 연동 배지 (내 매물·검색 카드) */
.erp-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1.5px solid #2e7d32;
  white-space: nowrap;
}

.erp-link-badge--compact {
  font-size: 10px;
  padding: 2px 7px;
  gap: 4px;
}

/* 검증완료인데 가품 판정(상세·검색·마이페이지 공통) */
.verify-fake {
  background: #fee2e2;
  color: #dc2626;
  border: 1.5px solid #fecaca;
}

/* ======== 검증 상태 배지 (admin 테이블용) ======== */
.verify-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.vs-done {
  background: #0c4a6e;
  color: #7dd3fc;
  border: 1px solid #0369a1;
}

.vs-pending {
  background: #451a03;
  color: #fbbf24;
  border: 1px solid #78350f;
}

/* ======== 검증 완료 인라인 배지 (detail, mypage용) ======== */
.verify-inline-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #dbeafe;
  color: #1d4ed8;
  border: 1.5px solid #93c5fd;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.verify-inline-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fef3c7;
  color: #92400e;
  border: 1.5px solid #fde68a;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

/* ======== 검증 필터 체크박스 하이라이트 ======== */
.filter-checkbox.verify-filter-item {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-weight: 600;
  color: #0369a1;
}

.filter-checkbox.verify-filter-item.pending-item {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.part-card-seller {
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified-icon {
  color: var(--accent);
  font-size: 13px;
}

.condition-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
}

.condition-new { background: #dbeafe; color: #1d4ed8; }
.condition-unused { background: #dcfce7; color: #16a34a; }
.condition-used-a { background: #fef3c7; color: #d97706; }
.condition-used-b { background: #fee2e2; color: #dc2626; }

.wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--gray-400);
  box-shadow: var(--shadow-sm);
}

.wishlist-btn:hover {
  color: var(--danger);
}

.wishlist-btn.active {
  color: var(--danger);
}

.cart-add-btn {
  position: absolute;
  top: 10px;
  right: 48px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.cart-add-btn:hover {
  background: var(--primary);
  color: var(--white);
}

/* ======== 장바구니 페이지 ======== */
.cart-page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  padding: 28px 0 60px;
  align-items: start;
}

.cart-seller-group {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.cart-seller-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--white);
}

.cart-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  font-size: 13px;
}

.cart-table tr:last-child td {
  border-bottom: none;
}

.cart-product-cell {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.cart-product-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-product-title {
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
  line-height: 1.4;
}

.cart-product-title a:hover {
  color: var(--primary);
}

.cart-product-meta {
  font-size: 12px;
  color: var(--gray-500);
}

.cart-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cart-qty-control button {
  width: 28px;
  height: 32px;
  background: var(--gray-50);
  font-size: 16px;
  color: var(--gray-700);
}

.cart-qty-control button:hover {
  background: var(--gray-200);
}

.cart-qty-control .cart-qty-value {
  min-width: 48px;
  width: 48px;
  height: 32px;
  padding: 0 6px;
  text-align: center;
  border: none;
  border-left: 1.5px solid var(--gray-300);
  border-right: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  -moz-appearance: textfield;
  appearance: textfield;
}

.cart-qty-control .cart-qty-value::-webkit-outer-spin-button,
.cart-qty-control .cart-qty-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-summary-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  position: sticky;
  top: 16px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--gray-600);
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  padding-top: 12px;
  margin-top: 8px;
  border-top: 2px solid var(--gray-200);
}

.cart-row-invalid {
  opacity: 0.65;
  background: #fffbeb;
}

.cart-row-invalid .cart-invalid-msg {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
}

@media (max-width: 900px) {
  .cart-page-layout {
    grid-template-columns: 1fr;
  }
  .cart-table thead {
    display: none;
  }
  .cart-table tr {
    display: block;
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
  }
  .cart-table td {
    display: block;
    border: none;
    padding: 6px 0;
  }
}

/* ======== GRID ======== */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ======== TRUST BADGES ======== */
.trust-strip {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.9);
  padding: 10px 0;
}

.trust-strip .container {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.trust-item i {
  color: var(--secondary);
  font-size: 16px;
}

/* ======== PAGINATION ======== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 30px;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--white);
  border: 1px solid var(--gray-200);
}

.page-btn:hover {
  background: var(--gray-100);
  color: var(--primary);
  border-color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ======== STAR RATING ======== */
.stars {
  display: flex;
  gap: 2px;
}

.star {
  color: #fbbf24;
  font-size: 13px;
}

.star.empty {
  color: var(--gray-300);
}

/* ======== FORM STYLES ======== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label span {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.12);
}

.form-control::placeholder {
  color: var(--gray-400);
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.12);
  outline: none;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .form-control {
  flex: 1;
}

/* ======== TABS ======== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ======== ALERTS ======== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ======== MODAL ======== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-800);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 16px;
}

.modal-close:hover {
  background: var(--gray-200);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ======== FOOTER ======== */
.footer {
  background: var(--gray-900);
  color: rgba(255,255,255,0.7);
  padding: 50px 0 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo-text {
  font-size: 20px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: rgba(255,255,255,0.7);
}

.footer-social a:hover {
  background: var(--primary-light);
  color: var(--white);
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

.footer-col ul li a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

/* ======== LOADING ======== */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ======== CHIP FILTERS ======== */
.chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-300);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ======== SIDEBAR ======== */
.filter-sidebar {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  position: sticky;
  top: 80px;
}

.filter-section {
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-600);
}

.filter-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ======== TOAST ======== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--gray-800);
  color: var(--white);
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent); }

/* ======== RESPONSIVE ======== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .header-top { display: none; }

  .header-main .container {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-search {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }

  .nav .container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav .container::-webkit-scrollbar { display: none; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  
  .trust-strip .container { gap: 16px; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .container { padding: 0 14px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ======== UTILITY ======== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-gray { color: var(--gray-500); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 17px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.pt-8 { padding-top: 8px; }
.pt-16 { padding-top: 16px; }
.pt-24 { padding-top: 24px; }
.pb-24 { padding-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden; }
