/* =====================================================
   COLLECTION PAGE — FILTERS & GRID
===================================================== */

/* Section spacing */
.section-title {
  margin-bottom: 1rem;
}

/* -------------------------------
   FILTER BAR (STICKY, CLEAN)
-------------------------------- */

#filters {
  position: sticky;
  top: 64px; /* navbar height */
  z-index: 100;

  background: #fff;
  padding: 12px 0;
  margin-bottom: 12px;

  border-bottom: 1px solid #eee;
}

/* Reduce Bootstrap spacing noise */
#filters .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

/* Dropdown sizing */
#filters .form-select {
  font-size: 0.9rem;
}

/* Availability & Highlights row */
.filter-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

/* Filter groups */
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #222;
}

/* Checkbox styling */
.filter-checkbox {
  font-size: 0.85rem;
  color: #444;
}

/* Disabled (future) filters */
.filter-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Clear filters button */
#clearFilters {
  margin-left: auto;
  white-space: nowrap;
}

/* -------------------------------
   RESULT COUNT
-------------------------------- */

.result-count {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 8px;
}

/* -------------------------------
   EMPTY STATE
-------------------------------- */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty-state h4 {
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
}

/* -------------------------------
   PRODUCT GRID
-------------------------------- */

#productGrid {
  margin-top: 8px;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  #filters {
    top: 56px;
  }

  #clearFilters {
    margin-left: 0;
  }
}


/* =====================================================
   FILTER BAR – CLEAN & STICKY
===================================================== */

.filters-bar {
  position: sticky;
  top: 64px;               /* navbar height */
  z-index: 100;
  background: #fff;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

/* ROWS */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filters-row.primary {
  margin-bottom: 8px;
}

.filters-row.secondary {
  align-items: center;
}

/* DROPDOWN BLOCK */
.filter-block {
  min-width: 180px;
}

.filter-block label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
  display: block;
}

/* INLINE FILTER GROUPS */
.filter-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.filter-label {
  font-weight: 600;
  color: #222;
}

/* CHECKBOX */
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #444;
}

.checkbox-inline input {
  margin-top: 0;
}

.checkbox-inline.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* CLEAR BUTTON */
.filters-actions {
  margin-left: auto;
}

/* RESULT COUNT */
.result-count-row {
  margin-top: 8px;
}

.result-count {
  font-size: 0.85rem;
  color: #555;
  font-weight: 500;
}

/* MOBILE */
@media (max-width: 768px) {
  .filters-bar {
    top: 56px;
  }

  .filters-row {
    gap: 10px;
  }

  .filter-block {
    min-width: 100%;
  }

  .filters-actions {
    margin-left: 0;
  }
}


.product-card {
  position: relative; /* REQUIRED for overlay */
}

/* NEW badge */
.new-badge {
  position: absolute;
  top: 10px;
  right: 10px;

  background: #d4af37; /* gold */
  color: #3a2a00;

  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  z-index: 2;
}

/* OUT OF STOCK badge */
.sold-out-badge {
  position: absolute;
  top: 10px;
  left: 10px;

  background: rgba(0,0,0,0.75);
  color: #fff;

  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  z-index: 2;
}

/* =========================================
   MOBILE: AUTO-HIDE FILTER BAR ON SCROLL
========================================= */
@media (max-width: 768px) {
  #filters {
    transition: transform 0.3s ease;
    will-change: transform;
  }
}

/* =====================================
   PRODUCT PAGE IMAGE — MOBILE SAFE
===================================== */

.product-main-image {
  max-width: 100%;
  height: auto;
  display: block;
}


.product-image-container {
  max-width: 100%;
  overflow-x: hidden;
}

html, body {
  overflow-x: hidden;
}



/* ===============================
   FIX MOBILE HORIZONTAL OVERFLOW
================================ */

.product-grid-wrapper {
  overflow-x: hidden;
}

/* Prevent Bootstrap row from spilling */
#productGrid.row {
  margin-left: 0;
  margin-right: 0;
}

/* Ensure columns never exceed width */
#productGrid .col-12,
#productGrid .col-md-6,
#productGrid .col-lg-3 {
  padding-left: 8px;
  padding-right: 8px;
}

/* Image safety */
.product-card img {
  max-width: 100%;
  height: auto;
  display: block;
}


/* ======================================
   PRODUCT CARD — FIX TITLE TO 2 LINES
====================================== */

.product-card .product-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;

  /* 🔑 FORCE EXACTLY 2 LINES */
  height: calc(1.3em * 2); /* line-height × 2 lines */

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;

  overflow: hidden;
  text-overflow: ellipsis;

  margin-bottom: 6px;
}

.product-actions {
  min-height: 32px;
}

.product-card h5,
.product-card p {
  margin-bottom: 6px; /* reduce default spacing */
}

.product-actions {
  margin-top: 6px;      /* small, controlled gap */
  display: flex;
  gap: 8px;
}

/* ===============================
   OTHER COLOURS
================================ */

.other-colors {
  margin-top: 24px;
}

.other-colors-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #222;
}

.color-variants {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-variant {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 480px) {
  .color-variant {
    width: 48px;
    height: 48px;
  }
}


.color-variant.active {
  border: 2px solid #7b1e3a;
}


.color-variant img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.color-variant:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}


/* +N colours bubble */
.color-count-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 26px;
  height: 26px;

  border-radius: 50%;              /* 🔑 makes it a circle */
  font-size: 0.75rem;
  font-weight: 600;

  background-color: #7b1e3a;       /* deep maroon */
  color: #ffffff;                  /* high contrast text */

  margin-left: 6px;
  line-height: 1;
}

/* Optional variants if needed later */
.color-count-bubble.gold {
  background-color: #d4af37;
  color: #3a2a00;
}

.color-count-bubble.maroon {
  background-color: #7b1e3a;
  color: #ffffff;
}


/* DEBUG: find horizontal overflow
* {
  outline: 1px solid red;
}

 */