/* responsive.css — phone layout for the shared page frame (top.php,
   left_column.php, right_column.php, footer.php). Selectors target only the
   frame's own tables via child combinators, so nested data/grid tables are
   left untouched. Desktop (>680px) is not affected. */
@media (max-width: 680px) {
  center { display: block; width: 100%; }
  img { max-width: 100%; height: auto; }

  /* Header frame: logo, flags, tabs menu */
  table.header,
  table.header table { width: 100% !important; max-width: 100% !important; }
  table.header > tbody > tr > td,
  table.header table > tbody > tr > td { height: auto !important; }
  table.header td[width="490"], table.header td[width="410"] { display: block; width: 100% !important; text-align: left !important; }
  table.header #call table { width: 100% !important; }
  #yourtabsmenu ul { float: none !important; width: auto !important; }

  /* Main frame: <center> > <table width=960|900> */
  center > table[width="960"]:not(.header),
  center > table[width="900"] { width: 100% !important; max-width: 100% !important; }
  center > table[width="960"]:not(.header) > tbody > tr > td,
  center > table[width="900"] > tbody > tr > td {
    display: block; width: 100% !important; height: auto !important; box-sizing: border-box;
  }
  /* Side columns hold only ad placeholders */
  center > table[width="960"] > tbody > tr > td:has(> table[width="150"]),
  center > table[width="960"] > tbody > tr > td:has(> table[width="200"]) { display: none !important; }
  td#main_text { padding: 8px 12px !important; }
  td#main_text { overflow-wrap: anywhere; }
  td#main_text div[style*="float"][style*="width"] { float: none !important; width: auto !important; max-width: 100% !important; }
  td#main_text table[width] { width: 100% !important; max-width: 100% !important; }
  table[width]:not([width$="%"]) { max-width: 100% !important; }
  table.sortable { width: 100% !important; max-width: 100% !important; }
  #controls { width: auto !important; height: auto !important; overflow: hidden; }
  #perpage { width: auto !important; }
  td#main_text input[type=text], td#main_text input[type=email], td#main_text input[type=tel],
  td#main_text input[type=password], td#main_text input[type=number],
  td#main_text select, td#main_text textarea { width: 100%; }
  iframe { max-width: 100% !important; }

  /* supplier_calendar.php: 7-day grid scrolls inside its own box */
  .cal-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; grid-template-columns: repeat(7, minmax(64px, 1fr)); width: 0; min-width: 100%; }

  /* Booking boxes with inline px widths (general payment pages) */
  table.widgetBox div[style*="float"], table.widgetBox div[style*="width"] {
    float: none !important; width: auto !important; max-width: 100% !important; margin-bottom: 4px;
  }
  table.widgetBox td { height: auto !important; }

  /* Footer frame wherever it sits in the page */
  table:has(> tbody > tr > td#footer) { width: 100% !important; max-width: 100% !important; }
  td#footer { display: block; width: 100% !important; box-sizing: border-box; }

  /* Forms */
  table.loginBox { width: 100% !important; max-width: 100% !important; }
  input[type=text], input[type=password], input[type=email], input[type=tel],
  input[type=number], select, textarea {
    max-width: 100%; box-sizing: border-box; min-height: 44px; font-size: 16px;
  }
  textarea { width: 100%; }
  .gw-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  input[type=submit], input[type=button], button { min-height: 44px; font-size: 16px; }
}
