/**
 * Wine Shop - Multi-level Filter CSS
 */

/* Filter container styles */
.product-filters {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.product-filters__form {
    display: block;
    width: 100%;
}

.filter-groups-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0px;
    width: 100%;
    margin-bottom: 16px;
}

.filter-group {
    min-width: 0;
}

/* 讓所有 filter box 統一寬度 */
.filter-group select,
.filter-group input {
    width: 140px;
}

@media (max-width: 768px) {
  .product-filters {
    padding: 10px;
  }
  .filter-groups-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }
  .filter-group {
    min-width: 0;
    width: 100%;
  }
  .filter-group select,
  .filter-group input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 16px;
    padding: 10px 12px;
  }
  .price-filter-group {
    min-width: 0;
    width: 100%;
  }
  .filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }
  .filter-button {
    width: 100%;
    font-size: 16px;
    padding: 12px 0;
  }
}

/* Price filter specific styles */
.price-filter-group {
    grid-column: span 1;
    min-width: 180px;
}

.price-range-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-label {
    margin-bottom: 0;
}


.price-label {
    font-size: 14px;
    margin-bottom: 8px;
    color: #666;
}

.price-inputs {
    display: flex;
    align-items: center;
}

.price-input {
    width: 100px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.price-separator {
    margin: 0 5px;
    color: #999;
}

.price-apply-btn {
    margin-left: 10px;
    padding: 8px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.price-apply-btn:hover {
    background-color: #0056b3;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.763L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.filter-select:hover {
    border-color: #d0d0d0;
}

.filter-select:focus {
    outline: none;
    border-color: #b30000;
    box-shadow: 0 0 0 2px rgba(179, 0, 0, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    grid-column: -2 / -1;
    justify-self: end;
    align-self: end;
}

.filter-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.filter-reset {
    background-color: #f5f5f5;
    color: #666;
}

.filter-reset:hover {
    background-color: #e8e8e8;
}

.applied-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.filter-tag .remove-tag {
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.6;
    background: none;
    border: none;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    color: #666;
}

.filter-tag .remove-tag:hover {
    opacity: 1;
}

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

@media (max-width: 992px) {
    .product-filters__form {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-filters__form {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-buttons {
        grid-column: auto;
        justify-self: stretch;
        width: 100%;
    }
}

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