/* AWHT Quote System Styles */

/* Quote Cart Button */
.quote-cart-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  overflow: visible;
  white-space: nowrap;
  flex-shrink: 0;
}

.quote-cart-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.quote-cart-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
  opacity: 0.95;
}

.quote-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background-color: var(--red);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  z-index: 10;
}

/* Quote Drawer */
.quote-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  pointer-events: none;
}

.quote-drawer__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.quote-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 500px;
  height: 100%;
  background-color: white;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  pointer-events: auto;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

.quote-drawer__panel.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.quote-drawer__panel.is-open ~ .quote-drawer__overlay {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .quote-drawer__panel {
    max-width: 100%;
  }
}

/* Quote Drawer Header */
.quote-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.quote-drawer__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.quote-drawer__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.quote-drawer__close:hover {
  color: #000;
}

/* Quote Drawer Body */
.quote-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.quote-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: #999;
}

.quote-drawer__items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Quote Item */
.quote-drawer__item {
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #eee;
}

.quote-drawer__item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.quote-drawer__item-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.quote-drawer__item-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

.quote-drawer__item-remove:hover {
  color: var(--red);
}

.quote-drawer__item-details {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.quote-drawer__item-name {
  margin: 0.25rem 0;
  color: #666;
}

.quote-drawer__item-price {
  margin: 0.25rem 0;
  font-weight: 600;
  color: var(--red);
}

.quote-drawer__item-sku {
  margin: 0.25rem 0;
  font-size: 0.8rem;
  color: #999;
}

.quote-drawer__item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.quote-drawer__qty-input {
  width: 60px;
  padding: 0.375rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.85rem;
}

/* Quote Drawer Footer */
.quote-drawer__footer {
  padding: 1rem;
  border-top: 1px solid #eee;
  background-color: #f9f9f9;
}

.quote-drawer__totals {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.quote-drawer__total-row {
  display: flex;
  justify-content: space-between;
  color: #666;
}

.quote-drawer__total-row--main {
  color: #000;
  font-weight: 600;
  padding-top: 0.5rem;
  border-top: 1px solid #ddd;
  color: var(--red);
}

/* Quote Form Modal */
.quote-form-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.quote-form-modal__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
}

.quote-form-modal__container {
  position: relative;
  z-index: 1;
  background-color: white;
  border-radius: 8px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.quote-form-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem;
  border-bottom: 1px solid #eee;
}

.quote-form-modal__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.quote-form-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.quote-form-modal__close:hover {
  color: #000;
}

/* Quote Form */
.quote-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.quote-form__body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  min-height: 0;
}

.form-section {
  margin-bottom: 2rem;
}

.form-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid var(--red);
  padding-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Quote Summary */
.quote-summary {
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid #eee;
}

.quote-summary__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.quote-summary__row strong {
  color: #333;
}

.quote-summary__row--total {
  border-top: 2px solid #ddd;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--red);
}

/* Quote Form Footer */
.quote-form__footer {
  display: flex;
  gap: 1rem;
  padding: 2rem;
  border-top: 1px solid #eee;
  background-color: #f9f9f9;
}

.quote-form__footer button {
  flex: 1;
}

/* Quote Form Status */
.quote-form__status {
  padding: 1rem 2rem;
}

.quote-form__status--success,
.quote-form__status--error {
  font-size: 0.9rem;
}

/* RTL Support */
[dir="rtl"] .quote-drawer__panel {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}

[dir="rtl"] .quote-drawer__panel.is-open {
  transform: translateX(0);
}

[dir="rtl"] .quote-drawer__item-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .quote-drawer__total-row {
  flex-direction: row-reverse;
}

/* Responsive */
@media (max-width: 640px) {
  .quote-form-modal {
    padding: 0.5rem;
  }

  .quote-form-modal__container {
    max-width: 100%;
    max-height: 94vh;
  }

  .quote-form-modal__header,
  .quote-form__body,
  .quote-form__footer {
    padding: 1rem;
  }

  .quote-form__footer {
    flex-direction: column;
  }
}

/* Animation */
@keyframes fadeInOut {
  0%, 100% {
    opacity: 0;
    transform: translateY(-10px);
  }
  10%, 90% {
    opacity: 1;
    transform: translateY(0);
  }
}
