@charset "UTF-8";
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --bg-color: #f4f5f7;
  --card-bg: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --primary-color: #e82127; /* Tesla Red Accent */
  --primary-hover: #c91b21;
  --border-color: #e5e7eb;
  --border-radius-card: 8px;
  --border-radius-sm: 4px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --container-max-width: 1040px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Container */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 40px 0 28px;
  text-align: center;
  position: relative;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #fee2e2;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.site-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.site-title span {
  color: var(--primary-color);
}

.site-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 24px;
}

/* Quick Links Bar */
.quick-links-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.quick-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  transition: var(--transition);
}

.quick-link-chip:hover {
  background-color: #ffffff;
  border-color: #d1d5db;
  color: var(--primary-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.quick-link-chip .chip-icon {
  font-size: 0.95rem;
}

/* Sticky Controls Bar (Category Tabs & Search) */
.sticky-controls-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(244, 245, 247, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
  padding: 12px 0;
  margin-bottom: 30px;
}

.controls-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Search Box */
.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  height: 46px;
  padding: 0 46px 0 42px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}

.search-input:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
  pointer-events: none;
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  padding: 4px;
}

.clear-search-btn:hover {
  color: var(--text-main);
}

/* Category Tabs */
.category-tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE */
  padding-bottom: 2px;
}

.category-tabs-nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.cat-tab-btn {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: #4b5563;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.cat-tab-btn:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

.cat-tab-btn.active {
  background-color: #111827;
  border-color: #111827;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.cat-tab-btn .badge-count {
  font-size: 0.75rem;
  margin-left: 4px;
  opacity: 0.8;
}

/* Section Header (Matches attached user image) */
.category-section {
  margin-bottom: 56px;
  scroll-margin-top: 140px;
}

.section-title {
  text-align: center;
  font-size: 1.65rem;
  font-weight: 900;
  color: #111111;
  letter-spacing: -0.04em;
  margin-bottom: 22px;
  position: relative;
}

/* Product Grid (Exact 3-column layout matching image) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* Product Card (Matches user image exactly) */
.product-card {
  background-color: var(--card-bg);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Card Image Wrapper (Tall ratio matching screenshot) */
.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.15; /* Matching screenshot's vertical proportion */
  background-color: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #f1f2f4;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Fill the card area like the screenshot */
  object-position: center;
  transition: transform 0.25s ease;
}

.product-card:hover .card-img {
  transform: scale(1.02);
}

/* Store Badge overlay */
.store-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: -0.01em;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  opacity: 0.92;
}

.store-tag.aliexpress {
  background-color: #ff3b30;
  color: #ffffff;
}

.store-tag.coupang {
  background-color: #8b0000;
  color: #ffffff;
}

.store-tag.naver {
  background-color: #03c75a;
  color: #ffffff;
}

.store-tag.haloblk {
  background-color: #111111;
  color: #ffffff;
}

.store-tag.default {
  background-color: #4b5563;
  color: #ffffff;
}

/* Card Info / Title Area (Matches user image typography) */
.card-info {
  padding: 16px 14px 18px;
  background-color: #ffffff;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #111111;
  line-height: 1.32;
  letter-spacing: -0.035em;
  word-break: keep-all;
}

/* Optional link badge inside card */
.card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #888888;
}

.card-badge-row .arrow-icon {
  font-size: 0.9rem;
  color: #999999;
  transition: transform 0.2s ease;
}

.product-card:hover .card-badge-row .arrow-icon {
  transform: translateX(3px);
  color: var(--primary-color);
}

/* Empty search result */
.no-results {
  text-align: center;
  padding: 60px 20px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
  color: #6b7280;
  display: none;
}

.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.no-results-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

/* Floating Action Button (Scroll to top) */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #111827;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 99;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background-color: var(--primary-color);
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 36px 0;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  margin-top: 60px;
}

.footer-text {
  margin-bottom: 8px;
  line-height: 1.6;
}

.footer-notice {
  font-size: 0.78rem;
  color: #b0b5bd;
}

/* ===================================================
   ADMIN MODE STYLES
   =================================================== */

/* Admin Header Toggle Button (Hidden by default for normal visitors) */
.admin-toggle-btn {
  display: none; /* Only visible via secret trigger or ?admin URL */
  align-items: center;
  gap: 6px;
  background-color: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.admin-toggle-btn.revealed {
  display: inline-flex !important;
}

.admin-toggle-btn:hover {
  background-color: #111827;
  color: #ffffff;
  border-color: #111827;
}

.admin-toggle-btn.active {
  background-color: #e82127;
  color: #ffffff;
  border-color: #e82127;
}

/* Admin Top Bar */
.admin-toolbar {
  background-color: #1e293b;
  color: #ffffff;
  padding: 12px 0;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 200;
}

body.admin-mode-active .admin-toolbar {
  display: block;
}

body.admin-mode-active .sticky-controls-bar {
  top: 56px;
}

.admin-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #f87171;
}

.admin-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-btn {
  background-color: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.admin-btn:hover {
  background-color: #475569;
  color: #ffffff;
}

.admin-btn-primary {
  background-color: #e82127;
  border-color: #e82127;
  color: #ffffff;
}

.admin-btn-primary:hover {
  background-color: #c91b21;
}

.admin-btn-success {
  background-color: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.admin-btn-success:hover {
  background-color: #059669;
}

/* Card Admin Action Overlay */
.card-admin-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 6px;
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  z-index: 10;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

body.admin-mode-active .card-admin-overlay {
  display: flex;
}

.card-admin-btn {
  background-color: rgba(255, 255, 255, 0.95);
  color: #111827;
  border: none;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.card-admin-btn:hover {
  background-color: #ffffff;
  transform: scale(1.05);
}

.card-admin-btn.delete:hover {
  background-color: #ef4444;
  color: #ffffff;
}

/* Drag and Drop Card Styles */
.card-drag-handle {
  cursor: grab;
  user-select: none;
  background-color: rgba(255, 255, 255, 0.95);
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.card-drag-handle:active {
  cursor: grabbing;
}

body.admin-mode-active .product-card {
  user-select: none;
}

body.admin-mode-active .product-card img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

body.admin-mode-active .product-card a {
  -webkit-user-drag: none;
}

.product-card.dragging {
  opacity: 0.35 !important;
  transform: scale(0.96) !important;
  border: 2px dashed #e82127 !important;
  box-shadow: none !important;
}

.product-card.drag-over {
  outline: 3px solid #e82127 !important;
  outline-offset: 2px;
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 24px rgba(232, 33, 39, 0.2) !important;
}

.product-card.drag-over-before {
  box-shadow: -6px 0 0 0 #e82127, 0 12px 24px rgba(232, 33, 39, 0.25) !important;
  transform: translateY(-4px) translateX(2px) !important;
}

.product-card.drag-over-after {
  box-shadow: 6px 0 0 0 #e82127, 0 12px 24px rgba(232, 33, 39, 0.25) !important;
  transform: translateY(-4px) translateX(-2px) !important;
}

.product-grid.drag-over-grid {
  outline: 2px dashed #e82127;
  outline-offset: 4px;
  background-color: rgba(232, 33, 39, 0.03);
}

.touch-drag-clone {
  pointer-events: none !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35) !important;
  transform: scale(1.05) !important;
  border: 2px solid #e82127 !important;
}

/* Category Admin Actions */
.category-admin-actions {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: -12px;
  margin-bottom: 20px;
}

body.admin-mode-active .category-admin-actions {
  display: flex;
}

/* Admin Modal Popup */
.admin-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal-backdrop.open {
  display: flex;
}

.admin-modal {
  background-color: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 18px 24px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.92rem;
  color: #0f172a;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

textarea.form-control {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

/* Image Upload Preview in Modal */
.image-preview-box {
  width: 100%;
  height: 160px;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #f8fafc;
  position: relative;
}

.image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-upload-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.modal-footer {
  padding: 16px 24px;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsive Media Queries */

/* Tablet & Smaller Desktop */
@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  
  .card-title {
    font-size: 1.05rem;
  }
  
  .section-title {
    font-size: 1.45rem;
  }
  
  .site-title {
    font-size: 1.8rem;
  }
}

/* Mobile Devices (iPhone, Galaxy, etc.) - EXACT 3 ITEMS PER ROW LIKE SCREENSHOT */
@media (max-width: 640px) {
  .container {
    padding: 0 10px;
  }
  
  /* Always 3 columns on mobile matching attached image */
  .product-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  /* When 2-col mode is toggled by user */
  .product-grid.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  
  .card-info {
    padding: 8px 6px 10px !important;
  }
  
  .card-title {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.04em !important;
  }
  
  .card-badge-row {
    margin-top: 4px !important;
    font-size: 0.65rem !important;
  }

  .store-tag {
    top: 4px !important;
    right: 4px !important;
    font-size: 0.58rem !important;
    padding: 1px 4px !important;
    border-radius: 2px !important;
  }

  .card-admin-btn {
    font-size: 0.62rem !important;
    padding: 2px 4px !important;
  }
  
  .section-title {
    font-size: 1.22rem !important;
    margin-bottom: 12px !important;
  }
  
  .site-title {
    font-size: 1.45rem !important;
  }
  
  .site-subtitle {
    font-size: 0.85rem !important;
  }
  
  .site-header {
    padding: 24px 0 16px !important;
  }

  .admin-toggle-btn {
    top: 8px !important;
    right: 8px !important;
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
  }

  .cat-tab-btn {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
  }
}

/* Very Small Mobile (<360px) */
@media (max-width: 360px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  
  .card-info {
    padding: 6px 4px 8px !important;
  }
  
  .card-title {
    font-size: 0.75rem !important;
  }
}


