// ==========================================================================
// #dynamic-methods-container
// Replaces Bootstrap grid/utility classes now that Bootstrap has been removed.
// Uses CSS Grid (12-col) so existing col-1..col-12 markup keeps working.
// ==========================================================================

$pisol-border:        #c3c4c7; // matches WP admin field border
$pisol-border-light:  #dcdcde;
$pisol-primary:       #2271b1; // WP admin blue
$pisol-primary-hover: #135e96;
$pisol-danger:        #b32d2e;
$pisol-danger-hover:  #8f2323;
$pisol-radius:        4px;
$pisol-gap:           16px;
$pisol-breakpoint:    782px; // WP admin's own mobile breakpoint

#dynamic-methods-container {
  display: flex;
  flex-direction: column;
  gap: 24px;

  // Each direct child = one shipping method entry (the outer <div> wrapping
  // the rows). Card-style container so entries are visually separated.
  > div {
    background: #fff;
    border: 1px solid $pisol-border;
    border-radius: $pisol-radius;
    padding: 20px;
  }

  .row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: $pisol-gap;
    align-items: center;
    padding: 12px 0;

    &.border-bottom {
      border-bottom: 1px solid $pisol-border-light;
    }

    @media (max-width: $pisol-breakpoint) {
      grid-template-columns: 1fr;
    }
  }

  // col-1 .. col-12
  @for $i from 1 through 12 {
    .col-#{$i} {
      grid-column: span $i;

      @media (max-width: $pisol-breakpoint) {
        grid-column: span 12;
      }
    }
  }

  // Inputs / selects
  .form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid $pisol-border;
    border-radius: $pisol-radius;
    font-size: 14px;
    line-height: 1.4;
    background: #fff;
    color: #2c3338;

    &:focus {
      border-color: $pisol-primary;
      box-shadow: 0 0 0 1px $pisol-primary;
      outline: none;
    }

    &::placeholder {
      color: #8c8f94;
    }
  }

  label {
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
  }

  input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: $pisol-primary;
  }

  // Buttons
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: $pisol-radius;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;

    &.btn-primary {
      background: var(--pisol-primary-color);
      border-color: var(--pisol-primary-color);
      color: #fff;

      &:hover {
        background: var(--pisol-primary-color);
        border-color: var(--pisol-primary-color);
      }
    }

    &.btn-sm {
      padding: 4px 8px;
      font-size: 12px;
    }
  }

  // Delete / trash button — visually distinct from primary actions
  .delete-dynamic-method {
    &.btn-primary {
      background: $pisol-danger;
      border-color: $pisol-danger;

      &:hover {
        background: $pisol-danger-hover;
        border-color: $pisol-danger-hover;
      }
    }

    .dashicons {
      width: 16px;
      height: 16px;
      font-size: 16px;
      line-height: 1;
    }
  }

  .pisol-edd-clear-time {
    text-decoration: none;
    padding: 6px 10px;
  }

  // Non-working-days / holidays sections
  .pi_days_of_week_container,
  .pi_edd_holidays_container {
    strong {
      display: block;
      margin-bottom: 6px;
      font-weight: 600;
    }
  }

  // select2 — align height/border with .form-control so rows line up
  .select2-container {
    width: 100% !important;
  }

  // flatpickr time/date inputs share .form-control, so no extra rule needed
  // beyond making sure the cursor still reads as clickable since they're readonly
  .pisol-edd-dynamic-time-picker,
  .holiday_dates {
    cursor: pointer;
  }
}
