/* ==========================================================================
   WC Request Quote — Frontend Styles v2
   ========================================================================== */

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */

@keyframes wrq-spin {
  to { transform: rotate(360deg); }
}

@keyframes wrq-expand-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes wrq-expand-out {
  from { opacity: 1; transform: translateY(0);    }
  to   { opacity: 0; transform: translateY(-5px); }
}

@keyframes wrq-attention-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(44, 62, 80, 0.6); }
  50%  { box-shadow: 0 0 0 16px rgba(44, 62, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(44, 62, 80, 0); }
}

#wrq-panel-wrap.wrq-attention #wrq-trigger {
  animation: wrq-attention-pulse 0.6s ease-out 2;
}

/* --------------------------------------------------------------------------
   Hide Theme Cart Button + WooCommerce "Added to Cart" Notice
   -------------------------------------------------------------------------- */

ul.topnav--cart,
ul.sh-component.topnav--cart,
.kl-cart-button,
#mycartbtn,
.topnav-li:has(#mycartbtn),
.woocommerce-notices-wrapper .woocommerce-message {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Hide WooCommerce Pricing — Sitewide
   -------------------------------------------------------------------------- */

/* Shop / archive product prices */
.woocommerce ul.products .price,
.woocommerce-page ul.products .price,

/* Single product page price */
.woocommerce div.product p.price,
.woocommerce div.product span.price,

/* Variable product variation price block */
.woocommerce-variation-price,
.woocommerce-variation .price,

/* Cart page: price and subtotal columns */
.woocommerce-cart-form .product-price,
.woocommerce-cart-form .product-subtotal,
.woocommerce-cart-form table.shop_table thead .product-price,
.woocommerce-cart-form table.shop_table thead .product-subtotal,

/* Cart totals sidebar */
.cart-collaterals .cart_totals,

/* Mini cart: item price and total */
.widget_shopping_cart .cart_list li .quantity,
.woocommerce-mini-cart-item .woocommerce-Price-amount,
.woocommerce-mini-cart__total,
.widget_shopping_cart_content .total,

/* Checkout order review: product total column and order totals footer */
.woocommerce-checkout-review-order-table .product-total,
.woocommerce-checkout-review-order-table thead .product-total,
.woocommerce-checkout-review-order-table tfoot,

/* Order received / thank-you page totals */
.woocommerce-order-overview__total,
.woocommerce-order-details .woocommerce-table tfoot,

/* BACS bank account details block */
.woocommerce-bacs-bank-details,
#wc-bacs-bank-details,

/* Order overview: payment method line */
.woocommerce-order-overview__payment-method {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Panel Wrap — fixed anchor for both the button and the panel
   -------------------------------------------------------------------------- */

#wrq-panel-wrap {
  position: fixed;
  bottom: 30px;
  z-index: 9998;
}

#wrq-panel-wrap[data-position="left"]  { left: 30px;  right: auto; }
#wrq-panel-wrap[data-position="right"] { right: 30px; left: auto;  }

/* --------------------------------------------------------------------------
   Floating Trigger Button
   -------------------------------------------------------------------------- */

#wrq-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

#wrq-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  background: #1a252f;
}

#wrq-trigger:focus-visible {
  outline: 3px solid #3498db;
  outline-offset: 3px;
}

.wrq-trigger-icon {
  font-size: 18px;
  line-height: 1;
}

/* Cart count badge */
#wrq-trigger-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-sizing: border-box;
  line-height: 1;
  transition: transform 0.2s ease;
}

/* Hide badge when cart is empty */
#wrq-trigger-badge[data-count="0"] {
  display: none;
}

/* --------------------------------------------------------------------------
   Expandable Panel (Base: Floating / Modal Modifier)
   -------------------------------------------------------------------------- */

#wrq-panel {
  position: absolute;
  bottom: calc(100% + 12px); /* gap above the trigger button */
  width: 360px;
  max-height: 620px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 11;

  /* Closed state — invisible, shifted down slightly */
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Anchor left or right edge to match button position (only if not modal) */
#wrq-panel-wrap[data-position="left"]  #wrq-panel:not(.wrq-is-modal) {
  left: 0;
  transform-origin: bottom left;
}
#wrq-panel-wrap[data-position="right"] #wrq-panel:not(.wrq-is-modal) {
  right: 0;
  transform-origin: bottom right;
}

/* Open state (base) */
#wrq-panel.wrq-panel-open:not(.wrq-is-modal) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* --------------------------------------------------------------------------
   Center Modal Modifier
   -------------------------------------------------------------------------- */

#wrq-panel-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

#wrq-panel.wrq-panel-open.wrq-is-modal + #wrq-panel-overlay {
  opacity: 1;
  pointer-events: all;
}

#wrq-panel.wrq-is-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 90vw;
  max-width: 400px;
  max-height: 85vh;
  bottom: auto;
  right: auto;
  transform: translate(-50%, -45%) scale(0.97);
}

/* Open state (modal) */
#wrq-panel.wrq-panel-open.wrq-is-modal {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: all;
}

/* Panel Header */
#wrq-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

#wrq-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

#wrq-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
}

#wrq-panel-close:hover         { color: #111; background: #f0f0f0; }
#wrq-panel-close:focus-visible { outline: 2px solid #3498db; }

/* --------------------------------------------------------------------------
   Panel Body — single scrollable container for items + form
   -------------------------------------------------------------------------- */

#wrq-panel-body {
  flex: 1;
  min-height: 0;        /* required: lets flexbox shrink below content height */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
}

#wrq-panel-body::-webkit-scrollbar       { width: 4px; }
#wrq-panel-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* --------------------------------------------------------------------------
   Items list (no longer its own scroll zone)
   -------------------------------------------------------------------------- */

#wrq-panel-items {
  flex-shrink: 0;
  padding: 10px 14px;
  min-height: 60px;
}

.wrq-cart-empty {
  color: #999;
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
  margin: 0;
  line-height: 1.5;
}

/* Spinner while loading */
.wrq-items-loading {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.wrq-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #2c3e50;
  border-radius: 50%;
  animation: wrq-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Individual item row */
.wrq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f5f5f5;
}

.wrq-item:last-child { border-bottom: none; }

.wrq-item-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
  flex-shrink: 0;
  background: #f5f5f5;
  display: block;
}

.wrq-item-info {
  flex: 1;
  min-width: 0;
}

.wrq-item-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wrq-item-sku {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}

.wrq-item-attrs {
  display: block;
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

/* WPC Product Options rows */
.wrq-item-option {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wrq-item-option-title {
  font-weight: 600;
  color: #374151;
}

.wrq-option-file {
  color: #3498db;
  text-decoration: underline;
}

.wrq-item-qty {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  flex-shrink: 0;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 20px;
}

.wrq-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #d1d5db;
  font-size: 18px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  font-family: inherit;
  transition: color 0.15s;
}

.wrq-item-remove:hover { color: #ef4444; }

/* --------------------------------------------------------------------------
   Contact form (sticky at panel bottom)
   -------------------------------------------------------------------------- */

#wrq-panel-form {
  border-top: 1px solid #f0f0f0;
  padding: 12px 14px 14px;
  background: #fafafa;
  /* margin-top: auto pushes the form to the bottom of the body when items are few */
  margin-top: auto;
}

#wrq-contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wrq-form-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: #111;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wrq-form-field input:focus {
  outline: none;
  border-color: #2c3e50;
  box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.wrq-form-field input.wrq-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.wrq-field-error {
  font-size: 11px;
  color: #ef4444;
  display: block;
  margin-top: 2px;
  padding-left: 2px;
}

#wrq-form-error {
  font-size: 13px;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 12px;
  display: none;
}

#wrq-form-error.wrq-visible { display: block; }

/* Two-button row */
.wrq-panel-btns {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

#wrq-submit-btn {
  flex: 1;
  padding: 10px 12px;
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#wrq-submit-btn:hover:not(:disabled) { background: #1a252f; }
#wrq-submit-btn:disabled             { opacity: 0.5; cursor: not-allowed; }
#wrq-submit-btn:focus-visible        { outline: 2px solid #3498db; outline-offset: 2px; }

#wrq-continue-btn {
  flex: 1;
  padding: 10px 12px;
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

#wrq-continue-btn:hover        { background: #f3f4f6; border-color: #9ca3af; }
#wrq-continue-btn:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Form Sections (radio group + conditional fields pair)
   -------------------------------------------------------------------------- */

.wrq-form-section {
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   Radio Groups
   -------------------------------------------------------------------------- */

.wrq-radio-group-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wrq-group-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.wrq-radio-group {
  display: flex;
  gap: 6px;
}

.wrq-radio-card {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 8px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  color: #6b7280;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
  user-select: none;
  background: #fff;
}

.wrq-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.wrq-radio-card:hover {
  border-color: #9ca3af;
  color: #374151;
}

.wrq-radio-card.wrq-radio-selected {
  border-color: #2c3e50;
  color: #2c3e50;
  background: rgba(44, 62, 80, 0.05);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Conditional Field Groups — JS-controlled show/hide with keyframe animation
   -------------------------------------------------------------------------- */

/* Base state: hidden. JS sets display:none on init and toggles it. */
.wrq-conditional-fields {
  display: none;
  flex-direction: column;
  gap: 7px;
  padding-top: 7px;
}

/* Shown state — JS adds this class after setting display:flex */
.wrq-conditional-fields.wrq-expanded {
  display: flex;
  animation: wrq-expand-in 0.22s ease both;
}

/* Collapsing state — JS adds this while animating out, then sets display:none */
.wrq-conditional-fields.wrq-collapsing {
  display: flex;
  animation: wrq-expand-out 0.16s ease both;
}

/* --------------------------------------------------------------------------
   Responsive — Tablet / Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  #wrq-panel-wrap {
    bottom: 20px;
  }

  #wrq-panel-wrap[data-position="left"]  { left: 16px; }
  #wrq-panel-wrap[data-position="right"] { right: 16px; }

  #wrq-panel {
    width: calc(100vw - 32px);
    max-width: 360px;
  }
}

@media (max-width: 480px) {
  /* Icon-only trigger on tiny screens */
  #wrq-trigger .wrq-trigger-label { display: none; }

  #wrq-trigger {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .wrq-trigger-icon { font-size: 22px; }

  #wrq-panel { width: calc(100vw - 32px); }
}
