@import url("styleShared.css");

body {
  background: linear-gradient(135deg, #f6e5c8, #ffffff);
}

.products-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.filter-mobile-bar {
  display: none;
  padding: 0 20px 10px 20px;
}

.filter-toggle-btn {
  background-color: #b19c77;
  color: #50320b;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 1rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.filter-backdrop {
  display: none;
}

.filter-placeholder {
  width: 300px;
  flex-shrink: 0;
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(177, 156, 119, 0.35);
  border-radius: 16px;
  padding: 24px;
  box-sizing: border-box;
  box-shadow: 0 8px 22px rgba(80, 50, 11, 0.08);
}

.filter-header-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-header-mobile h2 {
  margin: 0;
  color: #50320b;
  font-size: 2rem;
}

.filter-close-btn {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #50320b;
  cursor: pointer;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-form label {
  font-weight: 600;
  color: #50320b;
}

.filter-form select,
.filter-form input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(177, 156, 119, 0.6);
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  box-sizing: border-box;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #50320b;
  font-weight: 500;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.price-range-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.price-input-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-input-box span {
  font-size: 0.95rem;
  color: #50320b;
  font-weight: 500;
}

.range-slider-wrap {
  position: relative;
  height: 24px;
}

.slider-line,
.slider-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 999px;
}

.slider-line {
  width: 100%;
  background-color: #e4d7c0;
}

.slider-track {
  background-color: #b19c77;
  left: 0;
  right: 0;
}

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

.range-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
}

.range-slider-wrap input[type="range"]::-moz-range-track {
  height: 6px;
  background: transparent;
}

.range-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background-color: #50320b;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  pointer-events: auto;
}

.range-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #50320b;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  pointer-events: auto;
}

.price-limits {
  display: flex;
  justify-content: space-between;
  color: #50320b;
  font-size: 0.95rem;
  font-weight: 500;
}

.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-reset {
  display: block;
  text-align: center;
  text-decoration: none;
  background-color: rgba(177, 156, 119, 0.18);
  color: #50320b;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
}

.products-container {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
}

.product-card {
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.product-image {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 12px 8px 12px;
  box-sizing: border-box;
}

.product-image img {
  width: 100%;
  max-width: 150px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
}

.product-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-info h3.product-name {
  font-size: 1.1rem;
  margin: 0 0 8px 0;
  color: #50320b;
  font-weight: 700;
}

.product-info p.product-description {
  flex-grow: 1;
  font-size: 0.92rem;
  color: #666;
  margin: 0 0 12px 0;
  line-height: 1.45;
}

.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: #50320b;
}

.cart-form {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cart-form label {
  color: #50320b;
  font-weight: 500;
}

.cart-form input[type="number"] {
  width: 70px;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid rgba(177, 156, 119, 0.6);
}

.cart-button {
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background-color: #b19c77;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.cart-button img {
  width: 22px;
  height: 22px;
}

.cart-message {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 10px;
  margin: 10px auto 20px auto;
  text-align: center;
  max-width: 600px;
  border-radius: 6px;
}

.no-products {
  grid-column: 1 / -1;
  text-align: center;
  color: #50320b;
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 30px;
}

@media (max-width: 1200px) {
  .products-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-placeholder {
    width: 280px;
  }
}

@media (max-width: 900px) {
  .filter-mobile-bar {
    display: block;
  }

  .products-layout {
    padding: 0 20px 20px 20px;
  }

  .products-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-placeholder {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    overflow-y: auto;
    z-index: 1200;
    border-radius: 0 18px 18px 0;
    background-color: #f7efe1;
    transition: left 0.25s ease;
  }

  .filter-placeholder.active {
    left: 0;
  }

  .filter-close-btn {
    display: block;
  }

  .filter-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1100;
  }

  .filter-backdrop.active {
    opacity: 1;
    visibility: visible;
  }

  body.filter-open {
    overflow: hidden;
  }
}

@media (max-width: 600px) {
  .filter-mobile-bar {
    padding: 0 14px 10px 14px;
  }

  .products-layout {
    padding: 0 14px 20px 14px;
  }

  .products-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .price-inputs {
    grid-template-columns: 1fr;
  }

  .cart-form {
    align-items: stretch;
  }
}