/* ============================================
   TraumGmbH — Order Create
   Filter, Tiles, Quantity editor
   ============================================ */

/* === VIEW TOGGLE === */
.ord-view-toggle {
  display: flex; gap: 2px;
  background: var(--bg-input); border-radius: 6px;
  padding: 2px; margin-left: auto; margin-right: 8px;
}
.ord-vt {
  width: 30px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 5px;
  color: var(--text-muted); cursor: pointer; transition: all 0.1s;
}
.ord-vt.on {
  background: var(--bg-white); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* === FILTER BAR === */
.ord-filters { padding: 0 24px 12px; }
.ord-filter-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.ord-filter-sel {
  flex: 1; min-width: 120px; padding: 8px 12px;
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; font-weight: 500;
  font-family: var(--font); color: var(--text);
  cursor: pointer; transition: border-color 0.1s; appearance: auto;
}
.ord-filter-sel:focus { border-color: var(--accent); outline: none; }
.ord-filter-count {
  font-size: 11px; font-weight: 700; color: var(--accent);
  white-space: nowrap; display: none;
}

/* === ARTICLE CONTAINER === */
.ord-articles { padding: 0 24px; }

/* === LIST VIEW === */
.ord-list .oart {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px; padding: 14px 16px;
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--r-sm); transition: all 0.1s;
}
.ord-list .oart.sel { border-color: var(--accent); background: var(--accent-pale); }
.ord-list .oart-top { flex: 1; min-width: 0; }
.ord-list .oart-name { font-weight: 700; font-size: 14px; }
.ord-list .oart-unit {
  display: inline-block; margin-top: 2px;
  font-size: 13px; font-weight: 700;
  color: var(--accent); background: var(--accent-pale);
  padding: 2px 8px; border-radius: 4px;
}
.ord-list .oart-meta { display: none; }
.ord-list .oart-bottom { flex-shrink: 0; }

/* === TILE VIEW === */
.ord-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.ord-tiles .oart {
  display: flex; flex-direction: column;
  padding: 16px; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: var(--r);
  transition: all 0.15s; cursor: default;
}
.ord-tiles .oart:hover { border-color: #d0d0ca; }
.ord-tiles .oart.sel { border-color: var(--accent); background: var(--accent-pale); }
.ord-tiles .oart-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 8px; margin-bottom: 8px;
}
.ord-tiles .oart-name { font-weight: 700; font-size: 15px; line-height: 1.3; flex: 1; }
.ord-tiles .oart-unit {
  font-size: 13px; font-weight: 800;
  color: var(--accent); background: var(--accent-pale);
  padding: 4px 10px; border-radius: 6px;
  white-space: nowrap; flex-shrink: 0;
}
.ord-tiles .oart-meta {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 12px; min-height: 22px;
}
.oart-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  background: var(--bg-input); color: var(--text-sec);
}
.oart-tag-sup { background: var(--info-pale); color: var(--info); }
.oart-tag-loc { background: var(--success-pale); color: var(--success); }
.ord-tiles .oart-bottom { margin-top: auto; }

/* === ADD BUTTON === */
.oart-add {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 10px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  font-family: var(--font); color: var(--text-sec);
  cursor: pointer; transition: all 0.1s;
}
.oart-add:hover { border-color: var(--accent); color: var(--accent); }
.ord-list .oart-add { width: auto; padding: 8px 12px; font-size: 0; }
.ord-list .oart-add .i { margin: 0; }

/* === QUANTITY CONTROLS === */
.oart-qty {
  display: flex; align-items: center;
  border-radius: var(--r-sm); background: var(--bg-input);
  border: 1px solid var(--border); overflow: hidden;
}
.oart-qty-btn {
  width: 38px; height: 38px; background: none; border: none;
  color: var(--accent); font-size: 18px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background 0.1s;
}
.oart-qty-btn:hover { background: var(--accent-pale); }
.oart-qty-val {
  min-width: 44px; text-align: center; font-weight: 800; font-size: 16px;
  padding: 0 4px; cursor: pointer;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  height: 38px; display: flex; align-items: center; justify-content: center;
}
.oart-qty-val:hover { background: var(--accent-pale); color: var(--accent); }
.oart-qty-input {
  width: 56px; text-align: center; font-weight: 800; font-size: 16px;
  font-family: var(--font); border: none; background: var(--bg-white);
  outline: none; padding: 0 4px; height: 38px;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.ord-list .oart-qty { flex-shrink: 0; }

/* === MOBILE: force list === */
@media (max-width: 549px) {
  .ord-tiles { display: block; }
  .ord-tiles .oart {
    display: flex; flex-direction: row; align-items: center;
    gap: 12px; margin-bottom: 8px; padding: 14px 16px;
    border-radius: var(--r-sm);
  }
  .ord-tiles .oart-top { flex: 1; min-width: 0; margin-bottom: 0; }
  .ord-tiles .oart-meta { display: none; }
  .ord-tiles .oart-bottom { flex-shrink: 0; margin-top: 0; }
  .ord-tiles .oart-add { width: auto; padding: 8px 12px; font-size: 0; }
  .ord-articles { padding: 0 16px; }
  .ord-filters { padding: 0 16px 12px; }
  .ord-filter-row {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  }
  .ord-filter-row::-webkit-scrollbar { display: none; }
  .ord-filter-sel { min-width: 140px; flex-shrink: 0; }
}

/* === SMALL TABLET: max 3 columns === */
@media (min-width: 550px) and (max-width: 899px) {
  .ord-tiles { grid-template-columns: repeat(3, 1fr); }
}

/* === DESKTOP: 4+ columns === */
@media (min-width: 900px) {
  .ord-tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .ord-articles { padding: 0 32px; }
  .ord-filters { padding: 0 32px 16px; }
}