/*
 * Legal module: documents, checkout summary box and contract dialogs.
 * Legal text is at least 16px (≈ 12pt, Mesafeli Sözleşmeler Yönetmeliği m.6(1)).
 */

.hediyesahibi-legal-doc {
  font-size: max(1rem, 16px);
  line-height: 1.6;
}

/* Themes shrink <small> (Kadence: 80%); older snapshots used it for notes. */
.hediyesahibi-legal-doc small,
.hediyesahibi-legal-summary small {
  font-size: 1em;
}

.hediyesahibi-legal-doc h2 {
  font-size: 1.25em;
  margin: 1.5em 0 0.5em;
}

.hediyesahibi-legal-doc h3 {
  font-size: 1.1em;
  margin: 1.25em 0 0.5em;
}

.hediyesahibi-legal-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 1em;
}

.hediyesahibi-legal-doc th,
.hediyesahibi-legal-doc td {
  border: 1px solid var(--global-gray-400, #cbd2d9);
  padding: 0.4em 0.6em;
  text-align: left;
  vertical-align: top;
}

.hediyesahibi-legal-doc .hediyesahibi-legal-num {
  text-align: right;
  white-space: nowrap;
}

.hediyesahibi-legal-doc dl {
  display: grid;
  grid-template-columns: minmax(10em, max-content) 1fr;
  gap: 0.25em 1em;
}

.hediyesahibi-legal-doc dt {
  font-weight: 600;
}

.hediyesahibi-legal-doc dd {
  margin: 0;
}

.hediyesahibi-legal-doc .hediyesahibi-legal-form {
  border: 1px dashed var(--global-gray-500, #9aa5b1);
  padding: 1em;
}

.hediyesahibi-legal-draft {
  border-left: 4px solid #d63638;
  background: #fcf0f1;
  color: #1e1e1e;
  padding: 0.75em 1em;
  font-size: max(1rem, 16px);
}

.hediyesahibi-legal-missing {
  background: #fcf0f1;
  color: #8a2424;
  padding: 0 0.25em;
}

/* Checkout: summary box directly above the place-order button. */
/* Radii follow the child theme's tokens and corner smoothing (fallbacks without it). */
.hediyesahibi-legal-summary {
  border: 1px solid var(--global-gray-400, #cbd2d9);
  border-radius: var(--hs-r-md, 14px);
  corner-shape: var(--hs-corner-shape, round);
  padding: 1em;
  margin: 1em 0;
  font-size: max(1rem, 16px);
  line-height: 1.5;
}

.hediyesahibi-legal-summary__title {
  font-size: 1.1em;
  margin: 0 0 0.5em;
}

.hediyesahibi-legal-summary__list {
  margin: 0;
}

.hediyesahibi-legal-summary__list dt {
  font-weight: 600;
  margin-top: 0.5em;
}

.hediyesahibi-legal-summary__list dd {
  margin: 0;
}

.hediyesahibi-legal-summary__list ul {
  margin: 0;
  padding-left: 1.2em;
}

.hediyesahibi-legal-summary__obligation {
  margin: 0.75em 0 0;
}

.hediyesahibi-legal-kvkk-notice,
.woocommerce-terms-and-conditions-checkbox-text {
  font-size: max(1rem, 16px);
}

.hediyesahibi-iys-notice__title {
  margin: 0;
}

.hediyesahibi-iys-notice__text {
  margin: 0.25em 0 0.5em;
  font-size: 0.95em;
}

/*
 * Contract dialogs and the dialog that asks for the contract box (Checkout::
 * render_dialogs(), confirm_dialog(); DESIGN.md "Sözleşme pencereleri"). The site's
 * dialog, as the cart's "Empty your cart?": a white card, R 28, over the page dimmed and
 * softly blurred, rising in. Concentric from the card inward: what sits 12 px in (the
 * close button, the footer's buttons, the confirmation's summary box) has the radius
 * R − 12 = 16 (with the corner smoothing); the text is 24 px in (20 px on phones).
 *
 * Contrast: text --hs-ink 14.85:1, labels --hs-muted 6.06:1 (5.66:1 on the summary's
 * #f6f7fa); "Close" / "Cancel" --hs-blue-700 on #eef4ff 6.3:1; "I have read and accept"
 * white on --hs-blue-600 4.78:1. Legal text at least 16 px (m.6(1): 12 pt).
 *
 * The selectors are long where WooCommerce's (`.woocommerce button.button.alt`) and the
 * theme's (headings, buttons on hover, focus and press) would win.
 */
.hediyesahibi-legal-dialog {
  --hs-ld-r: var(--hs-radius-xl, 28px);
  --hs-ld-in: 12px;
  --hs-ld-pad: 24px;
  --hs-ld-inner-r: max(calc((var(--hs-ld-r) - var(--hs-ld-in)) * var(--hs-corner-scale, 1)), var(--hs-r-min, 4px));
  --hs-ld-panel: #f6f7fa;

  box-sizing: border-box;
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  max-height: min(880px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: calc(var(--hs-ld-r) * var(--hs-corner-scale, 1));
  corner-shape: var(--hs-corner-shape, round);
  background: var(--hs-surface, #fff);
  box-shadow:
    0 0 0 1px rgb(31 37 71 / 6%),
    0 30px 70px -20px rgb(31 37 71 / 45%);
  color: var(--hs-ink, #1f2547);
  font-family: var(--hs-font, system-ui, sans-serif);
  font-size: max(1rem, 16px);
  font-weight: 500;
  line-height: 1.6;
}

.hediyesahibi-legal-dialog *,
.hediyesahibi-legal-dialog *::before,
.hediyesahibi-legal-dialog *::after {
  box-sizing: border-box;
}

.hediyesahibi-legal-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: hediyesahibi-legal-in 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.hediyesahibi-legal-dialog::backdrop {
  background: rgb(31 37 71 / 42%);
  backdrop-filter: blur(3px);
  animation: hediyesahibi-legal-fade 0.22s ease-out;
}

@keyframes hediyesahibi-legal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

@keyframes hediyesahibi-legal-fade {
  from {
    opacity: 0;
  }
}

/* Head: the title 24 px in; the close button 12 px in (R − 12). */
.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: var(--hs-ld-in) var(--hs-ld-in) var(--hs-ld-in) var(--hs-ld-pad);
  border-bottom: 1px solid var(--hs-line, #e6e9f0);
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__header .hediyesahibi-legal-dialog__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--hs-ink, #1f2547);
  font-family: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__header button.hediyesahibi-legal-dialog__x,
.hediyesahibi-legal-dialog
  .hediyesahibi-legal-dialog__header
  button.hediyesahibi-legal-dialog__x:is(:hover, :focus, :active) {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--hs-ld-inner-r);
  corner-shape: var(--hs-corner-shape, round);
  background: transparent;
  box-shadow: none;
  color: var(--hs-muted, #5b6180);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

@media (hover: hover) {
  .hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__header button.hediyesahibi-legal-dialog__x:hover {
    background: var(--hs-surface-2, #f4f6f9);
    color: var(--hs-ink, #1f2547);
  }
}

.hediyesahibi-legal-dialog :is(button, a):focus-visible {
  outline: 2px solid var(--hs-focus, #1f2547);
  outline-offset: 2px;
}

/* The text, scrolling between the head and the foot. */
.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 20px var(--hs-ld-pad) 28px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c8cedc transparent;
  scrollbar-width: thin;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__body:focus {
  outline: none;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__body:focus-visible {
  outline: 2px solid var(--hs-focus, #1f2547);
  outline-offset: -4px;
}

/* The documents in the dialogs: the site's type, lines and panels. */
.hediyesahibi-legal-dialog .hediyesahibi-legal-doc {
  color: var(--hs-ink, #1f2547);
  font-size: max(1rem, 16px);
  line-height: 1.6;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc > :first-child {
  margin-top: 0;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc p {
  margin: 0 0 0.75em;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc :is(h2, h3, h4) {
  margin: 1.75em 0 0.5em;
  color: var(--hs-ink, #1f2547);
  font-family: inherit;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc h2 {
  font-size: 18px;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc :is(h3, h4) {
  font-size: max(1rem, 16px);
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc :is(ul, ol),
.hediyesahibi-legal-confirm .hediyesahibi-legal-summary__list ul {
  margin: 0 0 0.75em;
  padding-left: 1.25em;
  list-style: disc;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc ol {
  list-style: decimal;
}

.hediyesahibi-legal-confirm .hediyesahibi-legal-summary__list ul {
  margin: 0;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc a {
  color: var(--hs-blue-600, #0070e0);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc strong {
  font-weight: 800;
}

/* Key and value lists (seller, buyer): rows with a line between them. */
.hediyesahibi-legal-dialog .hediyesahibi-legal-doc dl {
  display: grid;
  grid-template-columns: minmax(9em, max-content) minmax(0, 1fr);
  gap: 0;
  margin: 0 0 1em;
  border-top: 1px solid var(--hs-line, #e6e9f0);
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc :is(dt, dd) {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--hs-line, #e6e9f0);
  overflow-wrap: anywhere;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc dt {
  padding-right: 16px;
  color: var(--hs-muted, #5b6180);
  font-weight: 600;
}

/* Tables (the items): a card, R md, with a light head. */
.hediyesahibi-legal-dialog .hediyesahibi-legal-doc table {
  width: 100%;
  margin: 1em 0;
  overflow: hidden;
  border: 1px solid var(--hs-line, #e6e9f0);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--hs-r-md, 14px);
  corner-shape: var(--hs-corner-shape, round);
  font-size: max(1rem, 16px);
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc :is(th, td) {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--hs-line, #e6e9f0);
  text-align: left;
  vertical-align: top;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc thead th {
  background: var(--hs-ld-panel);
  font-weight: 700;
}

/* The amounts' heads over the amounts (right). */
.hediyesahibi-legal-dialog .hediyesahibi-legal-doc table.hediyesahibi-legal-items thead th:not(:first-child) {
  text-align: right;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc tfoot :is(th, td) {
  font-weight: 600;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc tr:last-child > :is(th, td) {
  border-bottom: 0;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc :is(thead, tbody) + :is(tbody, tfoot) tr:first-child > :is(th, td) {
  border-top: 1px solid var(--hs-line, #e6e9f0);
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc .hediyesahibi-legal-num {
  text-align: right;
  white-space: nowrap;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-doc :is(.hediyesahibi-legal-item-summary, .hediyesahibi-legal-version) {
  color: var(--hs-muted, #5b6180);
}

/* The model withdrawal form: a panel. */
.hediyesahibi-legal-dialog .hediyesahibi-legal-doc .hediyesahibi-legal-form {
  margin: 1em 0;
  padding: 16px;
  border-radius: var(--hs-r-md, 14px);
  corner-shape: var(--hs-corner-shape, round);
  background: var(--hs-ld-panel);
}

/* Foot: the buttons 12 px in, R − 12. "Close" and "Cancel" light blue, the acceptance blue. */
.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__footer {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: var(--hs-ld-in);
  border-top: 1px solid var(--hs-line, #e6e9f0);
  background: var(--hs-surface, #fff);
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__footer button.button.hediyesahibi-legal-dialog__btn,
.hediyesahibi-legal-dialog
  .hediyesahibi-legal-dialog__footer
  button.button.hediyesahibi-legal-dialog__btn:is(:hover, :focus, :active) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin: 0;
  padding: 0 24px;
  border: 0;
  border-radius: var(--hs-ld-inner-r);
  corner-shape: var(--hs-corner-shape, round);
  box-shadow: none;
  font: 800 16px/1.2 var(--hs-font, system-ui, sans-serif);
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__footer button.button.hediyesahibi-legal-dialog__btn--quiet,
.hediyesahibi-legal-dialog
  .hediyesahibi-legal-dialog__footer
  button.button.hediyesahibi-legal-dialog__btn--quiet:is(:focus, :active) {
  background: #eef4ff;
  color: var(--hs-blue-700, #185c9f);
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__footer button.button.hediyesahibi-legal-dialog__btn--primary,
.hediyesahibi-legal-dialog
  .hediyesahibi-legal-dialog__footer
  button.button.hediyesahibi-legal-dialog__btn--primary:is(:focus, :active) {
  background: var(--hs-blue-600, #0070e0);
  color: #fff;
}

@media (hover: hover) {
  .hediyesahibi-legal-dialog
    .hediyesahibi-legal-dialog__footer
    button.button.hediyesahibi-legal-dialog__btn--quiet:hover {
    background: #e1ecff;
    color: var(--hs-blue-700, #185c9f);
  }

  .hediyesahibi-legal-dialog
    .hediyesahibi-legal-dialog__footer
    button.button.hediyesahibi-legal-dialog__btn--primary:hover {
    background: var(--hs-blue-700, #185c9f);
    color: #fff;
  }
}

/*
 * The dialog that asks for the contract box (legal.js): the lead, the pre-contract
 * summary as a panel 12 px in (R − 12; its text lines up with the rest at 24 px), both
 * documents one after the other, a line between them.
 */
.hediyesahibi-legal-dialog .hediyesahibi-legal-confirm__lead {
  margin: 0 0 16px;
  color: var(--hs-muted, #5b6180);
}

.hediyesahibi-legal-confirm .hediyesahibi-legal-confirm__summary .hediyesahibi-legal-summary {
  margin: 0 calc(var(--hs-ld-in) - var(--hs-ld-pad)) 28px;
  padding: 16px calc(var(--hs-ld-pad) - var(--hs-ld-in));
  border: 0;
  border-radius: var(--hs-ld-inner-r);
  corner-shape: var(--hs-corner-shape, round);
  background: var(--hs-ld-panel);
  font-size: max(1rem, 16px);
}

.hediyesahibi-legal-confirm .hediyesahibi-legal-summary .hediyesahibi-legal-summary__title {
  margin: 0 0 8px;
  color: var(--hs-ink, #1f2547);
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.hediyesahibi-legal-confirm .hediyesahibi-legal-summary__list dt {
  margin-top: 10px;
  color: var(--hs-muted, #5b6180);
  font-weight: 700;
}

.hediyesahibi-legal-confirm .hediyesahibi-legal-summary__list dd {
  color: var(--hs-ink, #1f2547);
}

.hediyesahibi-legal-confirm .hediyesahibi-legal-summary__obligation {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e1e5ee;
}

.hediyesahibi-legal-confirm .hediyesahibi-legal-confirm__doc + .hediyesahibi-legal-confirm__doc {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--hs-line, #e6e9f0);
}

.hediyesahibi-legal-dialog .hediyesahibi-legal-confirm__doc .hediyesahibi-legal-confirm__doc-title {
  margin: 0 0 12px;
  color: var(--hs-ink, #1f2547);
  font-family: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}

/* Phones: nearly the whole screen; the buttons share the foot. */
@media (width <= 600px) {
  .hediyesahibi-legal-dialog {
    --hs-ld-pad: 20px;

    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__header .hediyesahibi-legal-dialog__title {
    font-size: 18px;
  }

  .hediyesahibi-legal-dialog .hediyesahibi-legal-dialog__footer button.button.hediyesahibi-legal-dialog__btn {
    flex: 1 1 auto;
    padding: 0 16px;
  }

  .hediyesahibi-legal-dialog .hediyesahibi-legal-doc dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .hediyesahibi-legal-dialog .hediyesahibi-legal-doc dt {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .hediyesahibi-legal-dialog .hediyesahibi-legal-doc dd {
    padding-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hediyesahibi-legal-dialog[open],
  .hediyesahibi-legal-dialog::backdrop {
    animation: none;
  }

  .hediyesahibi-legal-dialog * {
    transition: none;
  }
}

/*
 * With that dialog the page's summary box keeps only the payment obligation (m.8(1)),
 * right above the order button; the rest is in the dialog.
 */
.hediyesahibi-legal-confirm-ready #payment .hediyesahibi-legal-summary > :not(.hediyesahibi-legal-summary__obligation) {
  display: none;
}

.hediyesahibi-legal-confirm-ready #payment .hediyesahibi-legal-summary {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.hediyesahibi-legal-confirm-ready #payment .hediyesahibi-legal-summary__obligation {
  margin: 0;
}

/* After an update changed the documents, the tick was taken back (legal.js). */
.hediyesahibi-legal-changed {
  margin: 0.5em 0 0;
  color: var(--hs-red, #e11d48);
  font-size: max(1rem, 16px);
  font-weight: 600;
}

/* Thank-you page and My Account → order. */
.hediyesahibi-legal-contracts {
  margin: 2em 0;
}

.hediyesahibi-legal-contracts__doc {
  border: 1px solid var(--global-gray-400, #cbd2d9);
  border-radius: var(--hs-r-md, 14px);
  corner-shape: var(--hs-corner-shape, round);
  padding: 0.5em 1em;
  margin: 0.5em 0;
}

.hediyesahibi-legal-contracts__doc > summary {
  cursor: pointer;
  font-weight: 600;
}

@media (width <= 600px) {
  .hediyesahibi-legal-doc dl {
    grid-template-columns: 1fr;
  }

  .hediyesahibi-legal-doc table {
    display: block;
    overflow-x: auto;
  }
}
