/* 기본 설정 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR",
    sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

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

/* 헤더 */
.header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  color: #2563eb;
}

.logo i {
  margin-right: 8px;
  font-size: 28px;
}

.nav-center {
  display: flex;
  justify-content: center;
  flex: 1;
  max-width: 500px;
  margin: 0 30px;
}

.search-bar {
  display: flex;
  width: 100%;
  max-width: 400px;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px 0 0 8px;
  font-size: 16px;
  outline: none;
  height: 44px;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: #2563eb;
}

.search-btn {
  padding: 10px 20px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background 0.3s;
  height: 44px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: #1d4ed8;
}

.main-nav {
  display: flex;
  gap: 30px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  text-decoration: none;
  color: #6b7280;
  border-radius: 8px;
  transition: all 0.3s;
  height: 44px;
  box-sizing: border-box;
}

.nav-item:hover,
.nav-item.active {
  color: #2563eb;
  background: #eff6ff;
}

.nav-item i {
  margin-right: 5px;
}

.mobile-menu-toggle {
  display: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 20px;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  text-decoration: none;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
}

.mobile-nav-item:last-child {
  border-bottom: none;
}

.mobile-nav-item i {
  margin-right: 10px;
  width: 20px;
}

/* 스티키 검색바 */
.sticky-search-bar {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  z-index: 999;
  transform: translateY(-100%);
  transition: all 0.3s ease;
  opacity: 0;
}

.sticky-search-bar.active {
  transform: translateY(0);
  opacity: 1;
}

.sticky-search-bar .container {
  padding: 15px 20px;
  display: flex;
  justify-content: center;
}

.sticky-search {
  display: flex;
  width: 100%;
  max-width: 500px;
}

.sticky-search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px 0 0 8px;
  font-size: 16px;
  outline: none;
  height: 46px;
  box-sizing: border-box;
}

.sticky-search-input:focus {
  border-color: #2563eb;
}

.sticky-search-btn {
  padding: 12px 20px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background 0.3s;
  height: 46px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-search-btn:hover {
  background: #1d4ed8;
}

/* 메인 컨텐츠 */
.main-content {
  margin-top: 70px;
  min-height: calc(100vh - 70px);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* 히어로 배너 */
.hero-banner {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
}

.hero-banner h1 {
  font-size: 48px;
  margin-bottom: 20px;
  font-weight: bold;
}

.hero-banner p {
  font-size: 20px;
  margin-bottom: 40px;
  opacity: 0.9;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 0;
}

.hero-search input {
  flex: 1;
  padding: 18px 24px;
  border: none;
  border-radius: 12px 0 0 12px;
  font-size: 18px;
  outline: none;
}

.hero-search button {
  padding: 18px 30px;
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.3s;
}

.hero-search button:hover {
  background: #d97706;
}

/* 섹션 공통 */
section {
  padding: 60px 0;
}

section h2 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 50px;
  color: #1f2937;
}

/* 브랜드 카테고리 */
.brand-categories {
  background: white;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.brand-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.brand-item:hover {
  background: #eff6ff;
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.15);
}

.brand-icon {
  width: 80px;
  height: 80px;
  background: #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: white;
  font-size: 32px;
}

.brand-item span {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

/* 부품 카테고리 */
.part-categories {
  background: #f8f9fa;
}

.part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.part-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  background: white;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.part-item:hover {
  background: #fff7ed;
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.15);
}

.part-icon {
  width: 80px;
  height: 80px;
  background: #f59e0b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: white;
  font-size: 32px;
}

.part-item span {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

/* 상품 그리드 */
.latest-products {
  background: white;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
  position: relative;
  width: 100%;
  height: 220px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-placeholder {
  font-size: 48px;
  color: #9ca3af;
}

.wishlist-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
}

.wishlist-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

.wishlist-btn.active {
  background: #fca5a5;
  color: #dc2626;
}

.product-info {
  padding: 20px;
}

.product-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1f2937;
  line-height: 1.4;
}

.product-info .brand {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 8px;
}

.product-info .price {
  font-size: 20px;
  font-weight: bold;
  color: #f59e0b;
  margin-bottom: 8px;
}

.product-info .location {
  color: #6b7280;
  font-size: 14px;
}

/* 검색 필터 */
.search-filters {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  padding: 30px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  background: white;
}

.filter-select:focus {
  border-color: #2563eb;
}

/* 마이페이지 */
.mypage-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 20px;
  background: white;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.menu-item:hover {
  background: #eff6ff;
  transform: translateY(-2px);
}

.menu-item.active {
  background: #2563eb;
  color: white;
}

.menu-item i {
  margin-right: 15px;
  font-size: 24px;
}

.menu-item span {
  font-size: 18px;
  font-weight: 600;
}

.submenu-content {
  display: none;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.submenu-content.active {
  display: block;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
}

.form-group input:focus {
  border-color: #2563eb;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  margin-right: 10px;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.my-products {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.my-product-item {
  display: flex;
  align-items: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  gap: 20px;
}

.product-image-small {
  width: 80px;
  height: 80px;
  background: #e5e7eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #9ca3af;
}

.product-details {
  flex: 1;
}

.product-details h3 {
  font-size: 18px;
  margin-bottom: 5px;
}

.product-details p {
  font-size: 16px;
  font-weight: bold;
  color: #f59e0b;
  margin-bottom: 5px;
}

.status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status.active {
  background: #dcfce7;
  color: #16a34a;
}

.product-actions {
  display: flex;
  gap: 10px;
}

.btn-edit,
.btn-delete {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-edit {
  background: #f59e0b;
  color: white;
}

.btn-edit:hover {
  background: #d97706;
}

.btn-delete {
  background: #ef4444;
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
}

/* 고객센터 */
.support-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.support-item {
  display: flex;
  align-items: center;
  padding: 20px;
  background: white;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.support-item:hover {
  background: #eff6ff;
  transform: translateY(-2px);
}

.support-item.active {
  background: #2563eb;
  color: white;
}

.support-item i {
  margin-right: 15px;
  font-size: 24px;
}

.support-item span {
  font-size: 18px;
  font-weight: 600;
}

.support-content {
  display: none;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.support-content.active {
  display: block;
}

.notice-list,
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.notice-item,
.faq-item {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.notice-item h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #1f2937;
}

.notice-item .date {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 10px;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-question h3 {
  font-size: 16px;
  color: #1f2937;
}

.faq-answer {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

/* 플로팅 버튼 */
.floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #f59e0b;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
  transition: all 0.3s;
  font-size: 24px;
  z-index: 999;
}

.floating-btn:hover {
  background: #d97706;
  transform: scale(1.1);
}

/* 푸터 */
.footer {
  background: #1f2937;
  color: white;
  padding: 40px 0;
  margin-top: 60px;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 30px;
}

.footer-links a {
  color: #d1d5db;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: white;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .mobile-menu.active {
    display: block;
  }

  .header .container {
    flex-wrap: wrap;
  }

  .nav-center {
    order: 3;
    width: 100%;
    margin-top: 15px;
  }

  /* 모바일에서 스티키 검색바 */
  .sticky-search {
    max-width: 100%;
  }

  .sticky-search-bar .container {
    padding: 10px 15px;
  }

  .hero-banner h1 {
    font-size: 32px;
  }

  .hero-banner p {
    font-size: 16px;
  }

  .hero-search {
    flex-direction: column;
    gap: 10px;
  }

  .hero-search input,
  .hero-search button {
    border-radius: 8px;
  }

  .search-filters {
    flex-direction: column;
    gap: 15px;
  }

  .filter-group {
    min-width: auto;
  }

  .brand-grid,
  .part-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .brand-item,
  .part-item {
    padding: 20px 10px;
  }

  .brand-icon,
  .part-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

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

  .product-image {
    height: 160px;
  }

  .image-placeholder {
    font-size: 32px;
  }

  .product-info {
    padding: 15px;
  }

  .product-info h3 {
    font-size: 14px;
  }

  .product-info .price {
    font-size: 16px;
  }

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

  .my-product-item {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .product-actions {
    justify-content: center;
  }

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

  section {
    padding: 40px 0;
  }

  section h2 {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .floating-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .footer .container {
    text-align: center;
    flex-direction: column;
  }

  .footer-links {
    justify-content: center;
  }
}

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

  .brand-grid,
  .part-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-banner {
    padding: 60px 0;
  }

  .hero-banner h1 {
    font-size: 24px;
  }

  .search-filters {
    padding: 20px;
  }

  .submenu-content,
  .support-content {
    padding: 20px;
  }
}

/* 관리자 페이지 스타일 */
.admin-overview {
  margin-bottom: 40px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.stat-info h3 {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-number {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin: 0;
}

.admin-menu {
  display: grid;
  gap: 40px;
}

.admin-section h2 {
  color: #333;
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
}

.admin-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.admin-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  font-size: 14px;
  color: #4b5563;
}

.admin-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  transform: translateY(-2px);
}

.admin-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.admin-btn i {
  font-size: 24px;
  margin-bottom: 5px;
}

.admin-btn span {
  font-weight: 500;
}

.admin-content {
  display: none;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 30px;
}

.admin-content.active {
  display: block;
}

.admin-content h2 {
  color: #333;
  font-size: 24px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e5e7eb;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.search-bar input {
  flex: 1;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.search-bar button {
  padding: 12px 20px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.search-bar button:hover {
  background: #1d4ed8;
}

.products-table,
.users-table {
  overflow-x: auto;
}

.products-table table,
.users-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.products-table th,
.users-table th,
.products-table td,
.users-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.products-table th,
.users-table th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.products-table td,
.users-table td {
  font-size: 14px;
  color: #4b5563;
}

.status.active {
  background: #10b981;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.btn-edit,
.btn-delete,
.btn-suspend {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 5px;
  transition: background 0.3s ease;
}

.btn-edit {
  background: #3b82f6;
  color: white;
}

.btn-edit:hover {
  background: #2563eb;
}

.btn-delete {
  background: #ef4444;
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
}

.btn-suspend {
  background: #f59e0b;
  color: white;
}

.btn-suspend:hover {
  background: #d97706;
}

.analytics-dashboard {
  display: grid;
  gap: 30px;
}

.chart-section {
  background: #f9fafb;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.chart-section h3 {
  color: #374151;
  font-size: 18px;
  margin-bottom: 20px;
}

.chart-placeholder {
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  border: 2px dashed #d1d5db;
  border-radius: 6px;
}

.chart-placeholder i {
  font-size: 48px;
  margin-bottom: 10px;
}

.chart-placeholder p {
  font-size: 14px;
  margin: 0;
}

/* 관리자 페이지 반응형 */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-content {
    padding: 20px;
  }

  .products-table,
  .users-table {
    font-size: 12px;
  }

  .products-table th,
  .users-table th,
  .products-table td,
  .users-table td {
    padding: 8px;
  }

  .search-bar {
    flex-direction: column;
  }

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