/*
filename: Shop.css
author: Stevens L
student id last four: 0791
cs username:
*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: #c0dd97;
  color: #1a3a16;
  padding: 100px 20px 60px;
  min-height: 100vh;
}

/* =========================================
   BACK TO TOP BUTTON
   Button that takes the user to the top
   of the page
   ========================================= */
#goUP {
display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  font-size: 14px;
  border: 2px solid #1a3a16;
  background: #c2deba;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.6);
  color: #1a3a16;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BACK TO TOP BUTTON HOVER EFFECT */
#goUP:hover {
  background-color: #678f62;
  color: #eef5ea;
}

/* =========================================
   GRID LAYOUT AND PRODUCT CARDS
   The grid container layout and product
   card styling
   ========================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* PRODUCT CARD STYLING */
.card {
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: #eef5ea;
  border: 2px solid #1a3a16;
  border-radius: 25px;
  padding: 20px;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* PRODUCT CARD HOVER EFFECT */
.card:hover {
  cursor: pointer;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  /* box-shadow: 0 6px 20px rgba(45, 90, 39, 0.15); */
}

/* IMAGE */
.product-img {
  width: 100%;
  max-width: 180px;
  height: 180px;
  border-radius: 20px;
  background-color: #eef5ea;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  border: 2px solid #1a3a16;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* DETAILS */
.product-details {
  text-align: center;
  width: 100%;
  margin-bottom: 10px;
}

.product-details p {
  font-size: 1rem;
  color: #black;
  margin-bottom: 4px;
}

.product-details p:last-child {
  font-weight: 600;
  color: #3b6d11;
}

/* HOVER-IN OPTIONS */
.product-options {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 10px;
  visibility: hidden;
}

.card:hover .product-options {
  visibility: visible;
}

.product-options button {
  flex: 1;
  padding: 10px 16px;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.buy-btn {
  background-color: #7aa874;
  color: white;
}

.buy-btn:hover {
  background-color: #678f62;
}

.view-btn {
  background-color: #dce8d4;
  color: #2f3a2f;
}

.view-btn:hover {
  background-color: #c8dbc4;
}

/* LIKE BUTTON */
.like-btn {
  z-index: 2;
  position: absolute;
  visibility: hidden;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  border: 2px solid #1a3a16;
  left: 16px;
  top: 16px;
  font-size: 20px;
  background-color: #fefcf8;
  color: #1a3a16;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.2s;
}
.card:hover .like-btn {
  visibility: visible;
}
.like-btn:hover {
  background-color: #7aa874;
  color: white;
  transform: scale(1.08);
}

/* QUICK-BUY DRAWER */
.quick-buy-card {
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: calc(100% + 2px);
  height: 75px;  
  background-color: #eef5ea;
  border-top: 2px solid #1a3a16;
  border-radius: 0 0 20px 20px;   
  visibility: hidden;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-family: 'Nunito', sans-serif;
  z-index: 5;
}

.quick-buy-card > div {
  font-size: 0.9rem;
  color: black;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-buy-card input {
  width: 50px;
  padding: 6px 8px;
  border: 2px solid #444;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  text-align: center;
  outline: none;
}

.quick-add-to-cart {
  padding: 8px 16px;
  background-color: #7aa874;
  color: white;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.quick-add-to-cart:hover {
  background-color: #678f62;
}

.visible {
  visibility: visible;
}
