/* ==========================================================================
   Dedicated Standalone Catalogue Page Styles
   ========================================================================== */

/* Main Page Layout Grid */
.catalogue-container-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  margin-top: 2rem;
  align-items: flex-start;
}

@media (max-width: 991px) {
  .catalogue-container-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* 1. Left Sidebar Filters */
.catalogue-sidebar {
  background-color: var(--surface);
  border: 1px solid var(--border);
  padding: 1.75rem;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.sidebar-widget {
  margin-bottom: 2.2rem;
}

.sidebar-widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dark);
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

/* Search bar styling */
.sidebar-search-wrapper {
  position: relative;
}

.sidebar-search-wrapper input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  border: 1px solid var(--border);
  background-color: var(--background);
  font-family: var(--font-body);
  font-size: 0.9rem;
  border-radius: 6px;
  color: var(--dark);
  transition: var(--transition-fast);
}

.sidebar-search-wrapper input:focus {
  border-color: var(--brown);
  outline: none;
  background-color: var(--surface);
}

.sidebar-search-wrapper i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
}

/* Checkbox lists */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  accent-color: var(--brown);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* Button filters */
.collection-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-collection-btn {
  text-align: left;
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.7rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition-fast);
  border-radius: 6px;
  width: 100%;
}

.filter-collection-btn:hover,
.filter-collection-btn.active {
  background-color: var(--dark);
  color: var(--surface);
  border-color: var(--dark);
}

/* Share View Button */
.btn-share-view {
  width: 100%;
  margin-top: 0.5rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* 2. Right Catalog Section */
.catalogue-main-section {
  display: flex;
  flex-direction: column;
}

.catalogue-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.catalogue-header-row h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--dark);
}

.results-badge-count {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

/* Product Card grid override */
.catalogue-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}

.product-actions-row {
  margin-top: 1rem;
}

.product-actions-row .btn {
  width: 100%;
  padding: 0.7rem;
  font-size: 0.8rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Selected button highlights */
.btn-select-item.selected {
  background-color: var(--olive);
  border-color: var(--olive);
  color: var(--surface);
}

.btn-select-item.selected:hover {
  background-color: #4b5840;
  border-color: #4b5840;
}

/* No results state */
.catalogue-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}

.catalogue-no-results i {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  display: inline-block;
}

.catalogue-no-results h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.catalogue-no-results p {
  font-family: var(--font-body);
  font-size: 0.95rem;
}

/* 3. B2B Selection Bag Drawer */
.bag-floating-trigger {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  background-color: var(--rust);
  color: var(--surface);
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(166, 83, 53, 0.3);
  z-index: 998;
  transition: all 0.3s ease;
}

.bag-floating-trigger:hover {
  transform: translateY(-5px) scale(1.05);
  background-color: var(--brown);
}

.bag-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--dark);
  color: var(--surface);
  font-size: 0.7rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.bag-floating-trigger i {
  font-size: 1.5rem;
}

/* Collapsible side drawer selection list */
.b2b-selection-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background-color: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -15px 0 40px rgba(0,0,0,0.15);
  z-index: 2005;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.b2b-selection-drawer.active {
  right: 0;
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--background);
}

.drawer-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.drawer-close-btn:hover {
  color: var(--dark);
}

.drawer-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Bag list items styling */
.bag-items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bag-item-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.bag-item-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bag-item-img {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.bag-item-details {
  flex: 1;
}

.bag-item-details h5 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--dark);
  margin-bottom: 0.2rem;
}

.bag-item-details span {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.bag-remove-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.bag-remove-btn:hover {
  color: var(--rust);
}

.bag-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

.bag-empty-state i {
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

/* B2B Enquiry Submission Form */
.drawer-form-panel {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  background-color: var(--background);
}

.drawer-form-panel h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dark);
  margin-bottom: 1rem;
}

.drawer-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer-form .form-group {
  margin-bottom: 0;
}

.drawer-form .form-control {
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
}

.drawer-form select.form-control {
  height: 38px;
  cursor: pointer;
}

.drawer-form textarea.form-control {
  height: 90px;
}

.drawer-form button[type="submit"] {
  padding: 0.85rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(16, 16, 16, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2004;
  display: none;
}

.b2b-selection-drawer.active ~ .drawer-overlay {
  display: block;
}

/* Tablet & Mobile responsive overrides */
@media (max-width: 991px) {
  .b2b-selection-drawer {
    width: 100%;
    right: -100%;
  }
  
  .bag-floating-trigger {
    bottom: 5.5rem !important; /* sit above mobile bottom sticky cta */
    left: 1.25rem !important;
    right: auto !important;
  }

  #btn-mobile-filters {
    display: inline-flex !important;
  }

  #sidebar-mobile-header {
    display: flex !important;
  }

  #catalogue-sidebar.catalogue-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -320px !important;
    width: 320px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    background-color: var(--surface) !important;
    border: none !important;
    border-right: 1px solid var(--border) !important;
    padding: 1.75rem !important;
    box-shadow: 15px 0 40px rgba(0,0,0,0.15) !important;
    z-index: 2010 !important;
    margin-bottom: 0 !important;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  #catalogue-sidebar.catalogue-sidebar.active {
    left: 0 !important;
  }
  
  /* Show filter overlay when active on mobile */
  #catalogue-sidebar.catalogue-sidebar.active ~ .drawer-overlay {
    display: block !important;
    z-index: 2009 !important;
  }

  /* Tablet grid columns (up to 991px): Show 3 products per row */
  .catalogue-card-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Mobile grid columns (< 767px): Show exactly 2 products per row */
  @media (max-width: 767px) {
    .catalogue-card-grid {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 0.75rem !important;
    }
    
    .product-info {
      padding: 0.6rem !important;
    }
    
    .product-name {
      font-size: 0.8rem !important;
      margin-bottom: 0.4rem !important;
    }
    
    .product-collection {
      font-size: 0.6rem !important;
    }
    
    .product-actions-row .btn {
      padding: 0.5rem !important;
      font-size: 0.75rem !important;
    }
  }
}
