/* OTW FAQs — Frontend Styles
   Buttons are fully reset inside the widget so Elementor's global button
   styles cannot bleed in. Defaults are black-and-white / inherit so the
   widget adopts the active theme. Elementor style-panel values override
   naturally (its generated CSS comes later in the cascade).             */

/* ── Design tokens ────────────────────────────────────────────────── */
.otw-faq-widget {
  --otw-accent: #21759b;
  --otw-border: rgba(0, 0, 0, 0.13);
  --otw-surface: rgba(0, 0, 0, 0.03);
  --otw-hover: rgba(0, 0, 0, 0.06);
  --otw-radius-sm: 3px;
  --otw-radius: 4px;
  --otw-trans: 140ms ease;

  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.otw-faq-widget *,
.otw-faq-widget *::before,
.otw-faq-widget *::after {
  box-sizing: border-box;
}

/* ── BUTTON RESET ─────────────────────────────────────────────────────
   Strips every property Elementor's global stylesheet might set on
   <button> elements. Must come before any per-component rules.         */
.otw-faq-widget button {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  background-color: transparent;
  background-image: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-style: normal;
  letter-spacing: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0;
  text-align: left;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  vertical-align: baseline;
  width: auto;
  transition: none;
}

/* Strip ALL visual focus styles that Elementor may inject.
   Per-component :focus-visible rules re-apply intentional visuals below. */
.otw-faq-widget button:focus {
  outline: none;
  background: transparent;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  color: inherit;
}
.otw-faq-widget button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: var(--otw-radius-sm);
}

/* Per-component focus resets — two-class selectors beat Elementor's rules */
.otw-faq-widget .otw-faq-tab:focus {
  background: transparent;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  color: inherit;
}
.otw-faq-widget .otw-faq-question:focus {
  background: transparent;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  color: inherit;
}
.otw-faq-widget .otw-faq-search-clear:focus {
  background: transparent;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  color: inherit;
}
/* Submit keeps its dark bg on focus — intentional override */
.otw-faq-widget .otw-faq-submit:focus {
  background: #000;
  background-color: #000;
  background-image: none;
  color: #fff;
}

/* ── Screen-reader utility ────────────────────────────────────────── */
.otw-faq-widget .otw-faq-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════════════════════════════════════ */
.otw-faq-widget .otw-faq-search {
  position: relative;
  margin-bottom: 1.5rem;
}

.otw-faq-widget .otw-faq-search-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--otw-border);
  border-radius: var(--otw-radius);
  background: var(--otw-surface);
  padding: 0 0.75rem;
  transition:
    border-color var(--otw-trans),
    box-shadow var(--otw-trans);
}

.otw-faq-widget .otw-faq-search-box:focus-within {
  border-color: currentColor;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.otw-faq-widget .otw-faq-search-icon {
  flex-shrink: 0;
  margin-right: 0.5rem;
  opacity: 0.35;
  color: currentColor;
  pointer-events: none;
}

.otw-faq-widget .otw-faq-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.65rem 0;
  min-width: 0;
}

.otw-faq-widget .otw-faq-search-input::placeholder {
  opacity: 0.4;
  color: currentColor;
}

.otw-faq-widget .otw-faq-search-input::-webkit-search-decoration,
.otw-faq-widget .otw-faq-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Clear button — inherits the global button reset above */
.otw-faq-widget .otw-faq-search-clear {
  opacity: 0.4;
  padding: 0.25rem;
  transition: opacity var(--otw-trans);
}

.otw-faq-widget .otw-faq-search-clear:hover,
.otw-faq-widget .otw-faq-search-clear:focus-visible {
  opacity: 0.9;
}

/* Suggestions dropdown */
.otw-faq-widget .otw-faq-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: Canvas;
  color: CanvasText;
  border: 1px solid var(--otw-border);
  border-radius: var(--otw-radius);
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.otw-faq-widget .otw-faq-suggest[hidden] {
  display: none;
}

.otw-faq-widget .otw-faq-suggest-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--otw-trans);
}

.otw-faq-widget .otw-faq-suggest-item:hover,
.otw-faq-widget .otw-faq-suggest-item[aria-selected="true"] {
  background: var(--otw-hover);
}

/* ══════════════════════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════════════════════ */
.otw-faq-widget .otw-faq-layout {
  display: block;
}

.otw-faq-widget .otw-faq-layout--with-tabs {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ══════════════════════════════════════════════════════════════════════
   CATEGORY TABS
   Base reset already applied above; only layout + state styles here.
══════════════════════════════════════════════════════════════════════ */
.otw-faq-widget .otw-faq-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 1.5rem;
}

/* Tab button — explicit, high-specificity rules override Elementor */
.otw-faq-widget .otw-faq-tab {
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--otw-radius-sm);
  color: currentColor;
  opacity: 0.55;
  padding: 0.5rem 0.75rem;
  text-align: left;
  transition:
    background var(--otw-trans),
    opacity var(--otw-trans),
    border-color var(--otw-trans);
}

.otw-faq-widget .otw-faq-tab:hover,
.otw-faq-widget .otw-faq-tab:focus-visible {
  background: var(--otw-hover);
  opacity: 0.85;
}

.otw-faq-widget .otw-faq-tab:active {
  background: var(--otw-hover);
  opacity: 1;
}

.otw-faq-widget .otw-faq-tab.is-active {
  background: var(--otw-hover);
  border-color: currentColor;
  font-weight: 600;
  opacity: 1;
}

.otw-faq-widget .otw-faq-tab-count {
  flex-shrink: 0;
  background: var(--otw-border);
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1;
  min-width: 20px;
  padding: 2px 6px;
  text-align: center;
}

/* ── Category tab icon ───────────────────────────────────────── */
.otw-faq-widget .otw-faq-tab-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.otw-faq-widget .otw-faq-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.otw-faq-widget .otw-faq-cat-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  line-height: 0;
  color: currentColor;
}

.otw-faq-widget .otw-faq-cat-icon svg,
.otw-faq-widget .otw-faq-cat-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.otw-faq-widget .otw-faq-cat-icon--svg svg {
  fill: currentColor;
}

/* ══════════════════════════════════════════════════════════════════════
   PANELS / ACCORDION
══════════════════════════════════════════════════════════════════════ */
.otw-faq-widget .otw-faq-panels {
  min-width: 0;
}
.otw-faq-widget .otw-faq-panel {
  outline: none;
}
.otw-faq-widget .otw-faq-panel[hidden] {
  display: none;
}

/* ── Panel title ───────────────────────────────────────────────── */
.otw-faq-widget .otw-faq-panel-title {
  margin: 0 0 1em;
  font-size: 0.8125em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.55;
}

.otw-faq-widget .otw-faq-accordion {
  margin: 0;
  padding: 0;
  list-style: none;
}

.otw-faq-widget .otw-faq-item {
  border-bottom: 1px solid var(--otw-border);
}

.otw-faq-widget .otw-faq-item:last-child {
  border-bottom: none;
}

/* Question button */
.otw-faq-widget .otw-faq-question {
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  color: currentColor;
  font-weight: 600;
  padding: 0.9rem 0;
  text-align: left;
  transition: opacity var(--otw-trans);
}

.otw-faq-widget .otw-faq-question span {
  flex: 1;
}

.otw-faq-widget .otw-faq-question:hover,
.otw-faq-widget .otw-faq-question:focus-visible {
  opacity: 0.7;
}
.otw-faq-widget .otw-faq-question:active {
  opacity: 0.9;
}

.otw-faq-widget .otw-faq-question[aria-expanded="true"] {
  opacity: 1;
}

.otw-faq-widget .otw-faq-chevron {
  flex-shrink: 0;
  opacity: 0.35;
  color: currentColor;
  transition:
    transform var(--otw-trans),
    opacity var(--otw-trans);
}

.otw-faq-widget .otw-faq-question:hover .otw-faq-chevron,
.otw-faq-widget .otw-faq-question:focus-visible .otw-faq-chevron,
.otw-faq-widget .otw-faq-question[aria-expanded="true"] .otw-faq-chevron {
  opacity: 0.85;
  transform: rotate(-180deg);
}

.otw-faq-widget .otw-faq-answer[hidden] {
  display: none;
}

.otw-faq-widget .otw-faq-answer-body {
  font-size: 0.9375rem;
  line-height: 1.7;
  opacity: 0.75;
  padding: 0 0 1.25rem;
}

.otw-faq-widget .otw-faq-answer-body a {
  color: currentColor;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.otw-faq-widget .otw-faq-answer-body a:hover {
  opacity: 0.7;
}
.otw-faq-widget .otw-faq-answer-body p:last-child {
  margin-bottom: 0;
}

/* ── Empty state ──────────────────────────────────────────────────── */
.otw-faq-widget .otw-faq-empty {
  opacity: 0.5;
  font-size: 0.9rem;
  padding: 1.5rem 0;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   CONTACT FORM
══════════════════════════════════════════════════════════════════════ */
.otw-faq-widget .otw-faq-contact {
  border-top: 1px solid var(--otw-border);
  margin-top: 2rem;
  padding-top: 1.75rem;
}

.otw-faq-widget .otw-faq-contact-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.otw-faq-widget .otw-faq-contact-desc {
  opacity: 0.6;
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

.otw-faq-widget .otw-faq-contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.otw-faq-widget .otw-faq-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.otw-faq-widget .otw-faq-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.otw-faq-widget .otw-faq-form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: inherit;
}

.otw-faq-widget .otw-faq-required {
  color: #c0392b;
  margin-left: 2px;
}

.otw-faq-widget .otw-faq-form-group input,
.otw-faq-widget .otw-faq-form-group textarea {
  background: var(--otw-surface);
  border: 1px solid var(--otw-border);
  border-radius: var(--otw-radius-sm);
  color: inherit;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.55rem 0.75rem;
  transition:
    border-color var(--otw-trans),
    box-shadow var(--otw-trans);
  width: 100%;
}

.otw-faq-widget .otw-faq-form-group input:focus,
.otw-faq-widget .otw-faq-form-group textarea:focus {
  border-color: currentColor;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
  outline: none;
}

.otw-faq-widget .otw-faq-form-group input::placeholder,
.otw-faq-widget .otw-faq-form-group textarea::placeholder {
  opacity: 0.4;
  color: currentColor;
}

.otw-faq-widget .otw-faq-form-group input[aria-invalid="true"],
.otw-faq-widget .otw-faq-form-group textarea[aria-invalid="true"] {
  border-color: #c0392b;
}

.otw-faq-widget .otw-faq-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.otw-faq-widget .otw-faq-form-status {
  font-size: 0.875rem;
  border-radius: var(--otw-radius-sm);
}
.otw-faq-widget .otw-faq-form-status:not(:empty) {
  padding: 0.55rem 0.85rem;
}

.otw-faq-widget .otw-faq-form-status.is-success {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: inherit;
}

.otw-faq-widget .otw-faq-form-status.is-error {
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: #c0392b;
}

/* Submit button — black / white defaults, Elementor overrides via panel */
.otw-faq-widget .otw-faq-submit {
  /* Inherit the full reset above, then add layout + black-white defaults */
  align-self: flex-start;
  background: #000;
  border: 1px solid #000;
  border-radius: var(--otw-radius-sm);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.55rem 1.5rem;
  transition:
    background var(--otw-trans),
    color var(--otw-trans),
    border-color var(--otw-trans),
    box-shadow var(--otw-trans),
    opacity var(--otw-trans);
}

.otw-faq-widget .otw-faq-submit:hover,
.otw-faq-widget .otw-faq-submit:focus-visible {
  background: #222;
  border-color: #222;
  color: #fff;
}

.otw-faq-widget .otw-faq-submit:active {
  background: #444;
  border-color: #444;
}

.otw-faq-widget .otw-faq-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════ */

/* Laptop 1200–1399px */
@media (max-width: 1399px) {
  .otw-faq-widget .otw-faq-layout--with-tabs {
    grid-template-columns: 165px 1fr;
  }
}

/* Tablet 768–1199px */
@media (max-width: 1199px) {
  .otw-faq-widget .otw-faq-layout--with-tabs {
    grid-template-columns: 145px 1fr;
    gap: 1rem;
  }
}

/* Mobile <768px */
@media (max-width: 767px) {
  .otw-faq-widget .otw-faq-layout--with-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
    max-width: 100%;
  }

  .otw-faq-widget .otw-faq-tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    position: static;
    scrollbar-width: thin;
    gap: 4px;
    max-width: 100%;
    overflow-x: auto;
  }

  .otw-faq-widget .otw-faq-panels {
    width: 100%;
  }

  .otw-faq-widget .otw-faq-tab {
    flex-shrink: 1;
    white-space: nowrap;
  }
  .otw-faq-widget .otw-faq-form-row {
    grid-template-columns: 1fr;
  }

  .otw-faq-widget .otw-faq-submit {
    align-self: stretch;
    text-align: center;
    justify-content: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .otw-faq-widget *,
  .otw-faq-widget *::before,
  .otw-faq-widget *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
