/* static/css/modal.css */

/* Modal Background */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow: auto;
  justify-content: center;
  align-items: center;
}

/* Modal Content */
.modal-content {
  background-color: #fff;
  margin: auto;
  max-width: 900px;
  width: 90%;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  padding: 20px;
  animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Close Button */
.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #555;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1;
}

.close-modal:hover {
  color: #000;
}

/* Product Modal Grid */
.product-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .product-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* Product Image */
.product-image-container {
  display: flex;
  justify-content: center;
  align-items: start;
}

#modal-product-image {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 4px;
}

/* Product Details */
.product-details {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.product-details h2 {
  margin: 0;
  font-size: 24px;
  color: #333;
}

.price {
  font-size: 22px;
  font-weight: bold;
  color: #222;
  margin: 0;
}

.product-description {
  color: #555;
  line-height: 1.5;
  margin: 10px 0;
}

/* Colors Selection */
.product-colors,
.product-sizes {
  margin-top: 10px;
}

.product-colors h4,
.product-sizes h4,
.quantity-selector h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #333;
}

.color-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-option {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}

/* Size Selection */
.size-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.size-option {
  min-width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  padding: 0 10px;
}

.size-option:hover {
  border-color: #999;
  background-color: #f9f9f9;
}

.size-option.selected {
  background-color: #000;
  color: #fff;
  border-color: #000;
}

/* Quantity Selector */
.quantity-selector {
  margin-top: 10px;
}

.quantity-control {
  display: flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.quantity-btn {
  width: 40px;
  height: 40px;
  background: #f5f5f5;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s;
}

.quantity-btn:hover {
  background-color: #e5e5e5;
}

#quantity-input {
  width: 50px;
  height: 40px;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: center;
  font-size: 16px;
}

#quantity-input::-webkit-inner-spin-button,
#quantity-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Add to Cart Button */
.add-to-cart-btn {
  margin-top: 20px;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
}

.add-to-cart-btn:hover {
  background-color: #333;
}

/* Cart icon and count */
.cart-icon {
  position: relative;
  margin-left: 20px;
}

.cart-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: #f00;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
}