/* HTW Bao Gia Styles - CSS với prefix htw- */

.htw-bao-gia-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.htw-bao-gia-radio {
  width: 16px;
  height: 16px;
}

.htw-bao-gia-label {
  cursor: pointer;
  font-weight: 500;
}

#htw-bao-gia-notice {
  font-size: 13px;
}

/* Floating button */
#htw-bao-gia-float.htw-bg-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0f62fe;
  color: #fff;
  border: none;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
  cursor: pointer;
}

#htw-bao-gia-float .htw-bg-icon {
  font-size: 18px;
}

#htw-bao-gia-float .htw-bg-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 12px;
  text-align: center;
  padding: 0 4px;
}

/* Overlay */
#htw-bg-overlay.htw-bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9998;
}

/* Modal */
#htw-bao-gia-popup.htw-bg-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 720px;
  max-width: calc(100% - 40px);
  max-height: 80vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  z-index: 9999;
  overflow: hidden;
}

#htw-bao-gia-popup .htw-bg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 600;
  background: #f6f8fa;
  border-bottom: 1px solid #eee;
}

#htw-bao-gia-popup .htw-bg-title { 
  font-size: 18px; 
}

#htw-bao-gia-popup .htw-bg-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

#htw-bao-gia-popup .htw-bg-items {
  max-height: 44vh;
  overflow: auto;
  padding: 8px 16px;
}

#htw-bao-gia-popup .htw-bg-item {
  display: grid;
  grid-template-columns: 56px 1fr 110px 36px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

#htw-bao-gia-popup .htw-bg-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: #f2f2f2;
}

#htw-bao-gia-popup .htw-bg-info {
  flex: 1;
}

#htw-bao-gia-popup .htw-bg-name {
  font-weight: 600;
  margin-bottom: 4px;
}

#htw-bao-gia-popup .htw-bg-meta {
  font-size: 12px;
  color: #666;
}

#htw-bao-gia-popup .htw-bg-qty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
}



#htw-bao-gia-popup .htw-bg-qty-input {
  width: 60px;
  height: 32px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

#htw-bao-gia-popup .htw-bg-remove {
  justify-self: end;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

#htw-bao-gia-popup .htw-bg-empty {
  padding: 16px;
  text-align: center;
  color: #666;
}

#htw-bao-gia-popup .htw-bg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

#htw-bao-gia-popup .htw-bg-clear-all {
  background: transparent;
  border: none;
  color: #e11d48;
  cursor: pointer;
}



/* Quote page styles */
.htw-quote-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  font-family: Arial, sans-serif;
}

.htw-company-header {
  text-align: center;
  margin-bottom: 30px;
}

.htw-company-name {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
}

.htw-company-info {
  font-size: 14px;
  color: #666;
}

.htw-quote-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}

.htw-products-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.htw-products-table th, 
.htw-products-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.htw-products-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.htw-total-row {
  font-weight: bold;
  background-color: #f9f9f9;
}

.htw-disclaimer {
  margin-top: 30px;
  font-size: 12px;
  color: #666;
}

.htw-actions {
  margin-top: 20px;
  text-align: center;
}

.htw-btn {
  padding: 10px 20px;
  margin: 0 10px;
  background-color: #007cba;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.htw-btn:hover {
  background-color: #005a87;
}

.htw-btn-secondary {
  background-color: #6c757d;
}

.htw-btn-secondary:hover {
  background-color: #545b62;
}

/* Logo and QR styles */
.htw-logo-container {
  margin-bottom: 10px;
}

.htw-company-logo-img {
  max-width: 200px;
  max-height: 100px;
  border: 1px solid #ddd;
  padding: 5px;
}

.htw-logo-placeholder {
  width: 200px;
  height: 100px;
  border: 2px dashed #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  margin: 0 auto;
}

.htw-logo-text {
  font-weight: bold;
  margin-bottom: 5px;
}

.htw-logo-icon {
  font-size: 24px;
}

.htw-qr-container {
  text-align: center;
  margin-top: 20px;
}

.htw-qr-code-img {
  max-width: 150px;
  border: 1px solid #ddd;
  padding: 5px;
}

/* Responsive */
@media (max-width: 768px) {
  #htw-bao-gia-popup.htw-bg-modal {
    width: calc(100% - 20px);
    max-width: none;
  }
  
  #htw-bao-gia-popup .htw-bg-item {
    grid-template-columns: 48px 1fr 90px 32px;
    gap: 8px;
  }
  
  #htw-bao-gia-popup .htw-bg-thumb {
    width: 48px;
    height: 48px;
  }
  
  .htw-quote-container {
    padding: 10px;
  }
  
  .htw-products-table {
    font-size: 14px;
  }
  
  .htw-products-table th, 
  .htw-products-table td {
    padding: 6px;
  }
}

/* Admin styles */
.htw-admin-container {
  max-width: 800px;
  margin: 20px auto;
}

.htw-admin-header {
  margin-bottom: 20px;
}

.htw-admin-title {
  font-size: 24px;
  margin-bottom: 10px;
}

.htw-form-table {
  width: 100%;
  border-collapse: collapse;
}

.htw-form-table th {
  text-align: left;
  padding: 10px;
  width: 200px;
  vertical-align: top;
}

.htw-form-table td {
  padding: 10px;
}

.htw-upload-container {
  margin-bottom: 10px;
}

.htw-preview {
  margin-bottom: 10px;
}

.htw-preview img {
  max-width: 200px;
  max-height: 100px;
  border: 1px solid #ddd;
  padding: 5px;
}

.htw-preview-placeholder {
  width: 200px;
  height: 100px;
  border: 2px dashed #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

.htw-upload-btn {
  margin-right: 10px;
}

.htw-remove-btn {
  margin-left: 10px;
  color: #e11d48;
}

/* Notification styles */
.htw-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 4px;
  color: white;
  font-weight: 500;
  z-index: 10000;
  max-width: 300px;
}

.htw-notification-success {
  background-color: #28a745;
}

.htw-notification-error {
  background-color: #dc3545;
}

.htw-notification-warning {
  background-color: #ffc107;
  color: #212529;
}

.htw-notification-info {
  background-color: #17a2b8;
}

/* Loading state for checkbox */
.htw-bao-gia-radio.htw-checking {
  opacity: 0.6;
  pointer-events: none;
}

.htw-bao-gia-radio.htw-checking + .htw-bao-gia-label {
  opacity: 0.6;
  position: relative;
}

.htw-bao-gia-radio.htw-checking + .htw-bao-gia-label::after {
  content: '';
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border: 2px solid #ccc;
  border-top: 2px solid #0f62fe;
  border-radius: 50%;
  animation: htw-spin 1s linear infinite;
}

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

