/**
 * Co — genel form kontrol görünümü (Eventicity select gizleme / .select_container uyumu).
 * Öncelik: wp_enqueue_scripts 2000 (tema stillerinin üzerine).
 */

:root {
  --co-form-radius: 18px;
  --co-form-input-bg: #ffffff;
  --co-form-border: #ebe6e0;
  --co-form-border-focus: #c5a572;
  --co-form-text: #333333;
  --co-form-chevron: #c5c2bc;
  --co-form-min-h: 52px;
  --co-form-pad-x: 20px;
  --co-form-focus-ring: rgba(197, 165, 114, 0.28);
}

/* Eventicity: sarmalanmamış select’ler visibility:hidden — formlar kullanılabilsin */
body:not(.wp-admin) select:not(.esg-sorting-select):not([class*="trx_addons_attrib_"]) {
  visibility: visible !important;
}

body:not(.wp-admin) input[type="text"],
body:not(.wp-admin) input[type="email"],
body:not(.wp-admin) input[type="url"],
body:not(.wp-admin) input[type="tel"],
body:not(.wp-admin) input[type="number"],
body:not(.wp-admin) input[type="search"],
body:not(.wp-admin) input[type="password"],
body:not(.wp-admin) textarea,
body:not(.wp-admin) textarea.wp-editor-area {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: var(--co-form-min-h);
  padding: 14px var(--co-form-pad-x) !important;
  font-size: 1rem !important;
  line-height: 1.35 !important;
  color: var(--co-form-text) !important;
  background-color: var(--co-form-input-bg) !important;
  border: 1px solid var(--co-form-border) !important;
  border-bottom-style: solid !important;
  border-radius: var(--co-form-radius) !important;
  -webkit-transition: border-color 0.2s ease, box-shadow 0.2s ease;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body:not(.wp-admin) textarea,
body:not(.wp-admin) textarea.wp-editor-area {
  min-height: 10em;
  resize: vertical;
}

body:not(.wp-admin) input[type="text"]:focus,
body:not(.wp-admin) input[type="email"]:focus,
body:not(.wp-admin) input[type="url"]:focus,
body:not(.wp-admin) input[type="tel"]:focus,
body:not(.wp-admin) input[type="number"]:focus,
body:not(.wp-admin) input[type="search"]:focus,
body:not(.wp-admin) input[type="password"]:focus,
body:not(.wp-admin) textarea:focus,
body:not(.wp-admin) textarea.wp-editor-area:focus {
  outline: none !important;
  border-color: var(--co-form-border-focus) !important;
  -webkit-box-shadow: 0 0 0 3px var(--co-form-focus-ring);
  box-shadow: 0 0 0 3px var(--co-form-focus-ring);
}

/* Ham select (Profilim vb.) */
body:not(.wp-admin) select:not(.esg-sorting-select):not([class*="trx_addons_attrib_"]):not(.select2-hidden-accessible):not([multiple]) {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: var(--co-form-min-h);
  padding: 14px calc(var(--co-form-pad-x) + 18px) 14px var(--co-form-pad-x) !important;
  font-size: 1rem !important;
  color: var(--co-form-text) !important;
  background-color: var(--co-form-input-bg) !important;
  border: 1px solid var(--co-form-border) !important;
  border-radius: var(--co-form-radius) !important;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23c5c2bc' stroke-width='1.6' stroke-linecap='round' d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  cursor: pointer;
}

body:not(.wp-admin) select:not(.select2-hidden-accessible):not([multiple]):focus {
  outline: none;
  border-color: var(--co-form-border-focus) !important;
  -webkit-box-shadow: 0 0 0 3px var(--co-form-focus-ring);
  box-shadow: 0 0 0 3px var(--co-form-focus-ring);
}

/* Tema: .select_container — aynı hap görünüm + sağ chevron alanı */
body:not(.wp-admin) .select_container {
  position: relative;
  width: 100%;
  max-width: 100%;
}

body:not(.wp-admin) .select_container select:not(.esg-sorting-select):not([class*="trx_addons_attrib_"]) {
  min-height: var(--co-form-min-h);
  padding: 14px calc(var(--co-form-pad-x) + 18px) 14px var(--co-form-pad-x) !important;
  font-size: 1rem !important;
  color: var(--co-form-text) !important;
  background-color: var(--co-form-input-bg) !important;
  border: 1px solid var(--co-form-border) !important;
  border-radius: var(--co-form-radius) !important;
  -webkit-box-shadow: none;
  box-shadow: none;
}

body:not(.wp-admin) .select_container:before {
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 2.75em;
  background-color: transparent !important;
  border-radius: 0 var(--co-form-radius) var(--co-form-radius) 0;
}

body:not(.wp-admin) .select_container:after {
  font-family: inherit !important;
  content: "" !important;
  width: 12px;
  height: 8px;
  margin-top: -4px;
  right: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23c5c2bc' stroke-width='1.6' stroke-linecap='round' d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E")
    center / contain no-repeat;
  color: transparent !important;
}

body:not(.wp-admin) .select_container:hover:before,
body:not(.wp-admin) .select_container:focus-within:before {
  background-color: transparent !important;
}

body:not(.wp-admin) .select_container:hover:after,
body:not(.wp-admin) .select_container:focus-within:after {
  opacity: 0.85;
}

body:not(.wp-admin) .select_container:focus-within select,
body:not(.wp-admin) .select_container select:focus {
  border-color: var(--co-form-border-focus) !important;
  -webkit-box-shadow: 0 0 0 3px var(--co-form-focus-ring);
  box-shadow: 0 0 0 3px var(--co-form-focus-ring);
}

/* WooCommerce Select2 (ülke / eyalet) */
body:not(.wp-admin) .select2-container--default .select2-selection--single {
  min-height: var(--co-form-min-h);
  border: 1px solid var(--co-form-border) !important;
  border-radius: var(--co-form-radius) !important;
  background-color: var(--co-form-input-bg) !important;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

body:not(.wp-admin) .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--co-form-text) !important;
  line-height: calc(var(--co-form-min-h) - 2px);
  padding-left: var(--co-form-pad-x);
  padding-right: 2.5rem;
}

body:not(.wp-admin) .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 10px;
}

body:not(.wp-admin) .select2-container--default.select2-container--open .select2-selection--single,
body:not(.wp-admin) .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--co-form-border-focus) !important;
  -webkit-box-shadow: 0 0 0 3px var(--co-form-focus-ring);
  box-shadow: 0 0 0 3px var(--co-form-focus-ring);
}

/* WooCommerce metin alanları — tema max-width / alt çizgi */
body:not(.wp-admin) .woocommerce .input-text,
body:not(.wp-admin) .woocommerce-page .input-text {
  max-width: none !important;
}

/* Select2 arama kutusu — kompakt */
body:not(.wp-admin) .select2-container .select2-search--dropdown .select2-search__field {
  min-height: 0;
  padding: 8px 12px !important;
  border-radius: 10px !important;
}

/* Ürün adedi — küçük kalsın */
body:not(.wp-admin) .quantity input[type="number"],
body:not(.wp-admin) .quantity input[type="text"],
body:not(.wp-admin) input.qty {
  min-height: 0 !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
}

/* Profilim — etiketler (görseldeki altın / uppercase) */
#panel-profilim .account-form-group label {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--co-form-border-focus);
  padding-left: 4px;
}
