/*
 * WooCommerce Order Reporter — Front-end shortcode overrides
 * Resets common theme styles that would otherwise break the report UI.
 */

/* ── Scope everything inside .wor-wrap ── */
.wor-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
  max-width: 100%;
  margin: 0 0 40px;
}

.wor-wrap *,
.wor-wrap *::before,
.wor-wrap *::after {
  box-sizing: border-box;
}

/* Reset theme typography interference */
.wor-wrap h1,
.wor-wrap h2,
.wor-wrap h3,
.wor-wrap p {
  margin: 0;
  padding: 0;
  border: none;
  font-family: inherit;
  line-height: inherit;
}

/* Reset theme table styles */
.wor-wrap table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  background: none;
}

.wor-wrap table th,
.wor-wrap table td {
  border: none;
  padding: 9px 12px;
  text-align: left;
  font-weight: normal;
  background: none;
}

/* Reset theme input/button interference */
.wor-wrap input[type="text"],
.wor-wrap input[type="radio"],
.wor-wrap input[type="checkbox"],
.wor-wrap select,
.wor-wrap button {
  font-family: inherit;
  font-size: inherit;
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.wor-wrap input[type="radio"],
.wor-wrap input[type="checkbox"] {
  width: auto;
  height: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
}

/* Reset theme ul/li interference inside the fields list */
.wor-wrap ul.wor-fields-list,
.wor-wrap ul.wor-fields-list li {
  list-style: none;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

/* Reset theme anchor styles inside the table */
.wor-wrap #wor-table-container a {
  text-decoration: none;
  color: var(--wor-primary, #7c3aed);
}

.wor-wrap #wor-table-container a:hover {
  text-decoration: underline;
}

/* Ensure the card sits flush inside the page content area */
.wor-wrap .wor-header {
  border-radius: 10px 10px 0 0;
}

/* Make results table horizontally scrollable on mobile */
.wor-wrap .wor-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tighten margin on smaller screens */
@media (max-width: 768px) {
  .wor-wrap .wor-card {
    padding: 16px;
  }

  .wor-wrap .wor-preset-picker-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .wor-wrap .wor-run-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Notice shown when user lacks permission */
.wor-sc-notice {
  padding: 16px 20px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #991b1b;
  font-size: 14px;
}
