:root {
  --dq-ink: #0f172a;
  --dq-muted: #64748b;
  --dq-accent: #0369a1;
  --dq-accent-dark: #075985;
  --dq-surface: #fff;
  --dq-soft: #f8fafc;
  --dq-border: #e2e8f0;
  --dq-danger: #b91c1c;
  --dq-success: #047857;
  --dq-radius: 14px;
  --dq-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}

.dq-icon,
.dq-icon-button svg,
.dq-search-box svg,
.dq-success > svg,
.dq-empty > svg,
.dq-line__image > svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dq-product-action { flex: 1 1 100%; padding: .5rem 5px 0; }
.dq-add-button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px; width: 100%; }
.dq-product-list-action { width: 100%; margin-top: .5rem; text-align: center; }
.product-miniature .dq-list-primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  width: 100%;
  min-height: 42px;
  border: 0;
  background: var(--bs-primary, #111);
  color: #fff;
  cursor: pointer;
}

.dq-indicator { position: relative; color: inherit; }
.dq-indicator > .icon { position: relative; display: inline-block; }
.dq-indicator__count { position: absolute; z-index: 2; top: -.45rem; right: -.65rem; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #a0cdad; color: #fff; font: 700 11px/18px Arial, sans-serif; font-style: normal; text-align: center; }
.dq-header-mobile { overflow: visible; }
.dq-header-mobile .dq-indicator { overflow: visible; }
#mobile-header .dq-header-mobile .dq-indicator > .icon { position: relative; display: inline-block; margin: 0 auto; }
#mobile-header .dq-header-mobile .dq-indicator__count { margin: 0; }

.dq-overlay { position: fixed; inset: 0; z-index: 1045; background: rgba(15, 23, 42, .52); opacity: 0; transition: opacity 180ms ease-out; }
.dq-overlay.is-open { opacity: 1; }
.dq-drawer { position: fixed; z-index: 1050; inset: 0 0 0 auto; width: min(100%, 460px); display: flex; flex-direction: column; background: var(--dq-surface); color: var(--dq-ink); box-shadow: var(--dq-shadow); transform: translateX(100%); visibility: hidden; transition: transform 240ms ease-out, visibility 240ms; }
.dq-drawer.is-open { transform: translateX(0); visibility: visible; }
.dq-drawer__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem; border-bottom: 1px solid var(--dq-border); }
.dq-drawer__header h2 { margin: 0; color: var(--dq-ink); font-size: 1.35rem; }
.dq-drawer__body { flex: 1; min-height: 0; padding: 1rem; overflow-y: auto; }
.dq-drawer__footer { display: grid; gap: .65rem; padding: 1rem 1.25rem; border-top: 1px solid var(--dq-border); }
.dq-icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--dq-soft); color: var(--dq-ink); cursor: pointer; }
body.dq-scroll-locked { overflow: hidden; }

.dq-combination-modal { position: fixed; inset: 0; z-index: 1060; display: grid; place-items: center; padding: 1rem; background: rgba(15, 23, 42, .58); }
.dq-combination-modal__panel { width: min(100%, 560px); max-height: min(85vh, 680px); overflow-y: auto; border-radius: var(--dq-radius); background: #fff; box-shadow: var(--dq-shadow); }
.dq-combination-options { display: grid; gap: .65rem; padding: 1.25rem; }
.dq-combination-option { width: 100%; min-height: 48px; padding: .75rem 1rem; border: 1px solid var(--dq-border); border-radius: 10px; background: #fff; color: var(--dq-ink); text-align: left; cursor: pointer; }
.dq-combination-option:hover { border-color: var(--dq-accent); background: #f0f9ff; }

.dq-toast-region { position: fixed; z-index: 1070; right: 1rem; bottom: 1rem; width: min(calc(100% - 2rem), 380px); pointer-events: none; }
.dq-toast { padding: .8rem 1rem; border-radius: 10px; background: var(--dq-ink); color: #fff; box-shadow: var(--dq-shadow); }

.dq-page { --dq-section-gap: clamp(1.25rem, 3vw, 2rem); width: 100%; color: var(--dq-ink); }
.dq-page__columns { row-gap: var(--dq-section-gap); }
.dq-page__columns[hidden] { display: none !important; }
.dq-page__column { min-width: 0; }
.dq-page__column > .dq-section { height: 100%; margin-bottom: 0; padding: clamp(24px, 4vw, 45px) clamp(16px, 5vw, 60px); }
.dq-eyebrow { margin: 0 0 .25rem; color: #adccad; font-size: 1.05rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.dq-section { margin-bottom: var(--dq-section-gap); padding: clamp(1rem, 3vw, 1.75rem); border: 1px solid var(--dq-border); border-radius: var(--dq-radius); background: var(--dq-surface); box-shadow: 0 8px 30px rgba(15, 23, 42, .05); }
.dq-section__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 3.25rem; }
.dq-section__heading h2 { color: #35a55d; margin: 0; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.dq-link-button,
.dq-remove { border: 0; background: transparent; color: var(--dq-danger); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.dq-lines { display: grid; gap: .85rem; }
.dq-lines-toolbar { display: flex; justify-content: flex-end; margin: -.35rem 0 .5rem; }
.dq-line { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: .85rem; padding: .85rem; border: 1px solid var(--dq-border); border-radius: 12px; background: #fff; }
.dq-line--invalid { border-color: #fecaca; background: #fef2f2; }
.dq-line__image { display: grid; place-items: center; width: 76px; height: 76px; overflow: hidden; border-radius: 9px; background: var(--dq-soft); color: var(--dq-muted); }
.dq-line__image img { width: 100%; height: 100%; object-fit: contain; }
.dq-line__image > svg { width: 32px; height: 32px; }
.dq-line__content { min-width: 0; }
.dq-line__content h3 { margin: 0 0 .35rem; font-size: 1rem; overflow-wrap: anywhere; }
.dq-line__content p { margin: .15rem 0; color: var(--dq-muted); font-size: .88rem; }
.dq-line__content .dq-line__warning { color: var(--dq-danger); font-weight: 600; }
.dq-line__actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dq-quantity { display: inline-grid; grid-template-columns: 44px 58px 44px; overflow: hidden; border: 1px solid var(--dq-border); border-radius: 9px; }
.dq-quantity button { min-height: 44px; border: 0; background: var(--dq-soft); color: var(--dq-ink); font-size: 1.15rem; cursor: pointer; }
.dq-quantity input { width: 58px; min-height: 44px; padding: .25rem; border: 0; border-inline: 1px solid var(--dq-border); text-align: center; appearance: textfield; }
.dq-quantity input::-webkit-inner-spin-button { appearance: none; }
.dq-line[aria-busy="true"] { opacity: .58; pointer-events: none; }

.dq-empty { display: grid; justify-items: center; gap: .5rem; padding: 2rem 1rem; border: 1px dashed var(--dq-border); border-radius: 12px; color: var(--dq-muted); text-align: center; }
.dq-empty > svg { width: 36px; height: 36px; }
.dq-feedback { margin: .75rem 0; padding: .8rem 1rem; border-left: 4px solid var(--dq-danger); background: #fef2f2; color: #7f1d1d; }

.dq-products-search { margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--dq-border); }

.dq-label,
.dq-field label { display: block; margin-bottom: .4rem; font-weight: 500; }
.dq-search-autocomplete { position: relative; z-index: 20; }
.dq-search-box { position: relative; }
.dq-search-box svg { position: absolute; top: 50%; left: .9rem; transform: translateY(-50%); color: var(--dq-muted); }
.dq-search-box input { width: 100%; min-height: 48px; padding: .7rem .9rem .7rem 2.8rem; border: 1px solid var(--dq-border); border-radius: 10px; }
.dq-search-autocomplete:has(.dq-search-results:not(:empty)) .dq-search-box input { border-bottom-right-radius: 0; border-bottom-left-radius: 0; }
.dq-search-results { position: absolute; z-index: 20; top: calc(100% - 1px); right: 0; left: 0; display: none; max-height: min(52vh, 380px); overflow-y: auto; overscroll-behavior: contain; gap: .5rem; margin: 0; padding: .65rem; border: 1px solid var(--dq-border); border-top: 0; border-radius: 0 0 10px 10px; background: var(--dq-surface); box-shadow: 0 14px 30px rgba(15, 23, 42, .16); }
.dq-search-results:not(:empty) { display: grid; }
.dq-search-result { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: .8rem; align-items: center; padding: .75rem; border: 1px solid var(--dq-border); border-radius: 10px; }
.dq-search-result img,
.dq-search-result__image { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: var(--dq-soft); }
.dq-search-result h3 { margin: 0; font-size: 1rem; }
.dq-search-result p { margin: .15rem 0; color: var(--dq-muted); font-size: .85rem; }
.dq-search-result button { grid-column: 1 / -1; min-height: 44px; }

.dq-form__grid { display: grid; gap: 1rem; }
.dq-field input,
.dq-field textarea { width: 100%; min-height: 46px; padding: .68rem .75rem; border: 1px solid var(--dq-border); border-radius: 9px; color: var(--dq-ink); }
.dq-field textarea { min-height: 120px; resize: vertical; }
.dq-field input:focus,
.dq-field textarea:focus,
.dq-search-box input:focus { outline: 3px solid rgba(3, 105, 161, .2); border-color: var(--dq-accent); }
.dq-check { display: flex; align-items: flex-start; gap: .65rem; margin: 1.25rem 0; line-height: 1.5; }
.dq-check input { width: 20px; height: 20px; margin-top: .1rem; flex: 0 0 auto; }
.dq-submit { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 48px; width: 100%; }
.dq-spinner { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: dq-spin .65s linear infinite; }
.dq-submit.is-loading .dq-spinner { display: inline-block; }
.dq-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.dq-success { margin-bottom: 0; padding: clamp(24px, 4vw, 45px) clamp(16px, 5vw, 60px); text-align: center; }
.dq-success h2 { color: #35a55d; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.dq-success > svg { width: 46px; height: 46px; color: var(--dq-success); }
.dq-success__reference { font-size: 1.2rem; }

button:focus-visible,
a:focus-visible,
.dq-combination-option:focus-visible { outline: 3px solid rgba(3, 105, 161, .35); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }

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

@media (min-width: 576px) {
  .dq-line { grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; }
  .dq-line__image { width: 96px; height: 96px; }
  .dq-line__actions { grid-column: auto; display: grid; justify-items: end; }
  .dq-search-result { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .dq-search-result button { grid-column: auto; }
  .dq-form__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "company tax"
      "name phone"
      "email email"
      "comments comments";
  }
  .dq-field--company { grid-area: company; }
  .dq-field--tax-id { grid-area: tax; }
  .dq-field--name { grid-area: name; }
  .dq-field--phone { grid-area: phone; }
  .dq-field--email { grid-area: email; }
  .dq-field--comments { grid-area: comments; }
  .dq-field--wide { grid-column: auto; }
  .dq-submit { width: auto; min-width: 250px; }
}

@media (min-width: 992px) {
  .dq-page__column--form .dq-submit { width: 100%; min-width: 0; }
}

@media (max-width: 374px) {
  .dq-quantity { grid-template-columns: 42px 52px 42px; }
  .dq-quantity input { width: 52px; }
  .dq-line__actions { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .dq-overlay,
  .dq-drawer { transition: none; }
  .dq-spinner { animation-duration: 1.2s; }
}
