/* CART CARD -------------------------------------------------- */
.cart-card {
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #e7e7ea;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 18px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 220px;
}
.cart-page {
  background: #a477ad;
  min-height: 100vh;
  padding-top: 120px; /* 👈 простор за fixed navbar */
}

input.quantity-input::-webkit-outer-spin-button,
input.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: auto; 
    margin: 0;
}

input.quantity-input {
    -moz-appearance: auto; /* Firefox */
}


.cart-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(210, 96, 233, 0.312);
}

/* IMAGE WRAPPER ---------------------------------------------- */
.cart-images {
  flex-shrink: 0;
}

.carousel-container {
  position: relative;
  width: 220px;
  height: 220px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #dfdfdf;
}

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.55);
  border: none;
  padding: 4px 7px;
  cursor: pointer;
  border-radius: 5px;
}
.left-btn {
  left: 5px;
}
.right-btn {
  right: 5px;
}

/* DETAILS ----------------------------------------------------- */
.cart-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.cart-details h5 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #441d47;
}

/* PRICE -------------------------------------------------------- */
.price-info {
  margin-bottom: 8px;
  font-size: 15px;
}
.old-price {
  color: #d5d5d5;
  text-decoration: line-through;
}
.discount-percent {
  color: red;
  font-weight: 600;
  margin-left: 6px;
}
.new-price {
  color: #156b29;
  font-size: 17px;
  font-weight: bold;
}

/* QUANTITY ----------------------------------------------------- */
.quantity-input {
  width: 80px;
  border-radius: 8px;
  border: 1px solid #7d2a72;
  padding: 4px 8px;
  transition: border-color 0.2s;
}
.quantity-input:focus {
  border-color: #6c63ff;
  box-shadow: 0 0 6px rgba(170, 115, 185, 0.575);
}

/* CART ACTIONS ------------------------------------------------ */
.cart-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.cart-actions .btn-danger {
  padding: 6px 12px;
  border-radius: 8px;
}

/* MASONRY ------------------------------------------------------ */
.masonry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 0;
  margin: 0;
  margin-top: 50px;
}

.masonry:has(.masonry-item:only-child) {
  justify-content: center;
  margin-top: 60px;
  margin-bottom: 30px;
}
.masonry:has(.masonry-item:only-child) .cart-card {
  margin: 0 auto;
  border: none;
  max-width: 400px;
  background: transparent;
}
/* MASONRY ITEM ------------------------------------------------- */
.masonry-item {
  display: block;
}
.masonry-item .cart-card {
  width: 100%;
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e9e3e3;
  border-radius: 12px;
  background: transparent no-repeat center center; /* lilja pozadina */
  background-size: 60%; /* големина на сликата */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.masonry-item .cart-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Responsive -------------------------------------------------- */
@media (max-width: 1024px) {
  .masonry:has(.masonry-item:only-child) .cart-card {
    max-width: 350px;
  }
  .cart-card {
    gap: 15px;
    min-height: 200px;
  }
  .carousel-container,
  .carousel-img {
    width: 200px;
    height: 200px;
  }
  
input.quantity-input::-webkit-outer-spin-button,
input.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: auto; 
    margin: 0;
}

input.quantity-input {
    -moz-appearance: auto; /* Firefox */
}

}

@media (max-width: 768px) {
  .masonry {
    grid-template-columns: 1fr;
  }
  .masonry:has(.masonry-item:only-child) .cart-card {
    max-width: 300px;
  }
  .cart-card {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    min-height: auto;
  }
  .carousel-container,
  .carousel-img {
    width: 180px;
    height: 180px;
  }
  .cart-actions {
    width: 100%;
    margin-top: 10px;
  }
  
input.quantity-input::-webkit-outer-spin-button,
input.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: auto; 
    margin: 0;
}

input.quantity-input {
    -moz-appearance: auto; /* Firefox */
}

}

@media (max-width: 480px) {
  .carousel-container,
  .carousel-img {
    width: 160px;
    height: 160px;
  }
  .masonry:has(.masonry-item:only-child) .cart-card {
    max-width: 260px;
  }
  .cart-card {
    padding: 15px;
  }
  .cart-details h5 {
    font-size: 16px;
  }
  .new-price {
    font-size: 16px;
  }
  
input.quantity-input::-webkit-outer-spin-button,
input.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: auto; 
    margin: 0;
}

input.quantity-input {
    -moz-appearance: auto; /* Firefox */
}

}
