/**
 * Quick Order Table styles
 * addifyb2b module
 */

:root {
  --qot-primary: #26b8e6;
  --qot-primary-hover: #1fa3cc;
  --qot-primary-light: #d0f0fd;
  --qot-success: #16a34a;
  --qot-success-light: #dcfce7;
  --qot-danger: #dc2626;
  --qot-danger-light: #fee2e2;
  --qot-warning: #f59e0b;
  --qot-text: #1e293b;
  --qot-text-muted: #64748b;
  --qot-border: #e2e8f0;
  --qot-bg: #fff;
  --qot-bg-alt: #f8fafc;
  --qot-bg-hover: #f1f5f9;
  --qot-radius: 4px;
  --qot-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --qot-transition: 0.2s ease;
}

.prevent-click {
  pointer-events: none;
  opacity: 0.5;
  background-color: transparent;
}

.qot-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}

.qot-loading-overlay.active {
  display: flex;
}

.qot-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--qot-border);
  border-top-color: var(--qot-primary);
  border-radius: 50%;
  animation: qot-spin 0.7s linear infinite;
}

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

.qot-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.qot-toast {
  pointer-events: auto;
  padding: 14px 20px;
  border-radius: var(--qot-radius);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
  background: var(--qot-text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.3s ease;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.qot-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.qot-toast.qot-toast-success {
  background: var(--qot-success);
}

.qot-toast.qot-toast-error {
  background: var(--qot-danger);
}

.qot-toast.qot-toast-warning {
  background: var(--qot-warning);
  color: var(--qot-text);
}

.qot-toast-icon {
  min-width: 18px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.adq-order-table-section {
  padding: 30px 0 40px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--qot-text);
}

.qot-shell {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.qot-category-sidebar {
  flex: 0 0 260px;
  max-width: 260px;
}

.qot-content {
  flex: 1 1 auto;
  min-width: 0;
}

.qot-category-rail.block-categories {
  margin-bottom: 0;
  border: 1px solid var(--qot-border);
  border-radius: var(--qot-radius);
  background: var(--qot-bg);
}

.qot-category-rail .category-top-menu {
  padding: 16px;
  margin: 0;
  list-style: none;
}

.qot-category-rail .category-sub-menu {
  width: 100%;
  padding-left: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.qot-category-rail .category-sub-menu .category-sub-menu {
  padding-left: 0;
  margin-top: 0.5rem;
}

.qot-category-rail li {
  position: relative;
  margin: 0;
  padding: 0;
}

.qot-category-rail .category-sub-menu li[data-depth="1"] {
  margin-bottom: 0.625rem;
}

.qot-category-rail .category-sub-menu li:not([data-depth="0"]):not([data-depth="1"]) {
  padding-left: 0.3125rem;
}

.qot-category-rail.block-categories .category-sub-menu li::before,
.qot-category-rail.block-categories .category-sub-menu .category-sub-link::before {
  content: none;
}

.qot-category-rail.block-categories .category-sub-menu li:not([data-depth="0"]):not([data-depth="1"])::before {
  margin-right: 0.3125rem;
  content: "-";
}

.qot-category-rail .js-qot-category-link,
.qot-category-rail .qot-category-parent {
  display: inline;
  padding: 0;
  color: var(--qot-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}

.qot-category-rail .category-sub-menu li[data-depth="0"] > .js-qot-category-link,
.qot-category-rail .category-sub-menu li[data-depth="0"] > .qot-category-parent {
  display: inline-block;
  width: 100%;
  padding-right: 24px;
  padding-bottom: 0.1875rem;
  margin: 0.3125rem 0 0;
  font-weight: 600;
}

.qot-category-rail .js-qot-category-link:hover,
.qot-category-rail .js-qot-category-link.active {
  color: var(--qot-primary);
}

.qot-category-rail .qot-category-parent {
  color: var(--qot-text-muted);
}

.qot-category-rail .navbar-toggler,
.qot-category-rail .arrows {
  padding: 0;
  cursor: pointer;
}

.qot-category-rail .navbar-toggler {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  line-height: 1;
  text-align: center;
}

.qot-category-rail .arrows {
  position: static;
  display: inline-flex;
  align-items: center;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  line-height: 1;
  vertical-align: middle;
}

.qot-category-rail .collapse-icons .material-icons {
  font-size: 18px;
  line-height: 20px;
}

.qot-category-rail .arrows .material-icons {
  font-size: 14px;
  line-height: 18px;
}

.qot-category-rail li > .collapse {
  width: 100%;
}

.qot-category-rail .collapse-icons .remove,
.qot-category-rail .arrows .arrow-down {
  display: none;
}

.qot-category-rail .collapse.in {
  display: block;
}

.qot-category-rail .navbar-toggler[aria-expanded="true"] .add,
.qot-category-rail .arrows[aria-expanded="true"] .arrow-right {
  display: none;
}

.qot-category-rail .navbar-toggler[aria-expanded="true"] .remove,
.qot-category-rail .arrows[aria-expanded="true"] .arrow-down {
  display: inline-block;
}

.qot-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.qot-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 380px;
}

.qot-search-wrapper > i.material-icons {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--qot-text-muted);
  pointer-events: none;
  font-size: 20px;
}

.qot-search-wrapper input,
.qot-sku-row input {
  height: 42px;
  font-size: 14px;
  color: var(--qot-text);
  background: var(--qot-bg);
  border: 1px solid var(--qot-border);
  border-radius: var(--qot-radius);
  transition: border-color var(--qot-transition), box-shadow var(--qot-transition);
}

.qot-search-wrapper input {
  display: block;
  width: 100%;
  padding: 0 40px;
}

.qot-sku-row input {
  padding: 0 14px;
  flex: 0 1 320px;
  min-width: 180px;
}

.qot-search-wrapper input:focus,
.qot-sku-row input:focus,
.qot-select:focus {
  outline: none;
  border-color: var(--qot-primary);
  box-shadow: 0 0 0 3px var(--qot-primary-light);
}

.qot-search-wrapper input::placeholder {
  color: var(--qot-text-muted);
}

.qot-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  color: var(--qot-text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: none;
  border-radius: 50%;
  transition: background var(--qot-transition), color var(--qot-transition);
}

.qot-search-clear:hover {
  background: var(--qot-bg-hover);
  color: var(--qot-text);
}

.qot-search-clear.visible {
  display: block;
}

.qot-sku-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.btn-qot-primary,
.btn-addtocart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border-radius: var(--qot-radius);
  white-space: normal;
  line-height: 1.2;
  text-align: center;
}

.btn-qot-primary {
  height: 42px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #232323;
  border: none;
  cursor: pointer;
  transition: background var(--qot-transition), box-shadow var(--qot-transition), transform 0.1s ease;
}

.btn-qot-primary:hover {
  background: #3a3a3a;
  box-shadow: var(--qot-shadow);
}

.btn-qot-primary:active {
  transform: scale(0.97);
}

.btn-qot-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-addtocart .material-icons,
.btn-qot-primary .material-icons {
  font-size: 18px;
  vertical-align: middle;
}

.adq-product-order-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--qot-border);
  border-radius: var(--qot-radius);
  overflow: hidden;
}

.adq-product-order-table thead {
  background: var(--qot-bg-alt);
}

.adq-product-order-table thead tr td,
.adq-product-order-table thead tr th {
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--qot-text-muted);
  text-align: left;
  border-bottom: 2px solid var(--qot-border);
  white-space: nowrap;
}

.adq-product-order-table tbody tr {
  transition: background var(--qot-transition);
}

.adq-product-order-table tbody tr:hover {
  background: var(--qot-bg-hover);
}

.adq-product-order-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--qot-border);
}

.adq-product-order-table tbody td {
  padding: 12px 10px;
  font-size: 14px;
  line-height: 1.45;
  vertical-align: middle;
  color: var(--qot-text);
}

.qot-col-image {
  width: 78px;
}

.qot-col-name {
  width: 22%;
}

.qot-col-summary {
  width: 18%;
}

.qot-col-price {
  width: 90px;
}

.qot-col-stock {
  width: 116px;
}

.qot-col-combo {
  width: 138px;
}

.qot-col-qty {
  width: 138px;
}

.qot-col-actions {
  width: 152px;
}

.adq-product-img img {
  display: block;
  width: 58px;
  height: 58px;
  max-width: 100%;
  object-fit: cover;
  border: 1px solid var(--qot-border);
  border-radius: var(--qot-radius);
}

.adq-product-name {
  position: relative;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

.adq-product-name a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--qot-text);
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color var(--qot-transition);
}

.adq-product-name a:hover {
  color: var(--qot-primary);
}

.adq-product-name:hover,
.adq-product-name:focus-within {
  z-index: 30;
}

.adq-product-name::before,
.adq-product-name::after {
  position: absolute;
  left: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--qot-transition), transform var(--qot-transition);
}

.adq-product-name::before {
  content: "";
  top: 50%;
  width: 10px;
  height: 10px;
  margin-left: 3px;
  background: var(--qot-text);
  transform: translate(-2px, -50%) rotate(45deg);
  z-index: 31;
}

.adq-product-name::after {
  content: attr(data-full-name);
  top: 50%;
  width: max-content;
  max-width: min(340px, 44vw);
  margin-left: 8px;
  padding: 8px 10px;
  border-radius: var(--qot-radius);
  color: #fff;
  background: var(--qot-text);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  transform: translate(-4px, -50%);
  z-index: 32;
}

.adq-product-name:hover::before,
.adq-product-name:hover::after,
.adq-product-name:focus-within::before,
.adq-product-name:focus-within::after {
  opacity: 1;
  transform: translate(0, -50%) rotate(45deg);
}

.adq-product-name:hover::after,
.adq-product-name:focus-within::after {
  transform: translate(0, -50%);
}

@media all and (max-width: 768px) {
  .adq-product-name::before,
  .adq-product-name::after {
    left: 0;
    top: 100%;
  }

  .adq-product-name::before {
    margin-left: 16px;
    transform: translateY(2px) rotate(45deg);
  }

  .adq-product-name::after {
    max-width: min(320px, 82vw);
    margin-top: 7px;
    margin-left: 0;
    transform: translateY(3px);
  }

  .adq-product-name:hover::before,
  .adq-product-name:focus-within::before {
    transform: translateY(2px) rotate(45deg);
  }

  .adq-product-name:hover::after,
  .adq-product-name:focus-within::after {
    transform: translateY(3px);
  }
}

.adq-product-summary {
  color: var(--qot-text-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.adq-product-price {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.qot-stock-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--qot-radius);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.qot-stock-badge.in-stock {
  background: var(--qot-success-light);
  color: var(--qot-success);
}

.qot-stock-badge.out-of-stock {
  background: var(--qot-danger-light);
  color: var(--qot-danger);
}

.qot-select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 30px 0 10px;
  font-size: 13px;
  line-height: 38px;
  color: var(--qot-text);
  background-color: var(--qot-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.825a.5.5 0 0 1-.354-.146l-4-4a.5.5 0 1 1 .708-.708L6 7.617l3.646-3.646a.5.5 0 0 1 .708.708l-4 4A.5.5 0 0 1 6 8.825z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid var(--qot-border);
  border-radius: var(--qot-radius);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--qot-transition), box-shadow var(--qot-transition);
}

.qot-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--qot-border);
  border-radius: var(--qot-radius);
  overflow: hidden;
  height: 38px;
}

.qot-qty-stepper button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 100%;
  background: var(--qot-bg-alt);
  border: none;
  font-size: 18px;
  font-weight: 500;
  color: var(--qot-text);
  cursor: pointer;
  transition: background var(--qot-transition);
  padding: 0;
  line-height: 1;
  user-select: none;
}

.qot-qty-stepper button:hover {
  background: var(--qot-bg-hover);
}

.qot-qty-stepper input {
  width: 48px;
  height: 100%;
  text-align: center;
  border: none;
  border-left: 1px solid var(--qot-border);
  border-right: 1px solid var(--qot-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--qot-text);
  -moz-appearance: textfield;
  appearance: textfield;
  background: var(--qot-bg);
  padding: 0;
}

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

.qot-qty-stepper input:focus {
  outline: none;
  background: var(--qot-primary-light);
}

.qot-qty-stepper.error {
  border-color: var(--qot-danger);
}

.qot-qty-stepper.error input {
  color: var(--qot-danger);
}

.adq-product-actions {
  min-width: 0;
}

.qot-row-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.qot-row-actions .btn-addtocart,
.qot-row-actions .addify-raq-button-QOT,
.qot-row-actions .addify-raq-button-QOT .btn-addtocart {
  width: 100%;
  max-width: 100%;
}

.qot-pagination-bar {
  display: flex;
  align-items: center;
  margin-top: 20px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.qot-pagination-bar .pagination .page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--qot-text);
  background: var(--qot-bg);
  border: 1px solid var(--qot-border);
  border-radius: var(--qot-radius);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--qot-transition), border-color var(--qot-transition), color var(--qot-transition);
}

.qot-pagination-bar .pagination .page-item .page-link:hover {
  background: var(--qot-primary-light);
  border-color: var(--qot-primary);
  color: var(--qot-primary);
}

.qot-pagination-bar .pagination .page-item.active .page-link {
  background: var(--qot-primary) !important;
  border-color: var(--qot-primary) !important;
  color: #fff !important;
}

.qot-hidden {
  display: none !important;
}

@media all and (max-width: 1024px) {
  .qot-shell {
    gap: 18px;
  }

  .qot-category-sidebar {
    flex-basis: 220px;
    max-width: 220px;
  }

  .adq-product-order-table tbody td {
    padding: 10px 8px;
    font-size: 13px;
  }
}

@media all and (max-width: 768px) {
  .qot-shell {
    display: block;
  }

  .qot-category-sidebar {
    max-width: none;
    margin-bottom: 18px;
  }

  .qot-toolbar {
    justify-content: stretch;
  }

  .qot-search-wrapper {
    max-width: none;
  }

  .qot-sku-row {
    flex-direction: column;
    align-items: stretch;
  }

  .qot-sku-row input {
    flex: 1 1 auto;
  }

  .adq-product-order-table thead {
    display: none;
  }

  .adq-product-order-table,
  .adq-product-order-table tbody {
    display: block;
    width: 100%;
  }

  .adq-product-order-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--qot-border);
    border-radius: var(--qot-radius);
    background: var(--qot-bg);
    width: 100%;
  }

  .adq-product-order-table tbody tr:not(:last-child) td {
    border-bottom: none;
  }

  .adq-product-order-table tbody td {
    display: block;
    padding: 0;
    width: 100%;
  }

  .adq-product-img {
    grid-column: 1;
    grid-row: 1;
  }

  .adq-product-img img {
    width: 56px;
    height: 56px;
  }

  .adq-product-stock {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .adq-product-name {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .adq-product-summary {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .adq-product-price {
    grid-column: 1;
    grid-row: 4;
  }

  .adq-product-combo {
    grid-column: 2;
    grid-row: 4;
    min-width: 130px;
  }

  .adq-product-qty {
    grid-column: 1;
    grid-row: 5;
  }

  .adq-product-actions {
    grid-column: 2;
    grid-row: 5;
  }

  .qot-row-actions {
    min-width: 110px;
  }

  .qot-qty-stepper {
    height: 34px;
  }

  .qot-qty-stepper button {
    width: 28px;
  }

  .qot-qty-stepper input {
    width: 36px;
    font-size: 13px;
  }

  .btn-addtocart {
    min-height: 34px;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  .qot-pagination-bar {
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
  }

  .qot-pagination-bar .pagination {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    gap: 3px;
  }

  .qot-pagination-bar .pagination .page-item .page-link {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
    padding: 0 4px;
  }
}

@media all and (max-width: 480px) {
  .adq-product-order-table tbody tr {
    grid-template-columns: 1fr;
  }

  .adq-product-img,
  .adq-product-stock,
  .adq-product-name,
  .adq-product-summary,
  .adq-product-price,
  .adq-product-combo,
  .adq-product-qty,
  .adq-product-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .adq-product-stock {
    text-align: left;
  }

  .adq-product-combo {
    min-width: 0;
  }
}
