/* UNIVERSAL FORM COMPONENT STYLES */
/* Used by tb-input, tb-select, tb-textarea components throughout the application */

.tb-input,
.tb-select,
.tb-textarea {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tb-input label,
.tb-select label,
.tb-textarea label {
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-color-label, #333);
}

.tb-input input,
.tb-select select,
.tb-textarea textarea {
  padding: var(--padding-y-inner-elements, 8px) 12px;
  border: var(--border-input-elements);
  border-radius: var(--border-radius-1);
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.tb-input input:focus,
.tb-select select:focus,
.tb-textarea textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.tb-textarea textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.tb-select select {
  background-color: white;
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 20px;
  padding-right: 35px;
}

/* Radio and checkbox groups - universal layout pattern */
.tb-radio-group,
.tb-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
  margin-bottom: 20px;
}

/* Composite profit input: number + unit display + type dropdown */
.tb-profit-input {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tb-profit-input__label {
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-color-label, #333);
}

.tb-profit-input__inner {
  display: flex;
  align-items: stretch;
  height: 2.5rem;
  border: var(--border-input-elements);
  border-radius: var(--border-radius-1);
  background: #fff;
  overflow: hidden;
}

.tb-profit-input__number {
  flex: 1 1 0;
  min-width: 0;
  padding: var(--padding-y-inner-elements, 8px) 12px;
  border: none;
  border-radius: 0;
  font-size: 14px;
  background: transparent;
  transition: box-shadow 0.2s ease;
}

.tb-profit-input__number:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary-color);
}

/* Unit box and dropdown: fixed square size, never stretch (same in modal and single product) */
.tb-profit-input__unit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2.5rem;
  width: 2.5rem;
  max-width: 2.5rem;
  height: 2.5rem;
  min-height: 2.5rem;
  box-sizing: border-box;
  background: var(--bg-color-muted, #e8e8e8);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color-label, #333);
  border-left: 1px solid var(--border-color, #ddd);
}

.tb-profit-input__select {
  flex: 0 0 2.5rem;
  width: 2.5rem;
  max-width: 2.5rem;
  height: 2.5rem;
  min-height: 2.5rem;
  box-sizing: border-box;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border-color, #ddd);
  border-top-right-radius: var(--border-radius-1);
  border-bottom-right-radius: var(--border-radius-1);
  font-size: 0;
  color: transparent;
  background: var(--bg-color-muted, #e8e8e8);
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
}

.tb-profit-input__select:focus {
  outline: none;
}
