/*--------------------------------------------------------------
  M-Fishing Theme – Shop / Archive Page
  Tokens: cream-bg #FDFCF8 | rich-black #121212 | muted-gold #D4AF37
          soft-gray #F2F0EB | lux-green #1B4D3E | lux-green-light #2A6E5A
  Fonts:  "Cinzel", serif (headings) | "Manrope", sans-serif (body)
--------------------------------------------------------------*/

/* ---- Product grid ---- */
.mf-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.mf-product-grid.mf-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.mf-product-grid .mf-product-card {
  background: #FDFCF8;
  border: 1px solid #F2F0EB;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.25s ease;
}

.mf-product-grid .mf-product-card:hover {
  box-shadow: 0 8px 30px rgba(18, 18, 18, 0.08);
  transform: translateY(-3px);
}

.mf-product-grid .mf-product-card .mf-product-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #F2F0EB;
}

.mf-product-grid .mf-product-card .mf-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.mf-product-grid .mf-product-card:hover .mf-product-thumb img {
  transform: scale(1.05);
}

.mf-product-grid .mf-product-card .mf-product-info {
  padding: 16px 18px 20px;
}

.mf-product-grid .mf-product-card .mf-product-title {
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #121212;
  margin: 0 0 8px;
  line-height: 1.35;
}

.mf-product-grid .mf-product-card .mf-product-price {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #1B4D3E;
}

/* List view */
.mf-product-grid.mf-list-view {
  grid-template-columns: 1fr;
  gap: 20px;
}

.mf-product-grid.mf-list-view .mf-product-card {
  display: grid;
  grid-template-columns: 240px 1fr;
}

.mf-product-grid.mf-list-view .mf-product-card .mf-product-thumb {
  aspect-ratio: auto;
  height: 100%;
}

.mf-product-grid.mf-list-view .mf-product-card .mf-product-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
}

/* ---- Sidebar filters ---- */
.mf-shop-sidebar {
  font-family: "Manrope", sans-serif;
}

.mf-shop-sidebar .mf-filter-group {
  margin-bottom: 28px;
}

.mf-shop-sidebar .mf-filter-title {
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #121212;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #F2F0EB;
}

.mf-shop-sidebar .mf-filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mf-shop-sidebar .mf-filter-list li {
  margin-bottom: 8px;
}

.mf-shop-sidebar .mf-filter-list li label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #121212;
  cursor: pointer;
  transition: color 0.2s ease;
}

.mf-shop-sidebar .mf-filter-list li label:hover {
  color: #1B4D3E;
}

.mf-shop-sidebar .mf-filter-list li input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #e0ddd6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mf-shop-sidebar .mf-filter-list li input[type="checkbox"]:checked {
  background: #1B4D3E;
  border-color: #1B4D3E;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---- Price range slider ---- */
.mf-price-slider {
  padding: 8px 0;
}

.mf-price-slider .mf-range-track {
  position: relative;
  height: 4px;
  background: #F2F0EB;
  border-radius: 2px;
  margin: 16px 0;
}

.mf-price-slider .mf-range-fill {
  position: absolute;
  height: 100%;
  background: #D4AF37;
  border-radius: 2px;
}

.mf-price-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: transparent;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
}

.mf-price-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FDFCF8;
  border: 3px solid #D4AF37;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease;
}

.mf-price-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.mf-price-slider .mf-price-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #888;
  margin-top: 10px;
}

/* ---- Sort dropdown ---- */
.mf-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.mf-sort-select {
  appearance: none;
  background: #FDFCF8 url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23121212' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid #e0ddd6;
  border-radius: 8px;
  padding: 10px 40px 10px 16px;
  font-family: "Manrope", sans-serif;
  font-size: 0.875rem;
  color: #121212;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.mf-sort-select:focus {
  outline: none;
  border-color: #D4AF37;
}

.mf-result-count {
  font-family: "Manrope", sans-serif;
  font-size: 0.875rem;
  color: #888;
}

/* ---- View toggle (grid / list) ---- */
.mf-view-toggle {
  display: inline-flex;
  gap: 4px;
  background: #F2F0EB;
  border-radius: 8px;
  padding: 4px;
}

.mf-view-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #888;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mf-view-toggle button.active,
.mf-view-toggle button:hover {
  background: #FDFCF8;
  color: #121212;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.mf-view-toggle button svg {
  width: 18px;
  height: 18px;
}

/* ---- Loading overlay ---- */
.mf-products-loading {
  position: relative;
  pointer-events: none;
}

.mf-products-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(253, 252, 248, 0.75);
  border-radius: 12px;
  z-index: 10;
}

.mf-products-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid #F2F0EB;
  border-top-color: #D4AF37;
  border-radius: 50%;
  z-index: 11;
  animation: mf-spin 0.7s linear infinite;
}

@keyframes mf-spin {
  to { transform: rotate(360deg); }
}

/* ---- Active filter tags ---- */
.mf-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.mf-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F2F0EB;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: "Manrope", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #121212;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mf-filter-tag:hover {
  background: #e8e5de;
}

.mf-filter-tag .mf-tag-remove {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  color: #888;
  transition: color 0.2s ease;
}

.mf-filter-tag:hover .mf-tag-remove {
  color: #c0392b;
}

.mf-clear-all-filters {
  font-family: "Manrope", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1B4D3E;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 6px 4px;
  transition: color 0.2s ease;
}

.mf-clear-all-filters:hover {
  color: #D4AF37;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .mf-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .mf-product-grid.mf-grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .mf-product-grid,
  .mf-product-grid.mf-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .mf-product-grid.mf-list-view {
    grid-template-columns: 1fr;
  }
  .mf-product-grid.mf-list-view .mf-product-card {
    grid-template-columns: 1fr;
  }
  .mf-shop-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .mf-product-grid,
  .mf-product-grid.mf-grid-4 {
    grid-template-columns: 1fr;
  }
}
