@import url("./reset.css");
@import url("./variables.css");

#filter-container {
    display: flex;
    justify-items: flex-start;
    align-items: center;
    gap: 10px;
}

.filter {
    padding: 8px 12px;
    font-size: 1rem;
    height: 40px;
    border: 1px solid lightgrey;
    border-radius: 5px;
}

.filter-item {
    display: flex;
    flex-direction: column; 
    margin-bottom: 15px;
    min-width: 150px;
}

.filter-item label {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.filter-item select {
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid lightgrey;
    background-color: white;
}

.filter-item select:focus {
    border-color: black;
    outline: none;
}

#clear-filters {
    background-color: var(--footer-bg);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 0.7rem 1rem;
}

#clear-filters:hover {
    background-color: #74600D;
}

/*Loading spinner animation */
#loading {
    border: 8px solid lightgray;
    border-top: 8px solid #545F71;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    display: block;
    margin: 0 auto;
  }

.original-price {
    text-decoration: line-through;
    color: grey;
    margin-right: 5px;
}

.current-price {
    font-weight: bold;
}

#product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.product-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.product {
    background-color: white;
    border: 1px solid lightgrey;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.product:hover {
    transform: translateY(-5px);
}

.product img {
    width: auto;
    height: 200px;
}

.product h3 {
    margin: 1rem;
    font-size: 1.2rem;
}

.product p {
    font-size: 1rem;
    color: #555;
    margin: 0.5rem;
}

.view-product-button {
    width: 80%;
    background-color: #E8CE5F;
    font-size: 1rem;
    font-weight: bold;
    color: black;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    margin-bottom: 20px;
    text-decoration: none;
    
}

.view-product-button:hover {
    background-color: #74600D;
}

@media (max-width: 800px) {
    #filter-container {
      flex-direction: column;
      align-items: flex-start;
    }
  
    .filter-item {
      width: 100%;
      margin-bottom: 0px;
    }
  
    .filter {
      padding: 10px;
    }
}
