body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.product-container {
  display: flex;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  gap: 40px; /* Add gap between image and details */
}

.product-image {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 450px;
  border-radius: 12px;
  position: relative;
  /* Remove background and animation from default state */
}

.product-image.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.product-image img {
  width: 100%;
  max-width: 450px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-image img.loaded {
  opacity: 1;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Loading placeholder when no image is present */
.product-image.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 3px solid #e0e0e0;
  border-top: 3px solid #6a0dad;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.product-details {
  padding: 20px;
  flex-grow: 1;
  min-width: 0; /* Allow text to wrap properly */
}

.product-details h1 {
  font-size: 24px;
  color: #333;
  margin-bottom: 10px;
}

.rating {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.stars i {
  color: #ffd700;
  margin-right: 5px;
}

.rating-score {
  margin-left: 10px;
  color: #666;
}

.likes {
  margin-left: 10px;
  color: #e91e63;
}

.price {
  font-size: 24px;
  color: #e91e63;
  font-weight: bold;
  margin-bottom: 20px;
}

.size-options h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 10px;
}

.sizes {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.size-btn {
  padding: 8px 15px;
  border: 1px solid #ddd;
  background-color: #fff;
  cursor: pointer;
  border-radius: 5px;
}

.size-btn:hover {
  background-color: #f5f5f5;
}

.actions {
  display: flex;
  gap: 10px;
}

.add-to-cart, .buy-now {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

.add-to-cart {
  background-color: #ff9800;
  color: #fff;
}

.add-to-cart:hover {
  background-color: #f57c00;
}

.buy-now {
  background-color: #4caf50;
  color: #fff;
}

.buy-now:hover {
  background-color: #45a049;
}

.product-description {
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.product-description h2 {
  color: #333;
  border-bottom: 2px solid #4caf50;
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.product-description ul {
  list-style-type: disc;
  padding-left: 20px;
  margin-bottom: 20px;
}

.related-products {
  display: flex;
  gap: 10px;
}

.related-products img {
  width: 100px;
  height: 130px;
  object-fit: cover;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.reviews-section {
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.reviews-section h2 {
  color: #333;
  border-bottom: 2px solid #4caf50;
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.overall-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #e6ffe6;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.overall-score {
  font-size: 24px;
  font-weight: bold;
  color: #4caf50;
}

.rating-count {
  color: #666;
}

.stars i {
  color: #ffd700;
  margin-right: 2px;
}

.reviews-list {
  margin-bottom: 20px;
}

.review {
  border-bottom: 1px solid #eee;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #6a0dad;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

.review-user {
  display: flex;
  flex-direction: column;
}

.review-username {
  font-weight: bold;
  color: #333;
}

.review-date {
  font-size: 12px;
  color: #666;
}

.review-rating {
  color: #ffd700;
  font-size: 16px;
}

.review-text {
  margin: 5px 0;
  color: #333;
}

.review-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: #666;
}

.review-details span {
  background-color: #f0f0f0;
  padding: 5px 10px;
  border-radius: 5px;
}

.review-actions {
  display: flex;
  gap: 10px;
  color: #666;
}

.review-actions i {
  cursor: pointer;
}

.review-actions i:hover {
  color: #6a0dad;
}

.customer-btn {
  padding: 10px 20px;
  background-color: #8A4AF3;
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 10px;
}

.customer-btn:hover {
  background-color: #6D2EC5;
}

.modal {
  display: none; /* Đảm bảo ẩn mặc định */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center; /* Căn giữa theo chiều ngang */
  align-items: center; /* Căn giữa theo chiều dọc */
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  min-height: 550px; /* Đảm bảo chiều cao tối thiểu */
  max-height: 80vh; /* Giới hạn chiều cao tối đa là 80% viewport height */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  box-sizing: border-box;
  margin: 0 auto; /* Căn giữa nội dung */
  overflow-y: auto; /* Thêm thanh cuộn dọc */
  top: 50%; /* Di chuyển xuống dưới 50% chiều cao trang */
  transform: translateY(-50%); /* Điều chỉnh ngược lên 50% chiều cao của modal để căn giữa chính xác */
}

@media (max-width: 768px) {
  .modal-content {
    max-width: 85%;
    width: 85%;
    padding: 15px;
    min-height: 500px;
    max-height: 75vh;
    top: 50%;
    transform: translateY(-50%);
  }
}

@media (max-width: 480px) {
  .modal-content {
    max-width: 95%;
    width: 95%;
    padding: 10px;
    min-height: 450px;
    max-height: 70vh;
    top: 50%;
    transform: translateY(-50%);
  }

  .form-input {
    font-size: 14px;
    padding: 8px 10px;
  }

  .star-rating i {
    font-size: 18px;
  }

  .popup-btn {
    font-size: 14px;
    padding: 8px 10px;
  }
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #333;
}

.description-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 100%;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.form-group.user-info {
  align-items: center;
}

.user-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

#userName {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #5E20E1;
  font-size: 18px;
}

.form-group label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #5E20E1;
}

.form-input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  background: #fff;
  color: #5E20E1;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 16px;
  border-radius: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.form-input:hover {
  background: #f9f9f9;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.form-input[readonly] {
  background-color: #f0f0f0;
  cursor: not-allowed;
}

.star-rating {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.star-rating i {
  color: #ccc;
  cursor: pointer;
  font-size: 20px;
}

.star-rating i.selected {
  color: #ffd700;
}

.star-rating i:hover,
.star-rating i:hover ~ i {
  color: #ffd700;
}

.popup-btn {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  background: #fff;
  color: #5E20E1;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 16px;
  border-radius: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.popup-btn:hover {
  background: #f9f9f9;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.popup-btn.primary {
  background: linear-gradient(to right, #6a0dad, #a200ff);
  color: #fff;
  border: none;
}

.popup-btn.primary:hover {
  background: linear-gradient(to right, #5a009d, #8e00d6);
}

.banner-container {
  text-align: center;
  .banner-image {
    max-width: 100%;
    height: auto;
  }
}

/* Review Modal Styles */
.review-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.review-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-modal-content {
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.review-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 2px solid #f0f0f0;
  background: linear-gradient(135deg, #5B22D4, #7C3AED);
  color: white;
  border-radius: 15px 15px 0 0;
}

.review-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.close-review-modal {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1;
}

.close-review-modal:hover {
  color: #ff6b6b;
}

.review-modal-body {
  padding: 25px;
}

.review-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #5B22D4;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #5B22D4;
}

.review-user-info span {
  font-weight: 600;
  color: #5B22D4;
  font-size: 16px;
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  margin-bottom: 5px;
}

.review-input {
  padding: 12px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  background-color: #fff;
}

.review-input:focus {
  outline: none;
  border-color: #5B22D4;
  box-shadow: 0 0 0 3px rgba(91, 34, 212, 0.1);
}

.review-textarea {
  padding: 12px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
  transition: all 0.3s;
}

.review-textarea:focus {
  outline: none;
  border-color: #5B22D4;
  box-shadow: 0 0 0 3px rgba(91, 34, 212, 0.1);
}

.star-rating {
  display: flex;
  gap: 8px;
  align-items: center;
}

.star-rating i {
  font-size: 24px;
  color: #ddd;
  cursor: pointer;
  transition: all 0.2s;
}

.star-rating i:hover,
.star-rating i.selected {
  color: #ffd700;
  transform: scale(1.1);
}

.star-rating i:hover ~ i {
  color: #ddd;
}

.review-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e1e5e9;
}

.review-cancel-btn {
  padding: 12px 24px;
  border: 2px solid #6c757d;
  background-color: transparent;
  color: #6c757d;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.review-cancel-btn:hover {
  background-color: #6c757d;
  color: white;
}

.review-submit-btn {
  padding: 12px 24px;
  border: none;
  background: linear-gradient(135deg, #5B22D4, #7C3AED);
  color: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.review-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(91, 34, 212, 0.3);
}

.review-submit-btn:active {
  transform: translateY(0);
}

.review-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

/* Responsive Design for Review Modal */
@media (max-width: 768px) {
  .review-modal-content {
    width: 95%;
    margin: 20px;
    max-height: 95vh;
  }
  
  .review-modal-header {
    padding: 15px 20px;
  }
  
  .review-modal-body {
    padding: 20px;
  }
  
  .review-actions {
    flex-direction: column;
  }
  
  .review-cancel-btn,
  .review-submit-btn {
    width: 100%;
    text-align: center;
  }
}

.size-guide-btn {
  background: #fff;
  color: #6a0dad;
  border: 2px solid #6a0dad;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 600;
  margin-left: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
}
.size-guide-btn:hover {
  background: #f6f2ff;
  color: #4a1cb3;
  border-color: #4a1cb3;
}

.size-guide-overlay {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Modal overlay fix for size guide */
#sizeGuideModal.modal {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.3);
  align-items: center;
  justify-content: center;
}
#sizeGuideModal.modal.show {
  display: flex;
}

.skeleton-loader {
  display: inline-block;
  height: 1em;
  width: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.2s infinite linear;
  border-radius: 6px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.highlight-size {
  box-shadow: 0 0 0 4px #a98cf7, 0 2px 12px rgba(123,63,242,0.10);
  border: 2px solid #7B3FF2 !important;
  transition: box-shadow 0.3s, border 0.3s;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 18px;
}
.cart-qty-btn,
.cart-qty-input {
  width: 44px !important;
  height: 44px !important;
  border: 3px solid #C5ED51 !important;
  border-radius: 12px !important;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 0 !important;
  margin: 0 !important;
}
.cart-qty-btn {
  color: #8A4AF3;
  font-size: 1.5rem;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s, color 0.2s, border 0.2s;
}
.cart-qty-btn:hover {
  background: #f8f8fd;
  color: #5B22D4;
  border-color: #A3E635;
}
.cart-qty-input {
  text-align: center;
  font-size: 1.5rem;
  color: #23222a;
  font-weight: 800;
  border: 3px solid #C5ED51 !important;
  border-radius: 12px !important;
  background: #fff;
  pointer-events: none;
  appearance: none;
}