/* İade nedeni, miktar ve rafa dönüş: kasa dokunma ölçülerinde tek form. */
#modal .refund-reasons {
  border: 0;
  padding: 0;
  margin: 0 0 var(--b-3);
  min-width: 0;
}
#modal .refund-reasons legend { font-weight: 600; margin-bottom: var(--b-2); }
#modal .refund-reason-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--b-2);
}
#modal .refund-reason-chips button { min-height: 56px; white-space: normal; }
#modal #refund-form .refund-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  align-items: center;
  gap: var(--b-2) var(--b-4);
  padding: var(--b-3) 0;
}
#modal #refund-form .refund-item[hidden] { display: none; }
#modal .refund-line-info { min-width: 0; overflow-wrap: anywhere; }
#modal .refund-quantity-controls { display: flex; gap: var(--b-2); }
#modal #refund-form .refund-quantity-controls input { min-width: 0; width: 100%; min-height: 56px; margin: 0; }
#modal .refund-quantity-controls button { min-height: 56px; margin: 0; }
#modal #refund-form .refund-restock {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--b-3);
  min-height: 56px;
  margin: 0;
  cursor: pointer;
  color: var(--siyah);
  font-size: var(--y-16);
}
#modal .refund-restock input {
  appearance: none;
  flex: 0 0 52px;
  width: 52px;
  height: 30px;
  border: 2px solid var(--cizgi-koyu);
  border-radius: var(--kose-rozet);
  background: var(--yuzey-2);
  margin: 0;
}
#modal .refund-restock input::before {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  margin: 2px;
  border-radius: 50%;
  background: var(--soluk);
}
#modal .refund-restock input:checked { background: var(--olumlu); border-color: var(--olumlu); }
#modal .refund-restock input:checked::before { transform: translateX(22px); background: var(--beyaz); }
#modal .refund-restock input:focus-visible { outline: 2px solid var(--siyah); outline-offset: 3px; }
#modal .refund-restock input:disabled { opacity: .5; cursor: default; }
#modal .refund-restock small { display: block; color: var(--soluk); }
/* S13 (K116): ambalaj onayı tam satır dokunma hedefi; kutu 32 px. */
#modal #refund-form .refund-unopened {
  display: flex;
  align-items: center;
  gap: var(--b-3);
  min-height: 56px;
  margin: 0;
  cursor: pointer;
  color: var(--siyah);
  font-size: var(--y-16);
}
#modal #refund-form .refund-unopened input { flex: 0 0 32px; width: 32px; height: 32px; margin: 0; }
#modal #refund-form .refund-item > .refund-unopened { grid-column: 1 / -1; }
#modal #refund-form .refund-item > .refund-unopened small { display: block; color: var(--soluk); }
@media (min-width: 901px) {
  #modal .refund-reason-chips { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #modal #refund-form .refund-item {
    grid-template-columns: minmax(0, 1fr) 200px 180px;
  }
  #modal #refund-form .refund-restock { grid-column: auto; }
}

/* P10: ürünler kendi gövdesinde kayar; ped ve ana iş sağda yerini korur. */
#modal .refund-button-name { white-space: nowrap; }
#modal .refund-kunye { color: var(--soluk); font-size: var(--y-15); overflow-wrap: anywhere; }
#modal .refund-hints:empty { display: none; }
#modal[data-kasa-pencere='iade'] #modal-close > * { pointer-events: none; }
@media screen and (min-width: 901px) {
  .tezgah-pos #modal[open][data-kasa-pencere='iade'] {
    width: 1180px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 20px 24px;
    --kasa-govde-pay: 0;
  }
  #modal[data-kasa-pencere='iade'] .dialog-top { gap: var(--b-4); padding-bottom: var(--b-3); margin-bottom: var(--b-3); }
  .tezgah-pos #modal[data-kasa-pencere='iade'] .dialog-top > #modal-title { flex: 1; }
  .tezgah-pos #modal[data-kasa-pencere='iade'] .dialog-top > .refund-kunye { grid-column:1 / -1; grid-row:2; margin:0; text-align:left; }
  #modal[data-kasa-pencere='iade'] #modal-close { order: 1; }
  #modal[data-kasa-pencere='iade'] #modal-body { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
  #modal[data-kasa-pencere='iade'] #modal-body::after { display: none; }
  #modal[data-kasa-pencere='iade'] #modal-body > p { flex: none; }
  #modal[data-kasa-pencere='iade'] #refund-form {
    display: grid;
    flex: 1;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: minmax(0, 1fr);
    gap: 28px;
    margin: 0;
    padding: 0;
  }
  #modal .refund-products { min-width: 0; min-height: 0; overflow: auto; padding: 0 6px 6px; margin: -6px 0 -6px -6px; }
  #modal .refund-tools { min-height: 0; padding-bottom:1px; display: flex; flex-direction: column; gap: var(--b-4); }
  #modal .refund-pad { flex: none; min-height: 280px; }
  .tezgah-pos #modal #refund-form #number-pad { margin: 0; gap: var(--b-2); scroll-margin-bottom: 0; }
  .tezgah-pos #modal #refund-form #number-pad button { height: 64px; min-height: 64px; margin: 0; font-size: var(--y-26); font-weight: 600; }
  .tezgah-pos #modal #refund-form #number-pad button[data-key='Sil'] { font-size: var(--y-20); color: var(--siyah); }
  #modal .refund-hints {
    flex: 0 1 auto;
    align-content: start;
    display: grid;
    gap: var(--b-2);
    overflow: auto;
    min-height: 0;
    margin-block: auto;
    padding: var(--b-3) var(--b-4);
    border-radius: var(--kose);
    background: var(--yuzey-2);
  }
  #modal .refund-hints .note {
    margin: 0;
    padding: 0;
    min-height: 0;
    border: 0;
    border-radius: var(--kose);
    background: transparent;
    color: var(--soluk);
    box-shadow: none;
    font-size: var(--y-15);
    font-weight: 500;
    line-height: 1.4;
  }
  #modal .refund-hints .note::before { display: none; }
  .tezgah-pos #modal #refund-form #refund-preview {
    position: static;
    flex: none;
    height: 76px;
    min-height: 76px;
    margin: auto 0 0;
    font-size: var(--y-21);
    box-shadow: none;
  }
  #modal .refund-lines { border: 1px solid var(--cizgi); border-radius: var(--kose); background: var(--beyaz); }
  #modal .refund-lines-head, #modal #refund-form .refund-lines > .refund-item:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px 48px 92px 228px;
    align-items: center;
    gap: 0 var(--b-3);
    padding: 0 var(--b-4);
  }
  #modal .refund-lines-head {
    min-height: 34px;
    border-radius: var(--kose) var(--kose) 0 0;
    border-bottom: 1px solid var(--cizgi);
    background: var(--yuzey-2);
    color: var(--soluk);
    font-size: var(--y-12);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  #modal .refund-lines-head > span:nth-child(2) { grid-column: 2 / 4; }
  .tezgah-pos #modal #refund-form .refund-lines > .refund-item {
    min-height: 72px;
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--cizgi);
    outline: none;
    background: transparent;
    box-shadow: none;
  }
  #modal #refund-form .refund-lines > .refund-item:last-child { border-bottom: 0; }
  #modal .refund-line-info strong { display: block; font-size: var(--y-17); line-height: 1.3; }
  #modal .refund-line-info p { margin: 2px 0 0; color: var(--soluk); font-size: var(--y-14); line-height: 1.3; }
  #modal .refund-line-quantity, #modal .refund-quantity-controls { display: contents; }
  #modal .refund-quantity-label { display: none; }
  #modal #refund-form .refund-line-quantity > label { grid-area: 1 / 3; margin: 0; font-size: var(--y-15); font-weight: 500; color: var(--soluk); }
  #modal #refund-form .refund-quantity-controls input { grid-area: 1 / 2; padding: 6px var(--b-3); text-align: right; font-size: var(--y-22); font-weight: 700; }
  #modal .refund-quantity-controls button { grid-area: 1 / 4; width: 100%; }
  #modal #refund-form .refund-restock { grid-area: 1 / 5; align-self: center; gap: var(--b-2); font-size: var(--y-15); line-height: 1.3; }
  #modal #refund-form .refund-unopened { min-height: 52px; }
  #modal #refund-unopened-row { margin-top: var(--b-2); }
  #modal #refund-unopened-row .form-hata:empty { display: none; }
  #modal .refund-reasons { margin: var(--b-2) 0 0; }
  #modal .refund-reasons legend { margin-bottom: var(--b-1); font-size: var(--y-16); }
  #modal .refund-reason-chips button { margin: 0; padding: var(--b-1) var(--b-2); font-size: var(--y-16); }
  #modal #refund-form label[for='refund-reason'] { margin: var(--b-3) 0 var(--b-1); font-size: var(--y-15); }
  #modal #refund-reason { min-height: 56px; margin: 6px 0 0; font-size: var(--y-17); }
  #modal .refund-quantity-controls input::-webkit-inner-spin-button,
  #modal .refund-quantity-controls input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
}
@media screen and (min-width: 901px) and (max-height: 700px) {
  .tezgah-pos #modal[open][data-kasa-pencere='iade'] { padding-block: var(--b-2); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  #modal[data-kasa-pencere='iade'] .dialog-top { padding-bottom: var(--b-1); margin-bottom: var(--b-2); }
  #modal .refund-tools { gap: var(--b-2); padding-bottom:2px; }
}
@media (max-width: 900px) {
  #modal .refund-lines-head { display: none; }
}
@media (max-width: 560px) {
  #modal .refund-reason-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #modal #refund-form .refund-item { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width:901px) {
  #modal #refund-form .refund-restock { align-self:end; }
  #modal #refund-form .refund-restock small { font-size:var(--y-13); line-height:1.3; }
}
