/**
 * YOOAdmin — global search field polish (Focus Mode).
 * Orange clear (×) control; dark-mode friendly. Applies to native type=search and YOOAdmin search inputs.
 */

body.yoo-focus {
  --yp-search-clear: var(--yooadmin-primary, var(--_yp-primary, #eda934));
}

/* Room for WebKit clear button beside left search icon */
body.yoo-focus :is(
    input[type='search'],
    .yoo-posts-search-input,
    .yoo-pages-search-input,
    .wp-filter-search,
    #plugin-search-input,
    .search-plugins input[type='search']
  ) {
  padding-inline-end: 40px !important;
}

body.yoo-focus :is(
    input[type='search'],
    .yoo-posts-search-input,
    .yoo-pages-search-input,
    .wp-filter-search,
    #plugin-search-input,
    .search-plugins input[type='search']
  )::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-inline-end: 6px;
  cursor: pointer;
  opacity: 0.95;
  background-color: transparent !important;
  background: center / 18px 18px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 5L15 15M15 5L5 15' stroke='%23eda934' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

body.yoo-focus :is(
    input[type='search'],
    .yoo-posts-search-input,
    .yoo-pages-search-input,
    .wp-filter-search,
    #plugin-search-input,
    .search-plugins input[type='search']
  )::-webkit-search-cancel-button:hover {
  opacity: 1;
  transform: scale(1.12);
}

body.yoo-focus :is(
    input[type='search'],
    .yoo-posts-search-input,
    .yoo-pages-search-input,
    .wp-filter-search,
    #plugin-search-input,
    .search-plugins input[type='search']
  )::-webkit-search-cancel-button:active {
  opacity: 0.75;
  transform: scale(0.96);
}

/* Dark mode — slightly brighter orange on dark surfaces */
html[data-yooadmin-studio-color-mode-effective='dark']
  body.yoo-focus
  :is(
    input[type='search'],
    .yoo-posts-search-input,
    .yoo-pages-search-input,
    .wp-filter-search,
    #plugin-search-input,
    .search-plugins input[type='search']
  )::-webkit-search-cancel-button,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective='dark']
  body.yoo-focus
  :is(
    input[type='search'],
    .yoo-posts-search-input,
    .yoo-pages-search-input,
    .wp-filter-search,
    #plugin-search-input,
    .search-plugins input[type='search']
  )::-webkit-search-cancel-button {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 5L15 15M15 5L5 15' stroke='%23f0b84d' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
