/* ===============================
   Add to Quote (single product widget)
=============================== */
.quote-list-plugin .quote-container {
  display: flex;
  flex-direction: column; /* stack qty-control + button full width */
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
  width: 100%;
}

/* ===============================
   Quantity Control
=============================== */
.quote-list-plugin .qty-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #C2C2C2;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  width: auto;       /* don't force 100% - prevents grid break */
  height: 40px;
  padding: 0 5px;
}

.quote-list-plugin .qty-control button {
  flex: 0 0 40px;
  height: 100%;
  border: none;
  background: #fff;
  color: #0a4a84;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.quote-list-plugin .qty-control button:hover,
.quote-list-plugin .qty-control button:focus,
.quote-list-plugin .qty-control button:active {
  background: #f0f6fa;
  color: #02457A;
  outline: none;
  box-shadow: none;
}

.quote-list-plugin .qty-control input {
  flex: 1;
  height: 100%;
  border: none;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  background: transparent;
  outline: none;
}

/* ===============================
   Add to Quote Button
=============================== */
.quote-list-plugin .quote-container .quote-btn {
  display: block;
  padding: 10px 16px;
  border: 1px solid #0a4a84;
  border-radius: 8px;
  background: #fff;
  color: #0a4a84;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  transition: all 0.2s ease;
  width: 100%;
}

.quote-list-plugin .quote-container .quote-btn:hover,
.quote-list-plugin .quote-container .quote-btn:focus,
.quote-list-plugin .quote-container .quote-btn:active {
  background: #02457A;
  color: #fff;
  outline: none;
  box-shadow: none;
}

/* ===============================
   Quote List Page (cards layout)
=============================== */
.quote-list-plugin .quote-select-all {
  margin-bottom: 10px;
  font-size: 14px;
}

.quote-list-plugin .quote-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 20px;
  padding: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.quote-list-plugin .quote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.quote-list-plugin .quote-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Enhanced image styling */
.quote-list-plugin .quote-image {
  flex-shrink: 0;
  width: 180px;
  height: auto;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border: 1px solid #C2C2C2;
  border-radius: 15px;
  padding: 6px;
  overflow: hidden;
}

.quote-list-plugin .quote-body img,
.quote-list-plugin .quote-image img {
  width: 100%;
  max-width: 180px;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  border: none !important;
  border-radius: 8px !important;
  background: transparent;
  display: block;
}

/* Fallback for broken images */
.quote-list-plugin .quote-image img[src=""],
.quote-list-plugin .quote-image img[src*="undefined"],
.quote-list-plugin .quote-image img[src*="null"] {
  opacity: 0.3;
  background: #f0f0f0;
}

/* Image loading states */
.quote-list-plugin .quote-image img {
  transition: opacity 0.3s ease;
}

.quote-list-plugin .quote-image img:not([src]),
.quote-list-plugin .quote-image img[src=""] {
  opacity: 0;
}

.quote-list-plugin .quote-details { 
  flex: 1; 
  min-width: 0; /* Prevents flex item from overflowing */
}

.quote-list-plugin .quote-details h4 { 
  margin: 0 0 6px; 
  color: #0a4a84; 
  word-wrap: break-word;
}

.quote-list-plugin .category-label {
  display: inline-block;
  background: #f5f5f5;
  color: #444;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 10px;
}

/* Synonyms text styling */
.quote-list-plugin .synonyms-text {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  margin-bottom: 12px;
  word-wrap: break-word;
  font-style: italic;
}

.quote-list-plugin .synonyms-text .hidden { display: none; }
.quote-list-plugin .synonyms-text a {
  font-size: 13px;
  color: #02457A;
  cursor: pointer;
  text-decoration: none;
  font-style: normal;
  font-weight: 500;
}
.quote-list-plugin .synonyms-text a:hover { text-decoration: underline; }

.quote-list-plugin .qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 15px;
}

.quote-list-plugin .quote-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 15px 20px;
  margin: 15px 0;
  padding: 12px 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
}

.quote-list-plugin .quote-meta .meta-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  min-width: 0;
  align-items: baseline;
}

.quote-list-plugin .quote-meta .meta-label {
  font-weight: 600;
  color: #0a4a84;
  font-size: 13px;
  flex-shrink: 0;
}

.quote-list-plugin .quote-meta .meta-label::after {
  content: ":";
}

.quote-list-plugin .quote-meta .meta-value { 
  color: #333;
  word-wrap: break-word;
  font-size: 14px;
  flex: 1;
}

.quote-list-plugin .meta-value .status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}

.status-instock { background: #e8f7ed; color: #1b7e3c; }
.status-back    { background: #f2f2f2; color: #666; }
.status-default { background: #eee; color: #444; }

.quote-list-plugin .remove-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
}
.quote-list-plugin .remove-btn:hover { color: red; }

/* ===============================
   Quote List Actions
=============================== */
.quote-list-plugin .quote-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 20px;
  flex-wrap: wrap;
}

.quote-list-plugin .quote-actions-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quote-list-plugin .quote-actions-left .quote-btn {
  padding: 12px 20px;
  border: none;
  background: #D4D4D5;
  color: #000;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease;
  white-space: nowrap;
}
.quote-list-plugin .quote-actions-left .quote-btn:hover { background: #bfbfc0; }

.quote-list-plugin .quote-actions-right {
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
}

.quote-list-plugin .quote-actions-right .quote-btn.green {
  padding: 14px 30px;
  border: none;
  border-radius: 10px;
  background: #4DB6AC;
  color: #fff;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}
.quote-list-plugin .quote-actions-right .quote-btn.green:hover { background: #399b92; }

/* ===============================
   Toast Notification
=============================== */
.quote-list-plugin .quote-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #4DB6AC;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: fadeIn 0.3s ease;
  z-index: 9999;
  max-width: 350px;
}

.quote-list-plugin .quote-toast p { 
  margin: 0 0 6px; 
  word-wrap: break-word;
}

.quote-list-plugin .quote-toast .quote-link {
  color: #fff;
  font-weight: bold;
  text-decoration: underline;
}

.quote-list-plugin .quote-toast.hide {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===============================
   Quote Form Popup
=============================== */
.quote-form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
  padding: 20px;
}

.quote-form-popup {
  background: #D0D0D0;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

.quote-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px 15px;
  border-bottom: 1px solid #eee;
}

.quote-form-header h3 {
  margin: 0;
  color: #0a4a84;
  font-size: 24px;
}

.close-popup {
  background: none !important;
  border: none !important;
  font-size: 28px !important;
  color: #0a4a84 !important;
  cursor: pointer !important;
  line-height: 1 !important;
  padding: 0 !important;
  width: 30px !important;
  height: 30px !important;
}

.close-popup:hover {
  color: #02457A;
}

.quote-form {
  padding: 20px 25px 25px;
}

.form-section {
  margin-bottom: 25px;
}

.form-section h4 {
  margin: 0 0 15px;
  color: #0a4a84;
  font-size: 18px;
  border-bottom: 2px solid #f0f6fa;
  padding-bottom: 8px;
}

.selected-products {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  max-height: 200px;
  overflow-y: auto;
}

.form-product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #dee2e6;
  min-height: 40px;
  width: 100%;
}

.form-product-item:last-child {
  border-bottom: none;
}

.form-product-name {
  font-weight: 500;
  color: #333;
  display: flex;
  align-items: center;
}

.form-product-qty {
  background: #0a4a84;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
  margin-top: 20px;
}

.form-group label {
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0a4a84;
  box-shadow: 0 0 0 2px rgba(10, 74, 132, 0.1);
}

.form-group textarea {
  resize: vertical;
  font-family: inherit;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.btn-cancel,
.btn-submit {
  padding: 12px 25px;
  border: none !important;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #fff !important;
  background: #0a4a84 !important;
}

.btn-cancel:hover,
.btn-submit:hover {
  background: #02457A !important;
  color: #fff !important;
}

.btn-submit:disabled {
  background: #ccc !important;
  cursor: not-allowed;
  color: #666 !important;
}

.quote-form-overlay.closing {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive form design */
@media (max-width: 768px) {
  .quote-form-popup {
    margin: 10px;
    max-height: 95vh;
  }
  
  .quote-form-header,
  .quote-form {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn-cancel,
  .btn-submit {
    width: 100%;
  }
}

/* ===============================
   Responsive Design
=============================== */
@media (max-width: 768px) {
  .quote-list-plugin .quote-body {
    flex-direction: column;
    gap: 15px;
  }
  
  .quote-list-plugin .quote-image {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
  
  .quote-list-plugin .quote-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .quote-list-plugin .quote-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .quote-list-plugin .quote-actions-left,
  .quote-list-plugin .quote-actions-right {
    justify-content: center;
  }
  
  .quote-list-plugin .quote-toast {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}