/* Modal Container */
.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.popup-container.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Content */
.popup-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  width: 800px;
  overflow: hidden;
  transform: scale(0.7) translateY(50px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: row;
  scroll-behavior: smooth;
}

.popup-container.active .popup-content {
  transform: scale(1) translateY(0);
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #333;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.close-btn:hover {
  background: #ff4757;
  color: white;
  transform: rotate(90deg) scale(1.1);
}

/* Image Section */
.popup-image-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.popup-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.popup-image:hover {
  transform: scale(1.05);
}

/* Details Section */
.popup-details {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: white;
}

.popup-details h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 20px 0;
  text-transform: capitalize;
  position: relative;
}

.popup-details h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
}

.popup-details .product-price {
  font-size: 2rem;
  font-weight: 600;
  color: #27ae60;
  margin: 10px 0 20px 0;
}

.popup-details .product-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.popup-details .info-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #ecf0f1;
}

.popup-details .info-item:last-child {
  border-bottom: none;
}

.popup-details .info-label {
  font-weight: 600;
  color: #34495e;
  min-width: 140px;
  margin-right: 15px;
}

.popup-details .info-value {
  color: #7f8c8d;
  flex: 1;
}

.popup-details .product-description {
  color: #555;
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 20px 0;
}

/* Action Buttons */
.popup-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea;
  padding: 13px 28px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

/* Responsive Design */
/* Large tablets and small laptops */
@media (max-width: 1024px) {
  .popup-content {
    width: 85vw;
    max-height: 90vh;
  }

  .popup-details {
    padding: 30px;
  }

  .popup-details h2 {
    font-size: 2.2rem;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .popup-container {
    padding: 10px;
  }

  .popup-content {
    flex-direction: column;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 15px;
  }

  .close-btn {
    top: 10px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .popup-image-section {
    height: 280px;
    max-height: 280px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
  }

  .popup-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
  }

  .popup-details {
    padding: 20px;
    flex: 1;
  }

  .popup-details h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }

  .popup-details .product-price {
    font-size: 1.3rem;
    margin: 10px 0 15px 0;
  }

  .popup-details .product-description {
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 15px 0;
  }

  .popup-details .info-item {
    padding: 10px 0;
  }

  .popup-details .info-label {
    min-width: 120px;
    font-size: 0.9rem;
  }

  .popup-details .info-value {
    font-size: 0.9rem;
  }

  .popup-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 0.95rem;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .popup-container {
    padding: 5px;
  }

  .popup-content {
    width: 95vw;
    max-height: 92vh;
    border-radius: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .close-btn {
    top: 8px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .popup-image-section {
    height: 220px;
    max-height: 220px;
  }

  .popup-details {
    padding: 15px;
  }

  .popup-details h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
  }

  .popup-details .product-price {
    font-size: 1.2rem;
    margin: 8px 0 12px 0;
  }

  .popup-details .product-description {
    font-size: 0.9rem;
    line-height: 1.3;
    margin: 12px 0;
  }

  .popup-details .info-item {
    padding: 8px 0;
  }

  .popup-details .info-label {
    min-width: 100px !important;
    font-size: 0.85rem;
  }

  .popup-details .info-value {
    font-size: 0.85rem;
  }

  .popup-actions {
    margin-top: 15px;
    gap: 8px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 10px 16px;
    font-size: 0.9rem;
    border-radius: 25px;
  }

  /* Optimize store info section for mobile */
  .store-info {
    margin-top: 15px;
  }

  .store-info h3 {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .store-details p {
    font-size: 0.8rem;
    margin: 4px 0;
    line-height: 1.2;
  }
}

/* Extra small phones */
@media (max-width: 360px) {
  .popup-content {
    width: 98vw;
  }

  .popup-image-section {
    height: 180px;
    max-height: 180px;
  }

  .popup-details {
    padding: 12px;
  }

  .popup-details h2 {
    font-size: 1.3rem;
  }

  .popup-details .product-price {
    font-size: 1.1rem;
  }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .popup-content {
    flex-direction: row;
    max-height: 95vh;
  }

  .popup-image-section {
    height: auto;
    max-height: none;
    flex: 0.6;
  }

  .popup-details {
    flex: 1;
    overflow-y: auto;
  }
}

/* Better focus states for accessibility */
.close-btn:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

.btn-primary:focus,
.btn-secondary:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}
