/* =============================== */
/* 🌟 GENERAL SHOP GRID STYLING */
/* =============================== */

.shop-grid {
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
}

/* 📦 Product Grid - 3 items per row */
.product-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
}

/* =============================== */
/* 🛒 CART SIDEBAR STYLING */
/* =============================== */

/* 📌 Cart Sidebar - Initially Hidden */
#cart-sidebar {
  position: fixed;
  right: -350px; /* Initially hidden */
  top: 0;
  width: 350px;
  height: 100%;
  background: #333;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: right 0.3s ease-in-out;
  color: white;
  z-index: 1000;
}

/* 📌 Show Cart Sidebar */
.cart-visible {
  right: 0 !important; /* Make sure it overrides the default hidden state */
}

/* 🛒 Cart Header */
#cart-sidebar h2 {
  color: #fff;
  text-align: center;
  margin-bottom: 15px;
}

/* 🛒 Custom Scrollbar (Chrome, Edge, Safari) */
#cart-items::-webkit-scrollbar {
  width: 6px; /* ✅ Smaller scrollbar */
}

#cart-items::-webkit-scrollbar-track {
  background: #444; /* Dark background for contrast */
  border-radius: 10px;
}

#cart-items::-webkit-scrollbar-thumb {
  background: #ffcc00; /* Cute yellow thumb */
  border-radius: 10px; /* ✅ Rounded scrollbar */
}

#cart-items::-webkit-scrollbar-thumb:hover {
  background: #e6b800; /* Slightly darker on hover */
}

/* 🛒 Prevent List Resizing When Scrollbar Appears */
#cart-items {
  flex-grow: 1;
  overflow-y: auto;
  max-height: 60vh;
  padding: 60px 0 10px 0;
  list-style: none;

  /* ✅ Always reserve space for scrollbar */
  overflow-y: scroll; /* Forces scrollbar to always be present */
}

/* 🛍 Individual Cart Item */
#cart-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #444;
  margin: 4px 0;
  padding: 8px;
  border-radius: 5px;
  color: white;
  width: calc(100% - 8px); /* ✅ Adjust width so it doesn't shrink */
  margin-left: auto;
  margin-right: auto;
}

/* =============================== */
/* 🛒 CART TOGGLE BUTTON */
/* =============================== */

#cart-toggle {
  position: fixed;
  top: 80px;
  right: 30px; /* Aligns it to the right */
  width: 60px;
  height: 60px;
  background: #ffcc00;
  color: black;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease-in-out, transform 0.2s ease-in-out;
  z-index: 1001; /* Ensures it stays on top */
}

/* Hover Effect */
#cart-toggle:hover {
  background: #e6b800;
  transform: scale(1.1);
}

@keyframes cart-flash {
  0% {
    transform: scale(1);
    background-color: transparent;
  }
  50% {
    transform: scale(1.2);
    background-color: #44ff63;
  }
  100% {
    transform: scale(1);
    background-color: transparent;
  }
}

.cart-flash {
  animation: cart-flash 0.5s ease;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 50%;
  font-weight: bold;
  display: none; /* kezdetben elrejtve, ha 0 */
}

/* =============================== */
/* 💳 CHECKOUT BUTTON */
/* =============================== */

/* 💳 Checkout Button */
.checkout-button {
  background: #ccc;
  border: none;
  padding: 10px;
  cursor: not-allowed;
  width: 100%;
  border-radius: 5px;
  font-size: 1rem;
}

.checkout-button.enabled {
  background: #e6b800;
  color: white;
  cursor: pointer;
}

.checkout-button:hover {
  background: #44ff63;
  color: black;
}

/* =============================== */
/* 📱 RESPONSIVE DESIGN */
/* =============================== */

@media (max-width: 768px) {
  /* 🛒 Mobile Sidebar Behavior */
  #cart-sidebar {
    width: 100%;
    right: -100%;
    top: 0;
    height: 100vh;
    border-radius: 0;
  }

  /* 📌 Show Sidebar on Open */
  #cart-sidebar.cart-visible {
    right: 0;
  }

  /* 🛒 Adjust Toggle Button for Mobile */
  #cart-toggle {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  /* 🛍 Product Grid - 2 per row on small screens */
  .product-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  /* 🛍 Product Grid - 1 per row on smaller screens */
  .product-container {
    grid-template-columns: 1fr;
  }
}

/* 📩 Customer Email Input - Pinned at Bottom */
.cart-footer {
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}

/* 📩 Customer Email Input */
.customer-email {
  width: 100%;
  padding: 12px 15px;
  font-size: 1rem;
  border: 2px solid #ffcc00;
  border-radius: 5px;
  background-color: #222;
  color: white;
  outline: none;
  transition: border 0.3s ease-in-out, background 0.3s ease-in-out;
  margin-bottom: 10px; /* Ensures spacing above checkout button */
}

/* 🔍 Placeholder Styling */
.customer-email::placeholder {
  color: #bbb;
  font-style: italic;
}

/* 🟡 Focus Effect */
.customer-email:focus {
  border-color: #ffdb4d;
  background-color: #333;
}
