/* ========================================
   MODERN POPUP - Add to Cart Modal
   ======================================== */

/* Backdrop */
.popup-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Container */
.popup-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  max-width: 1000px;
  width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, -40%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

/* Close button */
.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 32px;
  color: #666666;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 10000;
}

.popup-close:hover,
.popup-close:focus {
  background: #f0f0f0;
  color: #222222;
  outline: none;
}

/* Main Content */
.popup-content {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  padding: 40px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.popup-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Success Section (Left) */
.popup-success {
  justify-content: center;
  align-items: center;
}

.success-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #27ae60, #229954);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.popup-title {
  font-size: 24px;
  font-weight: 700;
  color: #222222;
  margin: 0 0 30px 0;
  text-align: center;
}

/* Product Summary */
.popup-product-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.popup-product-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.popup-product-info {
  flex: 1;
}

.popup-product-name {
  font-size: 14px;
  font-weight: 600;
  color: #222222;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.popup-price {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

.price-original {
  text-decoration: line-through;
  color: #999999;
}

.price-current {
  font-size: 16px;
  font-weight: 700;
  color: #8b0e0e;
}

/* Action Buttons */
.popup-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-btn {
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  white-space: nowrap;
}

.popup-btn-primary {
  background: linear-gradient(135deg, #8b0e0e, #a01414);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 14, 14, 0.3);
}

.popup-btn-primary:hover,
.popup-btn-primary:focus {
  background: linear-gradient(135deg, #6b0a0a, #8b0e0e);
  box-shadow: 0 6px 16px rgba(139, 14, 14, 0.4);
  transform: translateY(-2px);
  outline: none;
}

.popup-btn-primary:active {
  transform: translateY(0);
}

.popup-btn-secondary {
  background: #f0f0f0;
  color: #222222;
  border: 2px solid #e0e0e0;
}

.popup-btn-secondary:hover,
.popup-btn-secondary:focus {
  background: #e8e8e8;
  border-color: #999999;
  outline: none;
}

.popup-btn-secondary:active {
  background: #e0e0e0;
}

/* Recommendations Section (Right) */
.popup-recommendations {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.recommendations-title {
  font-size: 18px;
  font-weight: 700;
  color: #222222;
  margin: 0 0 20px 0;
  flex-shrink: 0;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  flex: 1;
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-color: #8b0e0e #f0f0f0;
  scrollbar-width: thin;
}

/* Scrollbar styling - Chrome, Safari, Edge */
.recommendations-grid::-webkit-scrollbar {
  width: 8px;
}

.recommendations-grid::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
  margin: 4px 0;
}

.recommendations-grid::-webkit-scrollbar-thumb {
  background: #8b0e0e;
  border-radius: 4px;
  background-image: linear-gradient(135deg, #8b0e0e, #a01414);
}

.recommendations-grid::-webkit-scrollbar-thumb:hover {
  background: #6b0a0a;
  background-image: linear-gradient(135deg, #6b0a0a, #8b0e0e);
}

/* Recommendation Card */
.recommendation-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
      height: 400px;

}

.recommendation-card:hover {
  border-color: #8b0e0e;
  box-shadow: 0 8px 20px rgba(139, 14, 14, 0.12);
}

/* Image Container */
.recommendation-image-container {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f8f8f8;
  flex-shrink: 0;
}

.recommendation-image-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.recommendation-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.recommendation-card:hover .recommendation-image {
  transform: scale(1.08);
}

/* Badge */
.recommendation-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e74c3c;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* Product Info */
.recommendation-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  justify-content: space-between;
}

.recommendation-name {
  font-size: 15px;
  font-weight: 700;
  color: #222222;
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
  margin-bottom: 4px;
}

.recommendation-name:hover {
  color: #8b0e0e;
}

.recommendation-info .popup-price {
  font-size: 14px;
  font-weight: 700;
  color: #8b0e0e;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* Recommendation Button */
.recommendation-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #8b0e0e;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 16px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  margin-top: auto;
  width: 100%;
  min-height: 48px;
}

.recommendation-btn:hover,
.recommendation-btn:focus {
  background: #6b0a0a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(139, 14, 14, 0.3);
  outline: none;
}

.recommendation-btn:active {
  transform: translateY(0);
}

/* ==================
   RESPONSIVE DESIGN
   ================== */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
  .popup-content {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }

  .recommendations-grid {
    grid-template-columns: repeat(2, 1fr);
    max-height: 500px;
    height: auto;
  }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  .popup-modal {
    width: 95vw;
    max-height: 90vh;
    border-radius: 8px;
  }

  .popup-content {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 16px;
  }

  .popup-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .success-icon {
    width: 50px;
    height: 50px;
    font-size: 28px;
    margin-bottom: 16px;
  }

  .popup-product-summary {
    padding: 12px;
    gap: 12px;
    margin-bottom: 20px;
  }

  .popup-product-img {
    width: 70px;
    height: 70px;
  }

  .popup-product-name {
    font-size: 13px;
  }

  .popup-actions {
    gap: 10px;
  }

  .popup-btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .recommendations-title {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .recommendations-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 450px;
    height: auto;
  }

  .popup-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 28px;
  }

  .recommendation-card {
    border-radius: 6px;
  }

  .recommendation-image-container {
    height: 180px;
  }

  .recommendation-info {
    padding: 16px;
  }

  .recommendation-name {
    font-size: 14px;
    font-weight: 700;
    -webkit-line-clamp: 2;
    min-height: 30px;
  }

  .recommendation-info .popup-price {
    font-size: 13px;
    font-weight: 700;
    color: #8b0e0e;
    margin-bottom: 10px;
  }

  .recommendation-btn {
    padding: 14px 8px;
    font-size: 14px;
    font-weight: 700;
    min-height: 46px;
  }
}

/* Extra small: < 480px */
@media (max-width: 480px) {
  .popup-modal {
    max-height: 92vh;
  }

  .popup-content {
    padding: 12px;
    gap: 16px;
  }

  .popup-title {
    font-size: 18px;
  }

  .success-icon {
    width: 45px;
    height: 45px;
    font-size: 24px;
    margin-bottom: 12px;
  }

  .popup-product-summary {
    padding: 10px;
    gap: 10px;
  }

  .popup-product-img {
    width: 60px;
    height: 60px;
  }

  .recommendations-title {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .recommendations-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: 400px;
    height: auto;
  }

  .recommendation-card {
    display: flex;
    flex-direction: row;
    border-radius: 6px;
    gap: 0;
    height: 140px;
  }

  .recommendation-image-container {
    width: 120px;
    height: 140px;
    flex-shrink: 0;
  }

  .recommendation-info {
    padding: 12px;
    flex: 1;
  }

  .recommendation-name {
    font-size: 13px;
    font-weight: 700;
    -webkit-line-clamp: 1;
    min-height: 20px;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  .recommendation-info .popup-price {
    font-size: 12px;
    font-weight: 700;
    color: #8b0e0e;
    margin-bottom: 8px;
  }

  .recommendation-btn {
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 700;
    width: 100%;
    min-height: 40px;
  }
}

/* ==================
   OLD POPUP STYLES (backward compatibility)
   ================== */

.container_related_products {
  display: none;
}

.content_related_products {
  display: none;
}
