// Subscription Product Display Styles

#woocommerce-product-data .arraysubs-fixed-end-heading {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.arraysubs-product-info {
  margin: 15px 0;
  padding: 15px;
  background: #f9f9f9;
  border-left: 3px solid #96588a;
  border-radius: 3px;

  .subscription-terms {
    p {
      margin: 0 0 8px 0;
      font-size: 14px;
      color: #555;

      &:last-child {
        margin-bottom: 0;
      }
    }

    .subscription-pricing {
      font-weight: 600;
      font-size: 16px;
      color: #333;
    }

    .subscription-length {
      font-size: 13px;
      color: #666;
    }
  }
}

#_arraysubs_shipping_type {
  width: 100%;
}

.arraysubs-custom-helptext {
  display: block !important;
  clear: both !important;
  margin: 6px 0 0 0 !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
}

.arraysubs-product-helper-links {
  margin: 8px 0;

  &__header {
    margin-bottom: 0;
    font-size: 12px;
    letter-spacing: 0.04em;
    line-height: 1;
    opacity: 0;
  }

  &__row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    min-width: 0;

    &:last-child {
      margin-bottom: 0;
    }
  }

  &__meta {
    display: flex;
    flex: 0 0 142px;
    flex-direction: column;
    gap: 2px;
    max-width: 142px;
  }

  &__label {
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
  }

  &__copy-link {
    font-size: 9px;
    line-height: 1.2;
    text-decoration: none;
  }

  &__input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    background: #fff;
    font-size: 11px;
    line-height: 1.2;
  }

  &__separator {
    margin: 8px 0;
    width: 100%;
    border: 0;
    border-top: 1px solid #dcdcde;
  }

  &--variation {
    margin: 6px 0;
  }
}

.arraysubs-product-list-indicator {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;

  &__tag {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ede7f6;
    color: #5b3f8c;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;

    &--type {
      background: #e7f0ff;
      color: #1d4f91;
    }

    &--subscription {
      background: #ede7f6;
      color: #5b3f8c;
    }

    &--trial {
      background: #e6f4ea;
      color: #1a6b2e;
    }
  }
}

.arraysubs-price-info {
  margin-top: 4px;
  line-height: 1.5;

  &__row {
    font-size: 11px;
    color: #646970;
    line-height: 1.4;
    margin-top: 2px;

    &--schedule {
      color: #50575e;
      font-weight: 500;
    }

    &--signup {
      color: #2271b1;
    }

    &--renewal {
      color: #996800;
    }
  }

  &__schedule {
    font-style: italic;
  }

  &__sep {
    opacity: 0.6;
  }
}

.wp-list-table .column-name {
  .arraysubs-product-list-indicator {
    line-height: 1;
  }
}
// Product Edit Page Styles
#arraysubs_product_data {
  display: none; // Hide by default, shown when subscription product type is selected
  .options_group {
    padding: 12px;

    .hidden {
      display: none !important;
    }
  }

  input[type="number"].short {
    width: 150px;
  }
}

.woocommerce_variation,
#general_product_data {
  .arraysubs-product-helper-links {
    .arraysubs-product-helper-links__row {
      flex-wrap: nowrap;
    }
  }
}

#general_product_data .arraysubs-product-helper-links {
  margin: 8px 12px;
}

@media (max-width: 1200px) {
  .arraysubs-product-helper-links {
    &__row {
      flex-wrap: wrap;
    }

    &__label {
      max-width: none;
    }

    &__meta {
      flex-basis: 100%;
      max-width: none;
    }

    &__input {
      flex-basis: 100%;
    }
  }
}

// Variation Fields - Improved Layout
.arraysubs-variation-fields {
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  margin: 12px 0;

  .show_if_variation_subscription,
  .show_if_variation_renewal_price {
    transition: all 0.2s ease;
  }

  // Section styling
  .arraysubs-variation-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e1e1e1;

    &:last-child {
      margin-bottom: 0;
      padding-bottom: 0;
      border-bottom: none;
    }

    &.arraysubs-variation-header {
      margin-bottom: 12px;
      padding-bottom: 12px;
    }
  }

  // Section title
  .arraysubs-section-title {
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
    margin-bottom: 12px;
  }

  // Section description
  .arraysubs-section-description {
    display: block;
    font-size: 12px;
    color: #646970;
    margin-bottom: 8px;
    line-height: 1.4;
  }

  // Checkbox label styling
  .arraysubs-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    cursor: pointer;

    input[type="checkbox"] {
      margin: 0;
    }

    &.arraysubs-checkbox-disabled {
      cursor: default;
      opacity: 0.7;

      input[type="checkbox"] {
        cursor: not-allowed;
      }

      .arraysubs-controlled-note {
        font-weight: 400;
        font-size: 11px;
        color: #888;
        font-style: italic;
      }
    }
  }

  // Price info display
  .arraysubs-variation-price-info {
    .arraysubs-price-display {
      display: flex;
      flex-wrap: wrap;
      gap: 16px;
      margin-top: 8px;
      padding: 10px;
      background: #fff;
      border: 1px solid #ddd;
      border-radius: 3px;
    }

    .arraysubs-variation-regular-price-display,
    .arraysubs-variation-sale-price-display {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;

      strong {
        color: #50575e;
        font-weight: 500;
      }

      .price-value {
        color: #1d2327;
      }

      .sale-schedule {
        font-size: 11px;
        color: #646970;
        margin-left: 4px;
      }
    }
  }

  // Two-column row layout (matching WooCommerce variation fields)
  .arraysubs-variation-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  // Column system
  .arraysubs-variation-col {
    display: flex;
    flex-direction: column;
    gap: 4px;

    // Half width column (50%)
    &.arraysubs-variation-col-half {
      flex: 0 0 calc(50% - 6px);
      max-width: calc(50% - 6px);
    }

    // Split column (two items side by side within a column)
    .arraysubs-variation-col-split {
      display: flex;
      gap: 12px;

      .arraysubs-variation-col-split-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
      }
    }

    label {
      font-size: 12px;
      font-weight: 500;
      color: #1d2327;
      margin-bottom: 2px;
    }

    input[type="number"],
    input[type="text"],
    select {
      width: 100%;
      padding: 6px 8px;
      border: 1px solid #8c8f94;
      border-radius: 3px;
      font-size: 13px;
      line-height: 1.4;
      background-color: #fff;
      box-sizing: border-box;

      &:focus {
        border-color: #2271b1;
        box-shadow: 0 0 0 1px #2271b1;
        outline: none;
      }
    }

    .description {
      font-size: 11px;
      color: #646970;
      line-height: 1.3;
    }
  }

  // Legacy field classes (keep for backward compatibility)
  .arraysubs-variation-field {
    display: flex;
    flex-direction: column;
    gap: 4px;

    label {
      font-size: 12px;
      font-weight: 500;
      color: #1d2327;
      margin-bottom: 2px;
    }

    input[type="number"],
    input[type="text"],
    select {
      width: 100%;
      padding: 6px 8px;
      border: 1px solid #8c8f94;
      border-radius: 3px;
      font-size: 13px;
      line-height: 1.4;
      background-color: #fff;
      box-sizing: border-box;

      &:focus {
        border-color: #2271b1;
        box-shadow: 0 0 0 1px #2271b1;
        outline: none;
      }
    }

    .description {
      font-size: 11px;
      color: #646970;
      line-height: 1.3;
    }
  }
}

// Cart & Checkout
.woocommerce-cart,
.woocommerce-checkout {
  .subscription-schedule {
    small {
      display: block;
      color: #666;
      font-size: 0.9em;
      margin-top: 3px;
    }
  }
}
