/* ==========================================================================
   THE FINITE CO. — MINIMAL ARCHITECTURAL COLLECTIONS GRID (OPPEIN-INSPIRED)
   Shared gallery card layout across all collection & sub-category pages.
   ========================================================================== */

.collections-gallery-sec,
.cat-home-style-grid,
.subcat-home-style-grid {
  padding: 56px 0 92px 0 !important;
  background: var(--bg-body, #FAF8F5) !important;
}

body.dark-theme .collections-gallery-sec,
body.dark-theme .cat-home-style-grid,
body.dark-theme .subcat-home-style-grid {
  background: #141414 !important;
}

.collections-gallery-sec .container,
.cat-home-style-grid .container,
.subcat-home-style-grid .container {
  max-width: 1460px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
}

.collections-gallery-sec .row,
.cat-home-style-grid .row,
.subcat-home-style-grid .row {
  margin: 0 -14px !important;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

/* Prevent Bootstrap 3 .row clearfix pseudo-elements from taking flex slots */
.collections-gallery-sec .row::before,
.collections-gallery-sec .row::after,
.cat-home-style-grid .row::before,
.cat-home-style-grid .row::after,
.subcat-home-style-grid .row::before,
.subcat-home-style-grid .row::after {
  display: none !important;
  content: none !important;
}

.collections-gallery-sec .row > [class*="col-"],
.cat-home-style-grid .row > [class*="col-"],
.subcat-home-style-grid .row > [class*="col-"] {
  padding: 0 14px !important;
  margin-bottom: 38px !important;
  display: flex;
  flex-direction: column;
  float: none;
}

/* Crisp Architectural Gallery Card (The Finite Co. Theme) */
.op-col-card {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #FFFFFF !important;
  border: 1px solid rgba(194, 104, 52, 0.14) !important;
  border-bottom: 2px solid rgba(194, 104, 52, 0.14) !important;
  border-radius: 6px !important;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.035) !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color 0.25s ease !important;
}

.op-col-card:hover {
  border-color: rgba(194, 104, 52, 0.42) !important;
  border-bottom-color: #C26834 !important;
}

body.dark-theme .op-col-card {
  background: #1B1B1B !important;
  border-color: rgba(194, 104, 52, 0.22) !important;
  border-bottom-color: rgba(194, 104, 52, 0.22) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35) !important;
}

body.dark-theme .op-col-card:hover {
  border-color: rgba(194, 104, 52, 0.5) !important;
  border-bottom-color: #C26834 !important;
}

.op-col-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  flex-shrink: 0;
  overflow: hidden;
  background: #EFECE6;
}

body.dark-theme .op-col-media {
  background: #222222;
}

.op-col-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease;
}

.op-col-card:hover .op-col-media img {
  opacity: 0.93;
}

.op-col-body {
  padding: 20px 22px 18px 22px;
  text-align: left;
  background: transparent;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.op-col-title {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.2px !important;
  text-transform: none !important;
  color: #1F1F1F !important;
  margin: 0 !important;
  min-height: 49px;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

body.dark-theme .op-col-title {
  color: #F4F4F4 !important;
}

.op-col-card:hover .op-col-title {
  color: #C26834 !important;
}

.op-col-sub {
  font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: #66625E;
  margin: 8px 0 16px 0;
  min-height: 41px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.dark-theme .op-col-sub {
  color: #A8A8A8;
}

.op-col-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.dark-theme .op-col-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.op-col-cta-label {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #C26834;
}

.op-col-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 2px;
  border: 1px solid rgba(194, 104, 52, 0.35);
  color: #C26834;
  font-size: 11px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.op-col-card:hover .op-col-arrow {
  background: #C26834;
  border-color: #C26834;
  color: #FFFFFF;
}

/* Group Filter Chips (Window Treatments & Sub-Category Pages) */
.group-filter-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 38px;
}

.group-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 999px;
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  background: #ffffff;
  color: #444444;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

body.dark-theme .group-pill-btn {
  background: #1E1E1E;
  color: #CCCCCC;
  border-color: rgba(255, 255, 255, 0.12);
}

.group-pill-btn:hover {
  border-color: #C26834;
  color: #C26834;
}

.group-pill-btn.active {
  background: #C26834;
  color: #FFFFFF;
  border-color: #C26834;
}

@media (max-width: 767px) {
  .collections-gallery-sec,
  .cat-home-style-grid,
  .subcat-home-style-grid {
    padding: 36px 0 64px 0 !important;
  }
  .collections-gallery-sec .container,
  .cat-home-style-grid .container,
  .subcat-home-style-grid .container {
    padding: 0 16px !important;
  }
  .collections-gallery-sec .row > [class*="col-"],
  .cat-home-style-grid .row > [class*="col-"],
  .subcat-home-style-grid .row > [class*="col-"] {
    width: 100%;
    margin-bottom: 28px !important;
  }
  .op-col-title {
    min-height: 0;
    font-size: 16px !important;
  }
  .op-col-sub {
    min-height: 0;
  }
}
