/**
 * Popup Form Styles
 * Professional and clean popup design
 */

/* ================================
   POPUP OVERLAY
   ================================ */

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.popup-container {
  position: relative;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 5px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: popupFadeIn 0.3s ease-out;
}

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

/* ================================
   POPUP CONTENT
   ================================ */

.popup-content {
  position: relative;
  overflow: hidden;
}

.popup-inner {
  display: flex;
  min-height: 500px;
}

/* Order popup - full width layout */
.popup-overlay.order-popup .popup-inner {
  display: block;
}

.popup-overlay.order-popup .popup-image-section {
  display: none;
}

.popup-overlay.order-popup .popup-form-section {
  flex: none;
  width: 100%;
  max-width: 100%;
  max-height: none;
}

.popup-overlay.order-popup .popup-container {
  max-width: 700px;
}

/* Bulk order button styling */
.bulk-order-btn {
  cursor: pointer;
  transition: all 0.3s ease;
}

.bulk-order-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ================================
   CLOSE BUTTON
   ================================ */

.popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #333;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 0;
}

.popup-close:hover {
  background: #ffffff;
  transform: scale(1.1);
  color: white !important;
}

/* ================================
   FORM SECTION (LEFT SIDE)
   ================================ */

.popup-form-section {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #ffffff;
  overflow-y: auto;
  max-height: 90vh;
}

.popup-header {
  margin-bottom: 30px;
  text-align: left;
}

.popup-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.popup-subtitle {
  font-size: 16px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

.popup-form {
  flex: 1;
}

/* Override contact-form styles for popup */
.popup-form.contact-form {
  padding-left: 0 !important;
  border-left: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* Style Formidable form elements */
.popup-form .frm_form_fields {
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.popup-form .frm_fields_container {
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.popup-form .frm_forms,
.popup-form form {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.popup-form .frm_form_field {
  margin-bottom: 20px !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.popup-form .frm_form_field label {
  font-weight: 600 !important;
  color: #333 !important;
  margin-bottom: 8px !important;
  display: block !important;
  font-size: 14px !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.popup-form .frm_form_field input[type="text"],
.popup-form .frm_form_field input[type="email"],
.popup-form .frm_form_field input[type="tel"],
.popup-form .frm_form_field textarea,
.popup-form .frm_form_field select {
  border-radius: 5px !important;
  font-size: 16px !important;
  color: #333 !important;
  background: #ffffff !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  height: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.popup-form .frm_form_field input:focus,
.popup-form .frm_form_field textarea:focus,
.popup-form .frm_form_field select:focus {
  outline: none !important;
  border-color: var(--primary-color) !important;
  box-shadow: none !important;
}

.popup-form .frm_form_field textarea {
  resize: vertical !important;
  min-height: 100px !important;
}

.popup-form .frm_submit {
  margin-top: 20px !important;
}

.popup-form .frm_submit input[type="submit"],
.popup-form .frm_submit button[type="submit"],
.popup-form input[type="submit"],
.popup-form button[type="submit"] {
  all: unset !important;
  background: var(--primary-color) !important;
  color: #ffffff !important;
  padding: 8px 16px !important;
  border-radius: 5px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
  text-transform: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.popup-form .frm_submit input[type="submit"]:hover,
.popup-form .frm_submit button[type="submit"]:hover,
.popup-form input[type="submit"]:hover,
.popup-form button[type="submit"]:hover {
  background: var(--primary-color) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(123, 17, 19, 0.3) !important;
}

/* ================================
   IMAGE SECTION (RIGHT SIDE)
   ================================ */

.popup-image-section {
  flex: 1;
  position: relative;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.popup-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.popup-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(123, 17, 19, 0.8),
    rgba(123, 17, 19, 0.6)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 40px;
}

.popup-image-content {
  max-width: 300px;
}

.popup-icon {
  font-size: 48px;
  color: #ffffff;
  margin-bottom: 20px;
  opacity: 0.9;
}

.popup-image-content h4 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #ffffff;
  line-height: 1.3;
}

.popup-image-content p {
  font-size: 16px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

/* ================================
   BODY SCROLL LOCK
   ================================ */

body.popup-open {
  overflow: hidden;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

/* Tablet (max-width: 768px) */
@media (max-width: 768px) {
  .popup-overlay {
    padding: 15px;
  }

  .popup-container {
    max-height: 95vh;
    border-radius: 5px;
  }

  .popup-inner {
    flex-direction: column;
    min-height: auto;
  }

  .popup-form-section {
    padding: 30px 25px;
    order: 2;
    max-height: 70vh;
    overflow-y: auto;
  }

  .popup-image-section {
    order: 1;
    min-height: 200px;
    flex: none;
  }

  .popup-title {
    font-size: 24px;
  }

  .popup-subtitle {
    font-size: 15px;
  }

  .popup-image-content h4 {
    font-size: 20px;
  }

  .popup-image-content p {
    font-size: 15px;
  }

  .popup-icon {
    font-size: 36px;
    margin-bottom: 15px;
  }

  .popup-close {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .popup-overlay {
    padding: 10px;
  }

  .popup-form-section {
    padding: 25px 20px;
    max-height: 60vh;
    overflow-y: auto;
  }

  .popup-title {
    font-size: 22px;
  }

  .popup-subtitle {
    font-size: 14px;
  }

  .popup-form input[type="text"],
  .popup-form input[type="email"],
  .popup-form input[type="tel"],
  .popup-form textarea,
  .popup-form select {
    padding: 10px 14px;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .popup-form input[type="submit"],
  .popup-form button[type="submit"] {
    padding: 12px 24px;
    font-size: 15px;
  }

  .popup-image-section {
    min-height: 180px;
  }

  .popup-image-overlay {
    padding: 30px 20px;
  }

  .popup-image-content h4 {
    font-size: 18px;
  }

  .popup-image-content p {
    font-size: 14px;
  }

  .popup-icon {
    font-size: 32px;
    margin-bottom: 12px;
  }
}

/* ================================
   ACCESSIBILITY
   ================================ */

/* High contrast mode */
@media (prefers-contrast: high) {
  .popup-content {
    border: 2px solid currentColor;
  }

  .popup-form input,
  .popup-form textarea,
  .popup-form select {
    border-width: 2px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .popup-container {
    animation: none;
  }

  .popup-form input,
  .popup-form textarea,
  .popup-form select,
  .popup-close {
    transition: none;
  }
}

/* Focus styles for better accessibility */
.popup-close:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
  .popup-overlay {
    display: none;
  }
}
