:root {
  --catalogue-accent-start: #facc15;
  --catalogue-accent-end: #f97316;
  --catalogue-accent-text: #111827;
  --catalogue-bg-gray: #f8fafc;
  --catalogue-border: #e2e8f0;
}

body.catalogue-mode {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  font-synthesis: style;
  color: #0f172a;
}

/* ---------------------------------------------------------
   1. Clean Up & Hiding Unwanted Elements (Aggressive)
--------------------------------------------------------- */
/* Hide unwanted tabs, buttons, and skeletons */
body.catalogue-mode [data-catalogue-hidden],
body.catalogue-mode .tab-bar,
body.catalogue-mode nav.tabs,
body.catalogue-mode .catalogue-contact-button,
body.catalogue-mode button[aria-label="고객센터"],
body.catalogue-mode button:contains("고객센터"),
body.catalogue-mode .loading-placeholder,
body.catalogue-mode [data-skeleton],
body.catalogue-mode .swiper,
body.catalogue-mode .embla,
body.catalogue-mode .animate-pulse,
body.catalogue-mode .bg-gray-200 {
  display: none !important;
}

/* Hide the specific "empty boxes" container seen in screenshots */
body.catalogue-mode div[class*="grid"][class*="gap-2"]>div[class*="bg-gray-100"],
body.catalogue-mode div[class*="flex"][class*="gap-"]>div[class*="rounded-lg"] {
  /* Target generic skeleton loaders if they lack specific classes */
  display: none !important;
}

/* Hide Chatbot Debug Info & Admin Bars */
body.catalogue-mode .chat-session-info,
body.catalogue-mode [data-chat-debug],
body.catalogue-mode .mwai-admin-bar,
body.catalogue-mode .mwai-dev-console,
body.catalogue-mode button:contains("DEV"),
body.catalogue-mode button:contains("EN") {
  display: none !important;
}

/* ---------------------------------------------------------
   2. Layout & Typography
--------------------------------------------------------- */
.catalogue-mode .catalogue-section {
  margin-bottom: 40px;
}

.catalogue-mode h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.3;
}

.catalogue-mode p {
  line-height: 1.6;
  color: #475569;
}

/* ---------------------------------------------------------
   3. Gallery Redesign (Modern & Clean)
--------------------------------------------------------- */
#catalogue-detail-gallery {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 24px;
}

#catalogue-detail-gallery .cat-gallery-main {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--catalogue-border);
  background: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  /* Square for consistency */
}

#catalogue-detail-gallery .cat-gallery-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#catalogue-detail-gallery .cat-gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

#catalogue-detail-gallery .cat-gallery-thumbs img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  object-fit: cover;
  background: var(--catalogue-bg-gray);
  transition: all 0.2s ease;
}

#catalogue-detail-gallery .cat-gallery-thumbs img:hover {
  border-color: #cbd5e1;
}

#catalogue-detail-gallery .cat-gallery-thumbs img.is-active {
  border-color: var(--catalogue-accent-end);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

/* ---------------------------------------------------------
   4. Specs Table Redesign (Professional Look)
--------------------------------------------------------- */
.catalogue-specs-shell {
  border: 1px solid var(--catalogue-border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 20px;
  background: #fff;
}

/* Force table styling even if original HTML is messy */
.catalogue-specs table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
  /* Ensure columns don't jump */
}

.catalogue-specs table th,
.catalogue-specs table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--catalogue-border);
  text-align: left;
  vertical-align: middle;
}

.catalogue-specs table th {
  background-color: var(--catalogue-bg-gray);
  color: #475569;
  font-weight: 600;
  width: 30%;
  /* Fixed width for labels */
  white-space: normal;
  word-break: break-word;
}

.catalogue-specs table td {
  color: #1e293b;
  font-weight: 500;
  width: 70%;
}

.catalogue-specs table tr:last-child th,
.catalogue-specs table tr:last-child td {
  border-bottom: none;
}

/* ---------------------------------------------------------
   5. Chatbot Positioning & Styling
--------------------------------------------------------- */
body.catalogue-mode [data-catalogue-chatbot="1"] {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  /* Ensure it's on top */
}

/* Hide specific debug buttons inside chatbot if they have these classes */
.mwai-chat-admin,
.mwai-debug-info {
  display: none !important;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .catalogue-mode h1 {
    font-size: 22px;
  }

  .catalogue-specs table th,
  .catalogue-specs table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  #catalogue-detail-gallery .cat-gallery-thumbs img {
    width: 60px;
    height: 60px;
  }
}