/* ==========================================================================
   Products Page - Complete Redesign
   ========================================================================== */

/* Variables */
:root {
  --ct-primary-color: #F06272; /* Market Pink (Matched default.css) */
  --ct-border-color: #eee;
  --ct-text-primary: #222;
  --ct-text-secondary: #555;
  --ct-text-muted: #888;
  --ct-bg-light: #fafafa;
}

body.no-scroll {
  overflow: hidden;
}

/* ==========================================================================
   Full-Width Banner Section (Below Header) - Redesigned
   ========================================================================== */
.ct-fullwidth-banner-section {
  background: transparent;
  padding: 1.5rem 0 1rem;
}

.ct-banner-slider {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  min-height: 140px; /* 2x height */
}

.ct-fullwidth-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  text-decoration: none !important;
  border-radius: 16px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateX(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ct-fullwidth-banner.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.ct-fullwidth-banner:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Banner Gradients */
.ct-fullwidth-banner.insight-gradient {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #3d7ab5 100%);
}

.ct-fullwidth-banner.brief-gradient {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #43a047 100%);
}

/* Banner Icon Area */
.ct-banner-icon-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: rgba(255,255,255,0.15);
  border-radius: 16px;
  flex-shrink: 0;
}

.ct-banner-icon-area i {
  font-size: 2.5rem;
  color: #fff;
}

/* Banner Text Area */
.ct-banner-text-area {
  flex: 1;
  text-align: center;
}

.ct-banner-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ct-banner-badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ct-banner-badge.insight {
  background: rgba(255,255,255,0.95);
  color: #1e3a5f;
}

.ct-banner-badge.brief {
  background: rgba(255,255,255,0.95);
  color: #1b5e20;
}

.ct-banner-title {
  font-size: 1rem;
  font-weight: 900;
  color: rgba(255,255,255,0.9);
  letter-spacing: 2px;
}

.ct-banner-headline {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.ct-banner-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  margin: 0;
  line-height: 1.5;
}

/* Banner CTA */
.ct-banner-cta {
  flex-shrink: 0;
}

.ct-cta-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: rgba(255,255,255,0.2);
  border-radius: 25px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.ct-fullwidth-banner:hover .ct-cta-text {
  background: rgba(255,255,255,0.3);
  transform: translateX(3px);
}

/* Banner Indicators */
.ct-banner-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1rem;
}

.ct-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ct-indicator.active {
  background: var(--ct-primary-color);
  width: 28px;
  border-radius: 4px;
}

.ct-indicator:hover {
  background: #bbb;
}

.ct-indicator.active:hover {
  background: var(--ct-primary-color);
}

/* Mobile Banner */
@media (max-width: 768px) {
  .ct-fullwidth-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
    gap: 1rem;
  }
  
  .ct-banner-icon-area {
    width: 50px;
    height: 50px;
  }
  
  .ct-banner-icon-area i {
    font-size: 1.75rem;
  }
  
  .ct-banner-badge-row {
    justify-content: center;
  }
  
  .ct-banner-headline {
    font-size: 1.1rem;
  }
  
  .ct-banner-desc {
    font-size: 0.8rem;
  }
  
  .ct-banner-cta {
    display: none;
  }
}

/* ==========================================================================
   Sidebar - No Header, Clean Category List Only
   ========================================================================== */

/* ==========================================================================
   Search & Filter Toolbar - Simplified 3-Row Design
   ========================================================================== */
.ct-search-toolbar {
  background: transparent;
}

/* Row 1: Breadcrumb */
.ct-toolbar-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Mobile hamburger button */
.ct-toolbar-title-row .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: #f8f9fa;
  border: none;
  border-radius: 8px;
  transition: all 0.2s;
}

.ct-toolbar-title-row .btn:hover {
  background: #e9ecef;
}

.ct-toolbar-title-row .btn i {
  color: #6c757d;
}

.ct-breadcrumb-inline {
  display: flex;
  align-items: center;
  flex: 1;
}

.ct-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
}

.ct-breadcrumb li {
  display: flex;
  align-items: center;
}

.ct-breadcrumb li::after {
  content: '/';
  margin-left: 0.35rem;
  color: #ccc;
}

.ct-breadcrumb li:last-child::after {
  display: none;
}

.ct-breadcrumb a {
  color: var(--ct-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.ct-breadcrumb a:hover {
  color: var(--ct-primary-color);
}

/* Row 2: Title + Count */
.ct-toolbar-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.ct-page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ct-text-primary);
  margin: 0;
  line-height: 1.2;
}

.ct-product-count {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ct-text-muted);
}

/* Toolbar Filters Row */
.ct-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ct-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ct-filter-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ct-text-secondary);
  background: #f8f9fa;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.ct-filter-select:hover {
  background-color: #eee;
}

.ct-filter-select:focus {
  outline: none;
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(240, 98, 114, 0.2);
}

/* Search & Sort Group */
.ct-search-sort-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ct-search-box {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 0 0.75rem;
  min-width: 220px;
  transition: all 0.2s;
}

.ct-search-box:focus-within {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(240, 98, 114, 0.2);
}

.ct-search-box i {
  color: #999;
  font-size: 0.9rem;
}

.ct-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.55rem 0 0.55rem 0.65rem;
  font-size: 0.85rem;
  color: var(--ct-text-primary);
}

.ct-search-box input:focus {
  outline: none;
}

.ct-search-box input::placeholder {
  color: #aaa;
}

.ct-sort-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  background: #f8f9fa;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ct-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.ct-sort-btn:hover {
  background-color: #eee;
}

.ct-sort-btn:focus {
  outline: none;
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(240, 98, 114, 0.2);
}

.ct-sort-btn i {
  display: none;
}

/* Mobile Toolbar */
@media (max-width: 768px) {
  .ct-toolbar-title-row {
    margin-bottom: 0.5rem;
  }

  .ct-toolbar-title-row .btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .ct-breadcrumb {
    font-size: 0.7rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .ct-breadcrumb::-webkit-scrollbar {
    display: none;
  }

  .ct-toolbar-heading {
    margin-bottom: 0.75rem;
  }

  .ct-page-title {
    font-size: 1.35rem;
  }
  
  .ct-toolbar-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .ct-filter-group {
    width: 100%;
  }
  
  .ct-filter-select {
    flex: 1;
  }
  
  .ct-search-sort-group {
    width: 100%;
  }
  
  .ct-search-box {
    flex: 1;
    min-width: unset;
  }
}

.fw-black {
    font-weight: 900 !important;
}

.x-small {
    font-size: 0.75rem;
}

.ls-1 {
    letter-spacing: 1px;
}

/* ==========================================================================
   Filter Toolbar
   ========================================================================== */
.ct-filter-toolbar {
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid #eee;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03) !important;
}

.ct-filter-toolbar .form-select {
    background-color: #fff !important; /* Force white background */
    border-color: #eee;
    transition: all 0.2s;
}

.ct-filter-toolbar .form-select:focus {
    border-color: var(--ct-market-primary);
    box-shadow: 0 0 0 0.25rem rgba(240, 98, 114, 0.1);
}

/* Ensure mobile resizing is smooth */
@media (max-width: 768px) {
    #products-search-bar {
        font-size: 1rem; /* Prevent zoom on mobile */
    }
}
/* ==========================================================================
   Layout Width Fix - Ensure header and content align
   ========================================================================== */
.container-medium {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .container-medium {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* ==========================================================================
   Sidebar - Clean & Modern Design
   ========================================================================== */
.ct-sidebar-wrapper {
  padding-right: 2rem;
  min-width: 200px;
}

@media (max-width: 991px) {
  .ct-sidebar-wrapper {
    padding-right: 0;
    margin-bottom: 1rem;
  }
}

/* Sidebar column visibility control */
.sidebar-column {
  display: none;
}

@media (min-width: 992px) {
  .sidebar-column {
    display: block !important;
  }
}

/* Desktop Sticky */
@media (min-width: 992px) {
  .ct-sidebar-sticky {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding-bottom: 2rem;
    scrollbar-width: none;
  }
  .ct-sidebar-sticky::-webkit-scrollbar {
    display: none;
  }
  .navbar-toggler-humburger-icon {
    display: none !important;
  }
}

/* Sidebar Navbar Reset */
.ct-sidebar-wrapper .navbar-vertical {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.ct-sidebar-wrapper .navbar-vertical-content,
.ct-sidebar-wrapper .navbar-collapse {
  overflow: visible !important;
  height: auto !important;
}

.ct-sidebar-wrapper .navbar-nav {
  flex-direction: column !important;
}

/* Category Navigation - Clean List Style */
.ct-category-nav {
  padding-top: 0.5rem;
}

.ct-category-nav .nav-item {
  margin-bottom: 0;
  display: block; /* 한 행에 1개 아이템 */
  width: 100%;
}

.ct-category-nav .nav-item:first-child .nav-link {
  margin-top: 0;
}

.ct-category-nav .nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 텍스트 좌측, caret 우측 */
  padding: 0.65rem 0.75rem !important;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ct-text-secondary);
  border-radius: 6px;
  transition: all 0.15s ease;
  text-decoration: none !important;
  width: 100%;
}

.ct-category-nav .nav-link:hover {
  background-color: #f5f5f5;
  color: var(--ct-primary-color);
}

/* Link Text - 왼쪽 정렬, flex-grow로 공간 차지 */
.ct-category-nav .nav-link-text {
  flex: 1;
  text-decoration: none !important;
  color: inherit;
}

/* Active State */
.ct-category-nav .nav-link-text.active {
  color: var(--ct-primary-color) !important;
  font-weight: 600;
}

/* Arrow Toggle - 우측 정렬 */
.ct-category-nav .arrow-toggle {
  cursor: pointer;
  padding: 0.4rem;
  margin-left: auto; /* 우측 정렬 */
  border-radius: 4px;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.ct-category-nav .arrow-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.ct-category-nav .arrow-icon {
  font-size: 0.7rem;
  color: #999;
  transition: transform 0.2s ease, color 0.2s ease;
}

.ct-category-nav .arrow-toggle[aria-expanded="true"] .arrow-icon {
  transform: rotate(180deg);
  color: var(--ct-primary-color);
}

/* Level 1 - 기본 (Indent 없음) */
.ct-category-nav .nav-link.category-level-1 {
  padding-left: 0.75rem !important;
  font-weight: 600;
  color: #333;
}

/* Level 2 - Indent 1단계 */
.ct-category-nav .nav-link.category-level-2 {
  padding-left: 1.5rem !important;
  font-weight: 500;
  color: #555;
}

/* Level 3 - Indent 2단계 */
.ct-category-nav .nav-link.category-level-3 {
  padding-left: 2.5rem !important;
  font-weight: 400;
  color: #777;
}

/* Level 4+ - Indent 3단계 */
.ct-category-nav .nav-link.category-level-4 {
  padding-left: 3.5rem !important;
  font-weight: 400;
  color: #888;
}

.ct-category-nav .nav-link.category-level-2.active .nav-link-text,
.ct-category-nav .nav-link.category-level-3.active .nav-link-text,
.ct-category-nav .nav-link.category-level-4.active .nav-link-text {
  color: var(--ct-primary-color) !important;
  font-weight: 600;
}

/* Force link colors */
.ct-category-nav a {
  text-decoration: none !important;
}

/* Ensure white text is visible */
.ct-banner-item .text-white {
    color: #fff !important;
}
.ct-banner-item i {
    color: #fff;
}

.ct-form-select,
.ct-form-control {
    font-size: 0.85rem;
}

.ct-form-select {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 2rem 0 0.75rem;
  color: #444;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
  min-width: 100px;
}

.ct-form-select:focus {
  border-color: var(--ct-primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 95, 0, 0.1);
}

.ct-search-wrapper {
  position: relative;
  min-width: 220px;
}

@media (max-width: 575px) {
  .ct-search-wrapper {
    min-width: 100%;
  }
}

/* ==========================================================================
   Search Input
   ========================================================================== */
.ct-search-input {
  padding: 0 1rem 0 2.4rem;
  border-radius: 50px;
  border: 1px solid #e3e6ed; /* lighter border */
  background-color: #fff; /* white bg */
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02); /* subtle inner depth */
}

.ct-search-input:focus {
  background-color: #fff;
  border-color: var(--ct-market-primary); /* Coral Pink */
  outline: none;
  box-shadow: 0 0 0 3px rgba(240, 98, 114, 0.15); /* Soft pink glow */
}

.ct-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 0.85rem;
  pointer-events: none;
}

.ct-sort-btn {
  font-weight: 500;
  color: #444;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 80px;
  justify-content: space-between;
}

.ct-sort-btn:hover {
  background: #f9f9f9;
}

/* ==========================================================================
   Mobile Sidebar
   ========================================================================== */

/* Offcanvas 내부의 navbar-collapse를 강제로 펼침 (PC와 동일한 룩) */
#productCategoryOffcanvas .navbar-collapse {
  display: block !important;
}

#productCategoryOffcanvas .navbar-vertical {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

#productCategoryOffcanvas .navbar-vertical-content {
  overflow: visible !important;
  height: auto !important;
}

#productCategoryOffcanvas .navbar-nav {
  flex-direction: column !important;
}

/* Mobile Offcanvas - 폰트 사이즈 통일 및 Indent 적용 (공통 클래스로 대체됨) */
/* .nav-link.category-level-N 규칙이 공통으로 적용되므로 별도 규칙 불필요 */

@media (max-width: 991px) {
  /* Mobile Category Toggle */
  .ct-mobile-category-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;
  }

  .ct-mobile-category-header .btn {
    font-size: 1.25rem;
    padding: 0;
    margin-right: 0.75rem;
    color: #333;
  }

  .ct-mobile-category-header span {
    font-weight: 600;
    font-size: 1rem;
  }

  /* Expanded menu styling */
  .navbar-vertical.collapse.show {
    position: relative;
    width: 100%;
    height: auto;
    background: #fff;
    padding: 0.5rem 0;
    max-height: 45vh;
    overflow-y: auto;
    border-bottom: 1px solid #eee;
  }

  /* Adjust filter toolbar for mobile */
  .ct-filter-toolbar {
    padding: 0.5rem 0.75rem;
  }
  
  .ct-form-select,
  .ct-search-input,
  .ct-sort-btn {
    font-size: 0.8rem;
    height: 36px;
  }
  
  .ct-form-select {
    min-width: auto;
    padding-right: 1.5rem;
  }
}

/* ==========================================================================
   Product Grid
   ========================================================================== */
#product-list-container {
  display: flex !important;
  flex-wrap: wrap !important;
  margin: 0 -8px;
}

#product-list-container > .col-6,
#product-list-container > .col-md-4,
#product-list-container > .col-lg-3,
#product-list-container > .col-xl-3,
#product-list-container > div[class*="col-"] {
  display: flex !important;
  padding: 0 8px;
  margin-bottom: 16px;
}

#product-list-container .ct-product-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Mobile Product Grid */
@media (max-width: 575px) {
  #product-list-container {
    margin: 0 -6px;
  }
  #product-list-container > div[class*="col-"] {
    padding: 0 6px;
    margin-bottom: 12px;
  }
}
