/* ═══════════════════════════════════════════════════════
   global.css  —  Shared STRUCTURAL styles for all themes
   Layout, overflow, positioning, flex, z-index, sizing.
   NO colors, backgrounds, borders, border-radius, or shadows.
   Each theme defines those in its own style.css.
   ═══════════════════════════════════════════════════════ */

/* ─── Container: always full-width ─────────────────── */
.select2-container {
  box-sizing: border-box;
  display: block !important;
  width: 100% !important;
  margin: 0;
  position: relative;
  vertical-align: middle;
}

/* ─── Single selection (closed state) ──────────────── */
.select2-container .select2-selection--single {
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  width: 100%;
  height: 40px;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.15s;
}

.select2-container .select2-selection--single .select2-selection__rendered {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select2-container .select2-selection--single .select2-selection__rendered > span {
  display: flex;
  align-items: anchor-center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select2-container .select2-selection--single .select2-selection__rendered .svc-id {
  flex-shrink: 0;
}

.select2-container .select2-selection--single .select2-selection__rendered .svc-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
      margin-left: 12px;
}

.select2-container .select2-selection--single .select2-selection__rendered .svc-rate {
  flex-shrink: 0;
}

/* ─── Icon in selection ────────────────────────────── */
.select2-container .select2-selection__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  flex-shrink: 0;
  margin-right: 8px;
}

.select2-container .select2-selection__icon img {
  max-width: 18px;
  max-height: 18px;
  object-fit: contain;
}

.select2-container .select2-selection__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: inherit;
  margin-left: 5px;
  margin-right: 5px;
}

/* ─── Dropdown arrow ───────────────────────────────── */
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  position: absolute;
  top: 0;
  right: 12px;
  width: 16px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-style: solid;
  border-width: 5px 4px 0 4px;
  height: 0;
  left: 50%;
  margin-left: -4px;
  margin-top: -2px;
  position: absolute;
  top: 50%;
  width: 0;
  transition: border-color 0.15s;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-width: 0 4px 5px 4px;
}

/* ─── Dropdown panel ───────────────────────────────── */
.select2-dropdown {
  display: block !important;
  position: absolute;
  left: -100000px;
  width: 100%;
  max-width: 100%;
  z-index: 1060;
  overflow: visible;
  margin-top: 6px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.select2-container--open .select2-dropdown {
  left: 0;
  overflow: visible !important;
}

.select2-container--open .select2-dropdown--above {
  margin-bottom: 6px;
}

.select2-container--open .select2-dropdown--below {
  margin-top: 6px;
}

/* ─── Results list ─────────────────────────────────── */
.select2-results { display: block; }

.select2-results__options {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  display: block;
  width: 100%;
  max-height: 408px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.select2-results__option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
  margin: 0 4px;
  text-align: start;
  user-select: none;
  -webkit-user-select: none;
}

/* Force all dropdown levels to fit their container width */
.select2-dropdown .select2-results,
.select2-dropdown .select2-results__options,
.select2-dropdown .select2-results__option,
.select2-dropdown .select2-results__option a {
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  max-width: 100%;
}

/* Dropdown option */
.select2-dropdown .select2-results__options .select2-results__option {
  padding: 6px 12px !important;
  text-align: start;
  font-weight: 400;
  cursor: pointer;
  overflow: visible !important;
}

/* Inner <a> — must wrap text, never overflow horizontally */
.select2-dropdown .select2-results__options .select2-results__option a {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  text-decoration: none !important;
  font-weight: inherit !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  line-height: 1.5;
  overflow: hidden !important;
}

/* Dropdown option list */
.select2-dropdown .select2-results__options {
  max-height: 408px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 6px 0 !important;
}

/* Selected option — font-weight only */
.select2-results__option[aria-selected=true],
.select2-results__option.active[aria-selected=true] {
  font-weight: 500;
}

.select2-results__option a {
  display: block;
  padding: 0;
  color: inherit;
  background: none;
  text-decoration: none;
  white-space: normal;
  word-break: break-word;
}

.select2-container .select2-results__message {
  padding: 8px 12px;
}

/* ─── Dropdown search input ────────────────────────── */
.select2-search--dropdown {
  display: block;
  padding: 8px;
  position: relative;
}

.select2-search--dropdown.select2-search--hide { display: none; }

.select2-search__field-wrapper { position: relative; }

.select2-search__field-icon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.select2-search__field {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s;
}

/* ─── Icon in dropdown options ─────────────────────── */
.select2-results__option .select2-selection__icon {
  display: inline-block;
  width: 18px;
  text-align: center;
  margin-right: 5px;
  vertical-align: middle;
}

.select2-results__option .select2-selection__icon img {
  max-width: 16px;
  max-height: 16px;
  object-fit: contain;
  vertical-align: middle;
}

.select2-results__option .select2-selection__text {
  vertical-align: middle;
  margin-left: 5px;
  margin-right: 5px;
}

/* ─── Service option structure (ID + Name + Rate) ──── */
.select2-results__option .svc-id {
  flex-shrink: 0;
  padding: 2px 6px;
  min-width: 28px;
  text-align: center;
}

.select2-results__option .svc-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
font-size: 14px;
}

.select2-results__option .svc-rate {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── Image safety ─────────────────────────────────── */
.img-responsive,
.thumbnail > img,
.thumbnail a > img,
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
  display: inline-block;
  max-width: 18px !important;
  max-height: 18px !important;
  height: auto;
  width: auto;
  margin-right: 4px;
  object-fit: contain;
  vertical-align: middle;
}

.select2-container .select2-selection__id-1 { min-width: 14px; }
.select2-container .select2-selection__id-2 { min-width: 18px; }
.select2-container .select2-selection__id-3 { min-width: 22px; }
.select2-container .select2-selection__id-4 { min-width: 26px; }
.select2-container .select2-selection__id-5 { min-width: 30px; }
.select2-container .select2-selection__id-6 { min-width: 34px; }

/* ─── Service ID badge & rate (structural only) ────── */
.svc-id {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 6px;
  line-height: 1.5;
  vertical-align: middle;
  unicode-bidi: isolate;
}

.svc-name {
  unicode-bidi: isolate;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.svc-rate {
  margin-left: 4px;
  unicode-bidi: isolate;
}

/* Badge in closed select — smaller */
.select2-selection__rendered .svc-id {
  padding: 0 5px;
  line-height: 1.6;
}

/* ─── Classic theme (structural only) ──────────────── */
.select2-container--classic .select2-selection--single {
  outline: 0;
}

.select2-container--classic .select2-selection--single .select2-selection__arrow {
  background: none;
  border: none;
}

.select2-container--classic.select2-container--open .select2-dropdown {
  overflow: visible !important;
}

.select2-container--classic .select2-dropdown--above { border-bottom: none; }
.select2-container--classic .select2-dropdown--below { border-top: none; }

.select2-container--classic.select2-container--disabled .select2-selection--single {
  cursor: not-allowed;
}

.select2-container--classic .select2-selection--multiple {
  cursor: text;
  outline: 0;
}

.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
  list-style: none;
  margin: 0;
  padding: 0 4px;
}

.select2-container--classic .select2-selection--multiple .select2-selection__choice {
  cursor: default;
  float: left;
  margin: 4px 4px 0 0;
  padding: 0 6px;
  line-height: 22px;
}

.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
  cursor: pointer;
  margin-right: 3px;
  font-weight: bold;
}

/* ─── Default theme (structural only) ──────────────── */
.select2-container--default .select2-selection--single .select2-selection__clear {
  cursor: pointer;
  float: right;
  font-weight: bold;
}

.select2-container--default .select2-selection--multiple {
  cursor: text;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  list-style: none;
  margin: 0;
  padding: 0 4px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  cursor: default;
  float: left;
  margin: 4px 4px 0 0;
  padding: 0 6px;
  line-height: 22px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  cursor: pointer;
  margin-right: 2px;
}

.select2-container--default .select2-selection--multiple .select2-selection__clear {
  cursor: pointer;
  float: right;
  font-weight: bold;
  margin-top: 4px;
  margin-right: 8px;
}

.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
  margin-top: 4px;
  float: left;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
  outline: 0;
}

.select2-container--default.select2-container--disabled .select2-selection--multiple,
.select2-container--default.select2-container--disabled .select2-selection--single {
  cursor: not-allowed;
}

.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear,
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
  display: none;
}

/* Group headers */
.select2-container--default .select2-results__option[role=group] { padding: 0; }
.select2-container--default .select2-results__group {
  display: block;
  padding: 5px 10px;
  font-weight: 600;
}
.select2-container--default .select2-results__option .select2-results__option { padding-left: 1em; }

/* ─── RTL ──────────────────────────────────────────── */
.select2-dropdown[dir="rtl"] { direction: rtl; }
.select2-container[dir="rtl"] .select2-results__option,
.select2-container[dir="rtl"] .select2-results__option a { text-align: right; }
.select2-container[dir="rtl"] .select2-selection__icon { margin-right: 0; margin-left: 6px; }
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { padding: 0 10px 0 28px; }
.select2-dropdown[dir="rtl"] .select2-search__field { padding: 0 28px 0 8px; }
.select2-dropdown[dir="rtl"] .select2-search__field-icon { left: auto; right: 0; }
.select2-dropdown[dir="rtl"] .select2-results__message { text-align: right; }
.select2-dropdown[dir="rtl"] .dropdown-menu > li > a { text-align: right; }
.select2-dropdown[dir="rtl"] .select2-selection__icon { margin-right: 0; margin-left: 5px; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow { left: 8px; right: auto; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline { float: right; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 4px; margin-right: 0; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: 0; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { float: right; margin-left: 4px; margin-right: 0; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: 0; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { border: none; border-right: 1px solid transparent; left: 1px; right: auto; }

/* ─── Responsive ───────────────────────────────────── */
@media (max-width: 767px) {
  tr.hidden { display: none !important; }

  .select2-container .select2-selection--single {
    height: 48px !important;
  }
  .select2-container .select2-selection--single .select2-selection__rendered {
    flex-wrap: nowrap;
    padding: 0 32px 0 12px;
    line-height: 48px;
  }
  .select2-selection__rendered .svc-id {
    padding: 2px 7px;
    line-height: 1.6;
  }
  .select2-dropdown {
    margin-top: 8px !important;
    max-width: 100vw;
    overflow: hidden !important;
  }
  .select2-dropdown .select2-results__options,
  .select2-results__options {
    max-height: 260px !important;
    padding: 6px 0 !important;
  }
  .select2-dropdown .select2-results__options .select2-results__option,
  .select2-results__option {
    padding: 10px 14px !important;
    margin: 0 6px !important;
  }
  .select2-dropdown .svc-id,
  .select2-results__option .svc-id {
    padding: 2px 7px !important;
    font-size: 14px;
  }
  .search-dropdown .input-wrapper .form-control { height: 44px; }
  .select2-search__field { height: 40px; }
}

@media (max-width: 480px) {
  .select2-container .select2-selection--single {
    height: 50px !important;
  }
  .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 50px;
  }
  .select2-dropdown {
    max-width: 100vw;
  }
  .select2-dropdown .select2-results__options .select2-results__option,
  .select2-results__option {
    padding: 6px 5px !important;
    gap: 0;
  }
  .select2-dropdown .select2-results__options,
  .select2-results__options {
    max-height: 220px !important;
  }
}

/* ─── Service search (neworder page) ───────────────── */
.search-dropdown .input-wrapper { position: relative; }

.search-dropdown .input-wrapper .form-control {
  padding-left: 36px;
  padding-right: 12px;
  height: 40px;
  outline: none;
  transition: border-color 0.15s;
}

.search-dropdown .input-wrapper .input-wrapper__prepend,
.search-dropdown .input-wrapper .input-wrapper__append {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  transition: color 0.1s;
}

.search-dropdown .input-wrapper .input-wrapper__prepend { left: 12px; }
.search-dropdown .input-wrapper .input-wrapper__append { right: 8px; }

/* Search results */
.search-dropdown .list-group {
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.search-dropdown .list-group-item {
  border: none;
  padding: 7px 14px;
  cursor: pointer;
  transition: background-color 0.1s, color 0.1s;
}

.search-dropdown .list-group-item:last-child { border-bottom: none; }
.search-dropdown .list-group-item.disabled { cursor: not-allowed; }

/* Badge in search results (structural) */
.search-dropdown .list-group-item .svc-id {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 6px;
  line-height: 1.5;
  vertical-align: middle;
}

.search-dropdown .list-group-item .svc-rate {
  margin-left: 4px;
}

/* RTL search */
.search-dropdown[dir="rtl"] .input-wrapper .form-control { padding-left: 10px; padding-right: 34px; }
.search-dropdown[dir="rtl"] .input-wrapper .input-wrapper__prepend { right: 10px; left: auto; }
.search-dropdown[dir="rtl"] .input-wrapper .input-wrapper__append { right: auto; left: 8px; }

/* ─── Misc ─────────────────────────────────────────── */
.select2-close-mask {
  border: 0; margin: 0; padding: 0;
  display: block; position: fixed; left: 0; top: 0;
  min-height: 100%; min-width: 100%;
  height: auto; width: auto;
  opacity: 0; z-index: 99;
}

.select2-hidden-accessible {
  border: 0 !important; clip: rect(0 0 0 0) !important;
  height: 1px !important; margin: -1px !important;
  overflow: hidden !important; padding: 0 !important;
  position: absolute !important; width: 1px !important;
}

.neworder-services { display: flex; align-items: center; }
.neworder-services .btn-favorite { flex-shrink: 0; margin-left: 12px; }

.spin-loader {
  animation: spin-loader 1s infinite linear;
  -webkit-animation: spin-loader 1s infinite linear;
}
@keyframes spin-loader { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@-webkit-keyframes spin-loader { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); } }

/* ─── Platform Filter (structural only) ────────────── */
.platform-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  padding: 0;
}

.platform-filter .pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1.4;
}

.platform-filter .pf-btn .pf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 1;
}

/* Disabled category select (structural) */
.select2-container--default.select2-container--disabled .select2-selection--single {
  cursor: not-allowed;
  opacity: 0.7;
}

@media (max-width: 767px) {
  .platform-filter {
    gap: 6px;
    margin-bottom: 10px;
  }
  .platform-filter .pf-btn {
    padding: 5px 10px;
  }
  .platform-filter .pf-btn .pf-icon {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .platform-filter .pf-btn {
    padding: 5px 8px;
  }
  .platform-filter .pf-btn .pf-label {
    display: none;
  }
  .platform-filter .pf-btn {
    padding: 6px 8px;
  }
}

/* ═══════════════════════════════════════════════════════
   ORDER ACTIONS — cancel / refill buttons
   ═══════════════════════════════════════════════════════ */

.order-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}

.btn-order-action {
  padding: 4px 10px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, background-color 0.15s;
}

.btn-order-action:hover {
  opacity: 0.85;
}

.btn-order-action:disabled,
.btn-order-action.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

#order-action-alert {
  margin: 12px 0;
  padding: 12px 16px;
}
