/* =========================================================
   ATQ Quote List - isolated grid/card styles
   Uses atqql-* classes to avoid legacy/global CSS collisions.
========================================================= */

.atqql{
  width:100%;
  max-width:1240px;
  margin:0 auto;
  box-sizing:border-box;
}

.atqql *{
  box-sizing:border-box;
}

.atqql-head,
.atqql-empty,
.atqql-total,
.atqql-form{
  width:100%;
  margin:0 0 18px;
  padding:20px;
  border:1px solid #dfe5ec;
  border-radius:14px;
  background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}

.atqql-title{
  margin:0 0 8px;
  font-size:28px;
  line-height:1.2;
  color:#1f2937;
}

.atqql-subtitle{
  margin:0;
  color:#526078;
}

.atqql-live,
.atq-quote-list-message{
  margin:0 0 18px;
  padding:12px 14px;
  border-radius:10px;
  background:#eff6ff;
  color:#1d4ed8;
}

.atqql-live.is-error,
.atq-quote-list-message-error{
  background:#fef2f2;
  color:#b91c1c;
}

.atqql-grid{
  width:100%;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
  margin:0 0 18px;
}

.atqql-card{
  min-width:0;
  margin:0;
  padding:18px;
  border:1px solid #dfe5ec;
  border-radius:14px;
  background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
  display:grid;
  grid-template-columns:118px minmax(0, 1fr);
  grid-template-rows:auto auto;
  gap:14px 16px;
  align-items:start;
}

.atqql-card-media{
  grid-column:1;
  grid-row:1 / span 2;
  width:118px;
  max-width:118px;
}

.atqql-card-media img,
.atqql-card-image-placeholder{
  width:118px;
  height:118px;
  object-fit:contain;
  display:block;
  background:#f8fafc;
}

.atqql-card-body{
  grid-column:2;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.atqql-card-title{
  margin:0;
  font-size:17px;
  line-height:1.35;
  font-weight:700;
  color:#e91e63;
  overflow-wrap:anywhere;
}

.atqql-card-title a{
  color:inherit;
  text-decoration:none;
}

.atqql-card-title a:hover{
  text-decoration:underline;
}

.atqql-card-meta{
  display:flex;
  flex-direction:column;
  gap:6px;
  color:#526078;
  font-size:14px;
  line-height:1.45;
}

.atqql-card-meta-row{
  overflow-wrap:anywhere;
}


.atqql-card-options-under-title{
  width:100%;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:2px;
}

.atqql-card-options-summary{
  width:100%;
  min-width:0;
  color:#526078;
  font-size:14px;
  line-height:1.45;
  overflow-wrap:anywhere;
}


.atqql-options-editor{
  width:100%;
  padding:10px;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#f8fafc;
}

.atqql-options-editor-title{
  margin:0 0 8px;
  font-size:13px;
  font-weight:800;
  color:#334155;
}

.atqql-options-fields{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.atqql-option-field{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin:0;
  min-width:0;
}

.atqql-option-field span{
  font-size:12px;
  font-weight:700;
  color:#475569;
}

.atqql-option-select{
  width:100%;
  min-height:38px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
  color:#111827;
  padding:7px 10px;
}

.atqql-option-status{
  margin-top:8px;
  color:#b45309;
  font-size:12px;
}

.atqql-card-foot{
  grid-column:2;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:end;
  gap:12px;
  margin-top:auto;
}

.atqql-qty{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
  margin:0;
  width:max-content;
}

/* =========================================================
   Quote List quantity control
   These are DIV controls, not BUTTON elements, to avoid WordPress/theme
   global button styles.
========================================================= */
.atqql-qty-label{
  font-size:12px;
  line-height:1;
  color:#334155;
  font-weight:700;
}

.atqql .atqql-qty-control{
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  width:auto;
  min-width:0;
  height:auto;
  min-height:42px;
  padding:0;
  margin:0;
  border:0;
  border-radius:0;
  background:transparent;
  overflow:visible;
  box-shadow:none;
}

.atqql .atqql-qty-control > .atqql-qty-dec,
.atqql .atqql-qty-control > .atqql-qty-inc{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 42px;
  width:42px;
  height:42px;
  min-width:42px;
  min-height:42px;
  max-width:42px;
  max-height:42px;
  padding:0;
  margin:0;
  box-sizing:border-box;
  border:1px solid #e91e63;
  border-radius:8px;
  background:#ffffff;
  color:#e91e63;
  box-shadow:none;
  outline:none;
  transform:none;
  text-align:center;
  text-indent:0;
  font-size:18px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
  user-select:none;
  transition:background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.atqql .atqql-qty-control > .atqql-qty-dec:hover,
.atqql .atqql-qty-control > .atqql-qty-inc:hover{
  background:#b0003a;
  color:#ffffff;
  border-color:#b0003a;}

.atqql .atqql-qty-control > .atqql-qty-dec:focus,
.atqql .atqql-qty-control > .atqql-qty-inc:focus{
  outline:2px solid rgba(176,0,58,.28);
  outline-offset:2px;
}

.atqql .atqql-qty-control > .atqql-qty-dec:active,
.atqql .atqql-qty-control > .atqql-qty-inc:active{
  background:#8f0030;
  color:#ffffff;
  border-color:#8f0030;
  box-shadow:none;
}

.atqql .atqql-qty-control > .atqql-qty-input{
  appearance:textfield;
  -moz-appearance:textfield;
  flex:0 0 58px;
  width:58px;
  height:42px;
  min-width:58px;
  min-height:42px;
  max-width:58px;
  max-height:42px;
  padding:0;
  margin:0;
  box-sizing:border-box;
  border:1px solid #334155;
  border-radius:8px;
  background:#ffffff;
  color:#111827;
  text-align:center;
  font-size:16px;
  font-weight:800;
  line-height:42px;
  box-shadow:none;
  outline:none;
}

.atqql .atqql-qty-input::-webkit-outer-spin-button,
.atqql .atqql-qty-input::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

.atqql-line-total{
  justify-self:end;
  color:#0f172a;
  font-size:20px;
  line-height:1.2;
  font-weight:800;
  white-space:nowrap;
}

.atqql-remove{
  justify-self:end;
  min-height:42px;
  padding:9px 18px;
  border:1px solid #e91e63;
  border-radius:4px;
  background:#fff;
  color:#e91e63;
  cursor:pointer;
}

.atqql-remove:hover{
  background:#fff5f8;
  color:#e91e63;
}

.atqql-total{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:12px;
  background:#f8fafc;
}

.atqql-total-label{
  font-weight:700;
  color:#334155;
}

.atqql-total-value{
  font-size:24px;
  font-weight:800;
  color:#334155;
}

.atqql-form-title{
  margin:0 0 16px;
}

.atqql-form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}

.atqql-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:0 0 14px;
}

.atqql-field-full{
  width:100%;
}

.atqql-field span{
  font-weight:700;
  color:#334155;
}

.atqql-field em{
  color:#b91c1c;
  font-style:normal;
}

.atqql-field input,
.atqql-field textarea{
  width:100%;
  border:1px solid #cbd5e1;
  border-radius:8px;
  padding:10px 12px;
}

.atqql-submit{
  min-height:44px;
  padding:11px 20px;
}

.atq-quote-list-icon,
.atq-quote-list-floating-icon{
  display:inline-flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  color:inherit;
  position:relative;
}

.atq-quote-list-icon-layout-row{ flex-direction:row; }
.atq-quote-list-icon-layout-column{ flex-direction:column; gap:4px; }

.atq-quote-list-icon-visual{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.atq-quote-list-icon-mark-image img{
  display:block;
  max-width:28px;
  max-height:28px;
}

.atq-quote-list-count{
  position:absolute;
  top:-8px;
  right:-10px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  line-height:18px;
  text-align:center;
  font-weight:800;
}

.atq-quote-list-popup .atq-ql-options-close{
  appearance:none;
  -webkit-appearance:none;
  position:absolute;
  top:14px;
  right:14px;
  z-index:10;
  width:32px;
  height:32px;
  min-width:32px;
  min-height:32px;
  max-width:32px;
  max-height:32px;
  padding:0;
  margin:0;
  box-sizing:border-box;
  border:1px solid #e3342f;
  border-radius:50%;
  background:#dc2626;
  color:#fff;
  display:grid;
  place-items:center;
  font-size:0;
  line-height:1;
  text-align:center;
  text-decoration:none;
  text-indent:0;
  cursor:pointer;
  box-shadow:none;
  outline:none;
  overflow:hidden;
  transform:none;
}

.atq-quote-list-popup .atq-ql-options-close:before{
  content:"\00d7";
  display:block;
  font-family:Arial, Helvetica, sans-serif;
  font-size:34px;
  font-weight:400;
  line-height:30px;
  color:#fff;
  text-align:center;
}

.atq-quote-list-popup .atq-ql-options-close span{ display:none; }

.atq-quote-list-popup .atq-ql-options-close:hover,
.atq-quote-list-popup .atq-ql-options-close:focus{
  background:#b91c1c;
  border-color:#b91c1c;
}

@media (max-width:1024px){
  .atqql-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:767px){
  .atqql-head,
  .atqql-empty,
  .atqql-total,
  .atqql-form{
    padding:16px;
  }

  .atqql-card{
    grid-template-columns:96px minmax(0, 1fr);
    padding:14px;
    gap:12px;
  }

  .atqql-card-media,
  .atqql-card-media img,
  .atqql-card-image-placeholder{
    width:96px;
    height:96px;
    max-width:96px;
  }

  .atqql-card-foot{
    grid-column:1 / -1;
    grid-template-columns:auto 1fr auto;
  }

  .atqql-options-fields,
  .atqql-form-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:480px){
  .atqql-card{
    grid-template-columns:1fr;
  }

  .atqql-card-media{
    grid-column:1;
    grid-row:auto;
    width:100%;
    max-width:100%;
    display:flex;
    justify-content:center;
  }

  .atqql-card-media img,
  .atqql-card-image-placeholder{
    width:100%;
    max-width:180px;
    height:140px;
  }

  .atqql-card-body,
  .atqql-card-foot{
    grid-column:1;
  }

  .atqql-card-foot{
    grid-template-columns:1fr;
    align-items:stretch;
  }

  .atqql-line-total,
  .atqql-remove{
    justify-self:start;
  }

  .atqql-total{
    justify-content:space-between;
  }
}

/* =========================================================
   Final qty + options fixes
   - Hover only colors the actual +/- button under the mouse.
   - Focus/active does not leave a stuck color after click.
   - Options and extra product options are forced directly under product title.
========================================================= */

.atqql .atqql-card-body {
  min-width: 0;
}

.atqql .atqql-card-options-under-title {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  clear: both;
}

.atqql .atqql-card-options-summary {
  display: block;
  width: 100%;
  margin: 4px 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.4;
}

.atqql .atqql-card-options-summary strong {
  color: #111827;
  font-weight: 700;
}

.atqql .atqql-options-editor {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.atqql .atqql-options-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.atqql .atqql-option-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.atqql .atqql-qty-control {
  display: grid;
  grid-template-columns: 38px 56px 38px;
  width: 132px;
  height: 42px;
  align-items: stretch;
  justify-items: stretch;
}

.atqql .atqql-qty-control > button.atqql-qty-btn {
  grid-row: 1;
  width: 38px;
  height: 40px;
  min-width: 38px;
  min-height: 40px;
  max-width: 38px;
  max-height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #e91e63;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  outline: none;
  transform: none;
}

.atqql .atqql-qty-control > button.atqql-qty-minus {
  grid-column: 1;
}

.atqql .atqql-qty-control > button.atqql-qty-plus {
  grid-column: 3;
}

.atqql .atqql-qty-control > button.atqql-qty-btn:hover {
  background: #fff5f8;
  color: #e91e63;
}

.atqql .atqql-qty-control > button.atqql-qty-btn:focus,
.atqql .atqql-qty-control > button.atqql-qty-btn:active {
  background: #fff;
  color: #e91e63;
  box-shadow: none;
  outline: none;
}

.atqql .atqql-qty-control > button.atqql-qty-btn:focus:hover,
.atqql .atqql-qty-control > button.atqql-qty-btn:active:hover {
  background: #fff5f8;
  color: #e91e63;
}

.atqql .atqql-qty-control > .atqql-qty-input {
  grid-column: 2;
  grid-row: 1;
  width: 56px;
  height: 40px;
  min-width: 56px;
  max-width: 56px;
  margin: 0;
  padding: 0;
}

/* =========================================================
   Qty input / hover cleanup
   - No hover shadow on qty div controls.
   - Hover color remains visible but flat.
   - Input keeps number spinner hidden.
========================================================= */

.atqql .atqql-qty-dec:hover,
.atqql .atqql-qty-inc:hover,
.atq-quote-list .atqql-qty-dec:hover,
.atq-quote-list .atqql-qty-inc:hover {
  background: #b0003a;
  color: #ffffff;
  border-color: #b0003a;
  box-shadow: none;
}

.atqql .atqql-qty-dec:active,
.atqql .atqql-qty-inc:active,
.atq-quote-list .atqql-qty-dec:active,
.atq-quote-list .atqql-qty-inc:active {
  background: #8f0030;
  color: #ffffff;
  border-color: #8f0030;
  box-shadow: none;
}

.atqql .atqql-qty-dec:focus,
.atqql .atqql-qty-inc:focus,
.atq-quote-list .atqql-qty-dec:focus,
.atq-quote-list .atqql-qty-inc:focus {
  box-shadow: none;
  outline: none;
}

.atqql .atqql-qty-input,
.atq-quote-list .atqql-qty-input {
  -moz-appearance: textfield;
}

.atqql .atqql-qty-input::-webkit-outer-spin-button,
.atqql .atqql-qty-input::-webkit-inner-spin-button,
.atq-quote-list .atqql-qty-input::-webkit-outer-spin-button,
.atq-quote-list .atqql-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
