.iron-search-root { font-family: Arial, Helvetica, sans-serif; max-width: none; width: 100%; box-sizing: border-box; margin: 36px auto; direction: rtl; }
.iron-search-root .iron-logo { text-align:center; margin-bottom:18px; }
.iron-search-root .iron-logo h1 { font-weight:300; font-size:48px; margin:0; font-family: 'Yekan Bakh FaNum', sans-serif; }
.iron-search-wrapper { display:flex; justify-content:center; margin-bottom:12px; }
.iron-search-box { width:100%; max-width:720px; position:relative; }
/* For RTL we add left padding to make room for the button on the left */
.iron-search-box input[type="search"] { width:100%; padding:14px 18px 14px 48px; border-radius:24px; border:1px solid #dfe1e5; box-shadow:none; font-size:16px; outline:none; text-align: right; font-family: iransans, sans-serif; }
.iron-search-box button { position:absolute; left:6px; top:6px; bottom:6px; border-radius:20px; padding:6px 14px; border:none; background:#DBF0DD; color:#000000; cursor:pointer; font-family: 'Yekan Bakh FaNum', sans-serif; transition: background-color 0.18s ease, color 0.12s ease; }
.iron-search-box button:hover,
.iron-search-box button:focus,
.iron-search-box button:active {
  background-color: #235347;
  color: #ffffff;
}
.iron-search-box input[type="search"]::placeholder { font-family: iransans, sans-serif; }
.iron-hits-info { text-align:center; color:#5f6368; margin-bottom:12px; font-family: iransans, sans-serif; }
.iron-results { font-family: iransans, sans-serif; border: none; border-radius: 10px; overflow: hidden; width: 100%; box-sizing: border-box; padding: 0 !important; }
.iron-results table { width:100%; border-collapse:collapse; border-spacing:0; font-size:14px; border: none; border-radius:10px; overflow:hidden; table-layout: fixed; margin: 0; }
.iron-results table th, .iron-results table td { padding:10px 8px; text-align:right; vertical-align:top; }
/* use left/right and bottom borders for cells so the container border remains the outer frame */
.iron-results table th, .iron-results table td { border: none; }
.iron-results thead th { background: #235347; color: #ffffff; }
.iron-results tbody tr { background: #ffffff; color: #000000; margin: 0; }
.iron-results tbody tr:nth-child(even) { background-color: #ffffff; }
.iron-results table { border-radius:10px; }

/* remove bottom border on last row's cells so container border shows cleanly */
.iron-results tbody tr:last-child td { border-bottom: none; }
.iron-results th { font-weight:600; position:sticky; top:0; z-index:2; }
/* make header text not wrap so header width determines column min-width */
.iron-results th { white-space: nowrap; }
/* center specific columns (increase selector specificity so it overrides the generic right-align) */
.iron-results th.col-telephone, .iron-results td.col-telephone,
.iron-results th.col-city_code, .iron-results td.col-city_code,
.iron-results th.col-range, .iron-results td.col-range {
  text-align: center;
}

/* ensure the table layout uses header content to size columns */
.iron-results table { table-layout: auto; width:100%; }
@media (max-width:720px) {
  .iron-results table, .iron-results thead, .iron-results tbody, .iron-results th, .iron-results td, .iron-results tr { display:block; }
  /* remove the table's outer border on mobile so only per-row borders (cards) are visible */
  .iron-results table { border: none; }
    .iron-results th { display:none; }

    /* Each result becomes a card */
    .iron-results tbody tr { display:block; margin-bottom:20px; border: none; border-radius:10px; overflow:hidden; background:#ffffff; }
    /* Mobile: ensure table fills width and use margins between cards (no padding on container) */
    .iron-search-root .iron-results table { width: 100% !important; min-width: 0 !important; table-layout: fixed !important; }
    .iron-search-root .iron-results td,
    .iron-search-root .iron-results th {
      display: block !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding: 0 !important; /* no padding as requested */
      white-space: normal !important;
      word-break: break-word !important;
      overflow-wrap: anywhere !important;
    }
    /* Each card should have a 12px gap to the next item and to container edges (use margins on cards) */
    .iron-results tbody tr { margin: 12px 0 !important; }
    .iron-results tbody tr:first-child { margin-top: 12px !important; }
    .iron-results tbody tr:last-child { margin-bottom: 12px !important; }

    /* Ensure no inner padding inside the card (we use margins between cards instead) */
    .iron-results td { border:none; padding: 0 !important; }

    /* odd rows background intentionally handled by instance-scoped rules to avoid conflicts */

/* remove inner borders for the header cells so header appears borderless */
.iron-results table thead th { border: none; }

    .iron-results td[data-label]:before { content: attr(data-label) ": "; font-weight:600; display:inline-block; width:110px; }

    /* On mobile, ensure these columns are right-aligned (undo desktop centering) */
    .iron-results td.col-telephone,
    .iron-results td.col-city_code,
    .iron-results td.col-range {
      text-align: right;
    }
}

    /* hover color for result rows */
    .iron-results tbody tr:hover { background-color: #DBF0DD40; }

    /* Ensure the search root and table fill the shortcode/widget container (override Elementor/theme rules) */
    .elementor-widget-shortcode .iron-search-root,
    .elementor-widget-shortcode .iron-search-root .iron-results,
    .elementor-widget-shortcode .iron-search-root .iron-results table {
      width: 100% !important;
      max-width: none !important;
      box-sizing: border-box !important;
    }

    /* Allow header cells to wrap if needed so table can shrink/expand to container width */
    .elementor-widget-shortcode .iron-search-root .iron-results th {
      white-space: normal !important;
    }

    /* Force table to fill available container width and use fixed layout so columns distribute evenly */
    .elementor-widget-shortcode .iron-search-root .iron-results table {
      width: 100% !important;
      min-width: 100% !important;
      table-layout: fixed !important;
    }

    /* Ensure table cells wrap/break long content rather than expanding container */
    .elementor-widget-shortcode .iron-search-root .iron-results table th,
    .elementor-widget-shortcode .iron-search-root .iron-results table td {
      white-space: normal !important;
      word-break: break-word !important;
      overflow-wrap: anywhere !important;
    }

    /* removed container-level margin to avoid double spacing inside page layout */

    /* Strong instance-specific overrides: target roots that have an instance class
       (added by PHP) to avoid theme/widget collisions and ensure server/client parity */
    .iron-search-root[class*="iron-search-instance-"] .iron-results,
    .iron-search-root[class*="iron-search-instance-"] .iron-results table {
      width: 100% !important;
      box-sizing: border-box !important;
      min-width: 0 !important;
    }

    /* Desktop alternating rows for instance-scoped tables: restore the desktop
       alternating background (odd rows) while keeping instance scoping to avoid
       colliding with theme/page-builder styles. */
    .iron-search-root[class*="iron-search-instance-"] .iron-results tbody > tr:nth-child(odd) {
      background-color: #DBF0DD40 !important;
    }
    .iron-search-root[class*="iron-search-instance-"] .iron-results tbody > tr:nth-child(even) {
      background-color: #ffffff !important;
    }

    /* Clear any unexpected/third-party backgrounds applied to tbody rows/cells
       so plugin instance-scoped rules can control the visuals. This removes
       theme/page-builder backgrounds such as `hsla(0, 0%, 50%, .071)`.
    */
    .iron-search-root[class*="iron-search-instance-"] .iron-results table tbody tr,
    .iron-search-root[class*="iron-search-instance-"] .iron-results table tbody td {
      background-color: transparent !important;
    }

    @media (max-width:720px) {
      /* Instance-scoped: ensure table and rows become blocks and cards show internal padding */
      .iron-search-root[class*="iron-search-instance-"] .iron-results table,
      .iron-search-root[class*="iron-search-instance-"] .iron-results tbody,
      .iron-search-root[class*="iron-search-instance-"] .iron-results tbody > tr {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
      }

      /* ensure 12px horizontal gap by padding the results container */
      .iron-search-root[class*="iron-search-instance-"] .iron-results {
        padding: 0 12px !important;
        box-sizing: border-box !important;
      }

      /* Each row becomes a card with internal padding on all four sides */
      .iron-search-root[class*="iron-search-instance-"] .iron-results tbody > tr {
        display: block !important;
        margin: 12px 0 !important;
        padding: 10px !important; /* internal padding for each card */
        border: 1px solid #c8d5ca !important;
        border-radius: 10px !important;
        background-clip: padding-box !important;
        background-color: #ffffff !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
      }

      /* Alternate card backgrounds: override the odd cards to the requested color */
      .iron-search-root[class*="iron-search-instance-"] .iron-results tbody > tr:nth-child(odd) {
        background-color: #eef2ef !important;
      }
      .iron-search-root[class*="iron-search-instance-"] .iron-results tbody > tr:nth-child(even) {
        background-color: #ffffff !important;
      }

      .iron-search-root[class*="iron-search-instance-"] .iron-results tbody > tr:first-child { margin-top: 12px !important; }
      .iron-search-root[class*="iron-search-instance-"] .iron-results tbody > tr:last-child { margin-bottom: 12px !important; }

      /* cells become stacked within the card and do not add extra outer spacing
         each stacked cell should have a 30px height for consistent row spacing */
      .iron-search-root[class*="iron-search-instance-"] .iron-results td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        height: 30px !important;
        line-height: 30px !important;
        overflow: hidden !important;
      }

      /* hide header cells on mobile for a cleaner card view */
      .iron-search-root[class*="iron-search-instance-"] .iron-results th {
        display: none !important;
      }
    }

/* Load-more button style matching the search button */
.iron-load-more {
  display:inline-block;
  border-radius:10px;
  padding:6px 14px;
  border:none;
  background:#DBF0DD;
  color:#000000;
  cursor:pointer;
  font-family: 'Yekan Bakh FaNum', sans-serif;
  transition: background-color 0.18s ease, color 0.12s ease;
}
.iron-load-more:hover, .iron-load-more:focus, .iron-load-more:active {
  background-color: #235347;
  color: #ffffff;
}
.iron-search-root button,
.iron-load-more {
  border-radius: 10px !important;
}

/* Place Next/Prev buttons side-by-side and center them */
.iron-load-more-wrap {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 14px 0 6px !important;
}

.iron-load-more {
  display: inline-block;
}

/* Ensure the search box button keeps the previous 20px radius despite the general override */
.iron-search-root .iron-search-box button {
  border-radius: 20px !important;
}
.highlight { background: linear-gradient(90deg, rgba(255,235,59,0.35), rgba(255,235,59,0.15)); padding:1px 3px; border-radius:2px; }
.iron-noresults { display:none; text-align:center; color:#777; margin-top:16px; }

/* Instance-specific mobile override for office1: prefer 370px but never overflow viewport */
@media (max-width:480px) {
  #iron-search-results-office1 .iron-results tr {
    /* Use min() so we don't force a width larger than the viewport/container */
    width: min(370px, 100%) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Desktop: light 1px border around the results table */
@media (min-width:721px) {
  /* add border on the container to ensure the thin/light border is visible */
  .iron-search-root .iron-results {
    border: 1px solid #f6fbf7 !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    background-clip: padding-box !important;
  }

  /* keep table layout but allow the container border to show */
  .iron-search-root .iron-results table {
    border: none !important;
    border-radius: 0 !important;
  }
}
