/* The phone look (owner, 2 Dec 2026: "can we improve how the site looks on mobile?" - yes to all seven points).
   LOOK ONLY: no text, link, field or step is added or taken away. Loaded on every page (RootDocument), after the
   site's own files; the rules start with "html" so that a page's own file, linked later, does not win over them.
   Nothing here applies above 767 px. */

/* 1. The cookie notice took about a third of a phone's screen: smaller text, less padding, button beside the text. */
@media (max-width: 767px) {
  html .cookiesPolicy { padding: 10px 12px; }
  html .cookiesPolicy[style*="block"] { display: flex !important; align-items: center; gap: 10px; }
  html .cookiesPolicy .whiteButton { order: 2; flex: none; width: auto; }
  html .cookiesPolicy .whiteButton a { display: inline-block; padding: 9px 14px !important; }
  html .cookiesPolicyText { order: 1; flex: 1 1 auto; width: auto; min-width: 0; font-size: 12px; line-height: 15px; }
  html .cookiesPolicy a { font-size: 12px; }
  html .cookiesPolicy .whiteButton a { font-size: 13px; }
}

/* 5. The old header (account, order, form and news pages) was 94 px high on a phone with a 100 px logo: now 64 px,
   like the header of the home and product pages. The content's space under the fixed header follows it. */
@media (max-width: 767px) {
  html #headerSection .headerOtherPages .navbar-toggle { padding: 25px 18px !important; }
  html #headerSection .headerOtherPages .visible-xs.logoCell { padding: 15px 0 0 18px; }
  html #headerSection .headerOtherPages .visible-xs.logoCell img { width: 82px; height: auto; }
  html:has(#headerSection .headerOtherPages) .main-section { margin-top: 64px; }
  /* the account pages had no space of their own: the fixed header lay over the row of account links */
  html:has(#headerSection .headerOtherPages) .b2bV2 { margin-top: 64px; }
}
/* 7. Pages with the new header: it is part of the page, not fixed, so the old 95 px space above the content was an
   empty white band on the home page. */
@media (max-width: 767px) {
  html .olt .main-section { margin-top: 0; }
}

@media (max-width: 600px) {
  /* 6. Order page: a line was some 300 px high (one value per row). Now: the product, then Pcs/Box - Price - Total
     in one row, then the quantity with the remove button beside it. Only lines of that table (six cells, the last
     one the remove button). */
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; padding: 10px 0 8px; }
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td.item { grid-column: 1 / -1; grid-row: 1; padding-bottom: 4px; }
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td:nth-child(2),
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td:nth-child(4),
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td:nth-child(5) { grid-row: 2; flex-direction: column; justify-content: flex-start; gap: 1px; padding: 4px 14px; text-align: start; }
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td:nth-child(2) { grid-column: 1; align-items: flex-start; }
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td:nth-child(4) { grid-column: 2; align-items: flex-start; }
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td:nth-child(5) { grid-column: 3; align-items: flex-end; text-align: end; }
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td:nth-child(3) { grid-row: 3; grid-column: 1 / 3; align-items: center; justify-content: flex-start; padding: 4px 14px; }
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td.o-act { grid-row: 3; grid-column: 3; padding: 4px 8px; }
  html .b2bV2 .tbl.stack tr:has(> td.o-act:nth-child(6)) > td.o-act .icon-btn { width: 40px; height: 40px; }

  /* 6. Items to be delivered (by order): the open quantity and "View Product" share one row. Only lines of three
     cells inside an order's box. */
  html .b2bV2 .grp .tbl.stack tr:has(> td.item:first-child + td + td:last-child) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 8px 0; }
  html .b2bV2 .grp .tbl.stack tr:has(> td.item:first-child + td + td:last-child) > td.item { grid-column: 1 / -1; padding-bottom: 4px; }
  html .b2bV2 .grp .tbl.stack tr:has(> td.item:first-child + td + td:last-child) > td:nth-child(2) { justify-content: flex-start; align-items: baseline; gap: 8px; text-align: start; }

  /* 2. My Turnover: the row of years ran out of the screen to the right. On a phone the years stand under each
     other, each with its amount beside it. The chart keeps its size and scrolls sideways inside its box. */
  html .b2bV2 #turnoverTable { display: flex; width: 100%; }
  html .b2bV2 #turnoverTable thead, html .b2bV2 #turnoverTable tbody { display: block; flex: 1 1 50%; }
  html .b2bV2 #turnoverTable tr { display: flex; flex-direction: column; }
  html .b2bV2 #turnoverTable th, html .b2bV2 #turnoverTable td { display: block; height: 44px; line-height: 20px; padding: 12px 14px; border-bottom: 1px solid var(--line); box-sizing: border-box; }
  html .b2bV2 #turnoverTable th { text-align: start; }
  html .b2bV2 #turnoverTable td { text-align: end; }
  html .b2bV2 #turnoverTable th:last-child, html .b2bV2 #turnoverTable td:last-child { border-bottom: 0; }

  /* 3. API manual: field names in the tables were 11 px. */
  html .b2bV2 .api-manual code { font-size: 1em; }
  html .b2bV2 .api-manual table.fields { font-size: 13px; }
  html .b2bV2 .api-manual pre.code code { font-size: inherit; }

  /* 4. Small things a finger must hit: the remove button of an order in "My orders", the colour dots of a product
     card (the dot looks the same; the area around it counts as the dot). */
  html .b2bV2 a.icon-btn.deleteOrder { min-width: 40px; min-height: 40px; }
  html [data-theme] .olt-cat .sw { position: relative; }
  html [data-theme] .olt-cat .sw::after { content: ""; position: absolute; top: -6px; right: -6px; bottom: -6px; left: -6px; inset: -6px; }
}
/* 5. the opened phone menu of the old header: its links start where the logo starts (were 4 px from the edge) */
@media (max-width: 767px) {
  html #headerSection .headerOtherPages .navbar-nav > li.pageTransition > a { padding-left: 18px; }
}
