/*
 * Carpatian p15 design: base layer (owned by the base/footer design agent). Loaded after Journal, the Journal
 * customCSS and cr_visual.css by vqmod/xml/cr_p15_design.xml, right after cr_design_tokens.css.
 * Covers: page-wide guards (no horizontal scroll, no text under 12px), typography and page/section titles, buttons,
 * inputs, breadcrumbs, pagination, alerts and notifications, the "back to top" button, information pages and 404,
 * floating phone/WhatsApp buttons (style only, markup by p17) and the cookie banner/FAB (style only, markup by p06).
 * Colours and fonts only through the tokens. "html body" prefixes beat Journal's generated selectors by order and
 * specificity; !important only where Journal itself uses it (inline styles or its own !important rules).
 */

/* ---------------------------------------------------------------------------------------------
 * 1. Page-wide guards
 *    No horizontal scroll at any width. The real cause of the 447px page on phones (old shop) was the content rows:
 *    Journal gives .site-wrapper > .container > .row a negative margin of half the column gap on a container
 *    without padding, so on screens narrower than container + gap the row ran past the screen edge. The rows get
 *    0 margin up to 1320px; overflow-x: clip stays as a last guard (it does not break position: sticky).
 * --------------------------------------------------------------------------------------------- */
html,
body {
  overflow-x: clip;
}

@media (max-width: 1320px) {
  html .site-wrapper > .container > .row.row,
  html #content > .row.row {
    margin-left: 0;
    margin-right: 0;
  }
}

html body img,
html body iframe,
html body video {
  max-width: 100%;
}

html body {
  font-family: var(--cr-font-body);
  color: var(--cr-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* small text guard: nothing under 12px (product labels, newsletter consent, filter reset, bottom menu) */
html body .product-labels span.product-label strong {
  font-size: 12px;
}

html body .module-newsletter .newsletter-form .input-group + .checkbox label,
html body .module-newsletter .newsletter-form .input-group + .checkbox label b {
  font-size: 13px !important; /* Journal: .module-newsletter-67 .input-group + .checkbox label { ... !important } */
  line-height: 1.45;
}

html body .reset-filter.btn,
html body .reset-filter.btn:visited {
  font-size: 12px !important;
}

html body .bottom-menu > ul > li .links-text {
  font-size: 12px;
}

/* keyboard focus: visible everywhere, never on mouse click */
html body a:focus-visible,
html body button:focus-visible,
html body .btn:focus-visible,
html body input:focus-visible,
html body select:focus-visible,
html body textarea:focus-visible,
html body [tabindex]:focus-visible {
  outline: 2px solid var(--cr-focus);
  outline-offset: 2px;
  box-shadow: none;
}

html body ::selection {
  background: var(--cr-blue);
  color: #fff;
}

/* ---------------------------------------------------------------------------------------------
 * 2. Typography: Roboto Condensed 700 for titles, Titillium Web 400/600/700 for text (real weights, see
 *    vqmod/xml/cr_p15_base_fonts.xml). Page titles condensed uppercase, Leo-like scale.
 * --------------------------------------------------------------------------------------------- */
html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body .title,
html body .page-title {
  font-family: var(--cr-font-display);
  letter-spacing: .01em;
}

html body h1.page-title,
html body .title.page-title {
  margin-bottom: 24px;
  color: var(--cr-text-strong);
  font-family: var(--cr-font-display);
  font-size: clamp(26px, 1.6rem + .8vw, 36px);
  font-weight: 700;
  line-height: 1.12;
  text-transform: uppercase;
}

html body h1.page-title::after,
html body .title.page-title::after {
  width: 56px;
  height: 3px;
  margin-top: 14px;
  background-color: var(--cr-accent);
}

/* content module titles (sidebars, side products, related): condensed uppercase, red rule under them */
html body #content .module-title,
html body #column-left .module-title,
html body #column-right .module-title {
  color: var(--cr-text-strong);
  font-family: var(--cr-font-display);
  font-weight: 700;
  text-transform: uppercase;
}

html body strong,
html body b {
  font-weight: 700;
}

/* ---------------------------------------------------------------------------------------------
 * 3. Buttons. Primary = action red (Journal "Action" / "Background Accent" variables), secondary = dark blue
 *    (Journal .btn), outline = .btn-light / .btn-default / .cr-btn-outline. 44px tap height, 3px radius.
 * --------------------------------------------------------------------------------------------- */
html body .btn {
  min-height: var(--cr-tap);
  border-radius: var(--cr-radius-sm);
  font-family: var(--cr-font-body);
  font-weight: 700;
  letter-spacing: .03em;
  transition: background-color var(--cr-fast) ease, border-color var(--cr-fast) ease, color var(--cr-fast) ease,
    box-shadow var(--cr-fast) ease, transform var(--cr-fast) ease;
}

html body .btn:active {
  transform: translateY(1px);
}

html body .btn-primary,
html body .btn-primary:visited,
html body #button-cart,
html body .cr-btn-primary {
  border-color: var(--cr-accent);
  background-color: var(--cr-accent);
  color: #fff;
}

html body .btn-primary:hover,
html body .btn-primary:focus-visible,
html body #button-cart:hover,
html body #button-cart:focus-visible,
html body .cr-btn-primary:hover {
  border-color: var(--cr-accent-hover);
  background-color: var(--cr-accent-hover);
  color: #fff;
  box-shadow: 0 6px 14px rgba(223, 31, 44, .22);
}

html body .btn-light,
html body .btn-default,
html body .cr-btn-outline {
  border: 1px solid var(--cr-line-strong);
  background-color: #fff;
  color: var(--cr-text-strong);
}

html body .btn-light:hover,
html body .btn-default:hover,
html body .cr-btn-outline:hover {
  border-color: var(--cr-text-strong);
  background-color: var(--cr-text-strong);
  color: #fff;
}

html body .buttons {
  gap: 10px;
}

/* ---------------------------------------------------------------------------------------------
 * 4. Form fields: 44px, 3px radius, clear border, blue focus ring
 * --------------------------------------------------------------------------------------------- */
html body .form-control,
html body input[type="text"],
html body input[type="email"],
html body input[type="tel"],
html body input[type="password"],
html body input[type="search"],
html body input[type="number"],
html body select.form-control,
html body textarea {
  border-color: var(--cr-line-strong);
  border-radius: var(--cr-radius-sm);
  font-family: var(--cr-font-body);
  transition: border-color var(--cr-fast) ease, box-shadow var(--cr-fast) ease;
}

html body input.form-control,
html body select.form-control {
  min-height: var(--cr-tap);
}

html body .form-control:focus,
html body input:focus,
html body select:focus,
html body textarea:focus {
  border-color: var(--cr-blue);
  box-shadow: 0 0 0 3px rgba(15, 86, 132, .18);
  outline: none;
}

html body .form-control::placeholder {
  color: var(--cr-text-muted);
  opacity: 1;
}

html body .has-error .form-control,
html body .text-danger {
  border-color: var(--cr-accent);
}

html body .text-danger {
  color: var(--cr-accent-hover);
  font-size: 13px;
}

/* ---------------------------------------------------------------------------------------------
 * 5. Breadcrumbs: white bar, muted current page, blue links, chevron separators
 * --------------------------------------------------------------------------------------------- */
html body .breadcrumbs {
  border-bottom: 1px solid var(--cr-line);
  background: var(--cr-bg);
}

html body .breadcrumb {
  font-size: 14px;
}

html body .breadcrumb > li > a {
  color: var(--cr-link);
  text-decoration: none;
}

html body .breadcrumb > li > a:hover {
  color: var(--cr-link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

html body .breadcrumb > li:last-child > a {
  color: var(--cr-text-muted);
}

/* ---------------------------------------------------------------------------------------------
 * 6. Pagination: 40px squares (44px on touch), current page in action red
 * --------------------------------------------------------------------------------------------- */
html body .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

html body .pagination > li > a,
html body .pagination > li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius-sm);
  background: #fff;
  color: var(--cr-text-strong);
  font-weight: 600;
}

html body .pagination > li > a:hover {
  border-color: var(--cr-blue);
  background: var(--cr-blue);
  color: #fff;
}

html body .pagination > li.active > span,
html body .pagination > li.active > a {
  border-color: var(--cr-accent);
  background: var(--cr-accent);
  color: #fff;
}

html.touchevents body .pagination > li > a,
html.touchevents body .pagination > li > span {
  min-width: var(--cr-tap);
  height: var(--cr-tap);
}

/* ---------------------------------------------------------------------------------------------
 * 7. Alerts and Journal notifications (added to cart / wishlist / compare)
 * --------------------------------------------------------------------------------------------- */
html body .alert {
  border-width: 0 0 0 4px;
  border-radius: var(--cr-radius-sm);
  font-size: 15px;
}

html body .alert-success {
  border-color: var(--cr-success);
  background: rgba(30, 125, 61, .08);
  color: #17532a;
}

html body .alert-danger,
html body .alert-warning {
  border-color: var(--cr-accent);
  background: var(--cr-accent-soft);
  color: #8a1019;
}

html body .alert-info {
  border-color: var(--cr-blue);
  background: rgba(15, 86, 132, .07);
  color: var(--cr-blue-hover);
}

html body .alert a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

html body .notification-wrapper .notification {
  border: 0;
  border-top: 3px solid var(--cr-success);
  border-radius: var(--cr-radius);
  background: #fff;
  box-shadow: var(--cr-shadow-lg);
  color: var(--cr-text);
}

html body .notification-wrapper .notification .notification-title {
  font-family: var(--cr-font-display);
  font-weight: 700;
  text-transform: uppercase;
}

html body .notification-wrapper .notification-buttons .btn {
  min-height: 40px;
}

/* ---------------------------------------------------------------------------------------------
 * 8. Back to top (Journal .scroll-top, switched on in the skin; colours from the skin: Dark Blue, hover Accent).
 *    Desktop: 44px square stacked above the floating phone/WhatsApp buttons (p17, bottom right).
 *    Phones: on the same bottom line, left of the two floating buttons, so the copyright line stays readable.
 * --------------------------------------------------------------------------------------------- */
html body .scroll-top {
  --scroll-top-side-offset: 24px;
  --scroll-top-bottom-offset: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--cr-tap);
  height: var(--cr-tap);
  padding: 0;
  border-radius: var(--cr-radius-sm);
  box-shadow: var(--cr-shadow);
}

@media (max-width: 600px) {
  html body .scroll-top {
    --scroll-top-side-offset: 130px;
    --scroll-top-bottom-offset: 16px;
  }
}

/* ---------------------------------------------------------------------------------------------
 * 9. Floating phone / WhatsApp / QR buttons (markup and logic: p17, cr_catalog.css): brand colours, white ring,
 *    WhatsApp green dark enough for the white icon (3.5:1)
 * --------------------------------------------------------------------------------------------- */
html body .cr-float .cr-float__btn {
  border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(14, 17, 20, .28);
}

html body .cr-float .cr-float__btn--phone {
  background: var(--cr-accent);
}

html body .cr-float .cr-float__btn--phone:hover {
  background: var(--cr-accent-hover);
}

html body .cr-float .cr-float__btn--whatsapp {
  background: var(--cr-whatsapp);
}

html body .cr-float .cr-float__btn--qr {
  background: var(--cr-dark);
}

html body .cr-float .cr-float__btn:focus-visible {
  outline: 2px solid var(--cr-focus);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  html body .cr-float .cr-float__btn {
    width: 48px;
    height: 48px;
  }
}

/* ---------------------------------------------------------------------------------------------
 * 10. Cookie banner, preferences modal and round preferences button (markup: p06, cr_consent.css): same radii,
 *     fonts and reds as the rest of the shop; the FAB is graphite with a red ring so it does not compete with
 *     the red phone button
 * --------------------------------------------------------------------------------------------- */
html body .cr-cookie-banner .cr-cookie-banner__card,
html body .cr-cookie-modal .cr-cookie-modal__card {
  border-radius: var(--cr-radius);
}

html body .cr-cookie-banner .cr-cookie-banner__card {
  background: var(--cr-dark-deep);
}

html body .cr-cookie-banner .cr-cookie-banner__title,
html body .cr-cookie-modal .cr-cookie-modal__title {
  font-family: var(--cr-font-display);
  letter-spacing: .02em;
  text-transform: uppercase;
}

html body .cr-cookie-banner .cr-cookie-btn,
html body .cr-cookie-modal .cr-cookie-btn {
  min-height: var(--cr-tap);
  border-radius: var(--cr-radius-sm);
  font-family: var(--cr-font-body);
  font-weight: 700;
  letter-spacing: .02em;
}

html body .cr-cookie-banner .cr-cookie-btn--primary,
html body .cr-cookie-modal .cr-cookie-btn--primary {
  border-color: var(--cr-accent);
  background: var(--cr-accent);
  color: #fff;
}

html body .cr-cookie-banner .cr-cookie-btn--primary:hover,
html body .cr-cookie-modal .cr-cookie-btn--primary:hover {
  border-color: var(--cr-accent-hover);
  background: var(--cr-accent-hover);
}

html body .cr-cookie-banner .cr-cookie-btn:focus-visible,
html body .cr-cookie-fab:focus-visible {
  outline: 2px solid var(--cr-focus-on-dark);
  outline-offset: 2px;
}

html body .cr-cookie-fab {
  border: 2px solid var(--cr-accent);
  background: var(--cr-dark);
  color: #fff;
}

html body .cr-cookie-fab:hover {
  border-color: #fff;
  background: var(--cr-accent);
  color: #fff;
}

/* ---------------------------------------------------------------------------------------------
 * 11. Information pages (terms, privacy, delivery...) and 404: readable measure, condensed headings, real links
 * --------------------------------------------------------------------------------------------- */
html.route-information-information body #content,
html.route-error-not_found body #content {
  padding-top: 32px;
  padding-bottom: 56px;
}

html.route-information-information body #content > .content,
html.route-information-information body #content > h1.page-title {
  max-width: 880px;
}

html.route-information-information body #content > .content {
  font-size: 16px;
  line-height: 1.7;
}

html.route-information-information body #content > .content h2,
html.route-information-information body #content > .content h3,
html.route-information-information body #content > .content h4 {
  margin: 1.8em 0 .55em;
  color: var(--cr-text-strong);
  font-family: var(--cr-font-display);
  font-weight: 700;
  line-height: 1.2;
}

html.route-information-information body #content > .content h2 {
  font-size: clamp(21px, 1.1rem + .6vw, 26px);
}

html.route-information-information body #content > .content h3 {
  font-size: clamp(18px, 1rem + .3vw, 21px);
}

html.route-information-information body #content > .content h4 {
  font-size: 18px;
}

html.route-information-information body #content > .content > :first-child {
  margin-top: 0;
}

html.route-information-information body #content > .content p,
html.route-information-information body #content > .content li {
  margin-bottom: .8em;
}

html.route-information-information body #content > .content ul,
html.route-information-information body #content > .content ol {
  padding-left: 1.3em;
}

html.route-information-information body #content > .content a {
  color: var(--cr-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

html.route-information-information body #content > .content a:hover {
  color: var(--cr-link-hover);
}

html.route-information-information body #content > .content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* 404: centred message with the big code, one red CTA back to the shop */
html.route-error-not_found body #content {
  text-align: center;
}

html.route-error-not_found body #content > h1.page-title {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

html.route-error-not_found body #content > h1.page-title::before {
  content: "404";
  display: block;
  margin-bottom: 10px;
  color: var(--cr-accent);
  font-size: clamp(72px, 10vw, 120px);
  line-height: .9;
  letter-spacing: .02em;
}

html.route-error-not_found body #content > h1.page-title::after {
  margin-right: auto;
  margin-left: auto;
}

html.route-error-not_found body #content > p {
  max-width: 560px;
  margin: 0 auto 28px;
  color: var(--cr-text-muted);
  font-size: 17px;
}

html.route-error-not_found body #content .buttons {
  justify-content: center;
}

html.route-error-not_found body #content .buttons > div {
  flex: 0 0 auto;
  float: none;
  width: auto;
}

html.route-error-not_found body #content .buttons .btn {
  display: inline-flex;
  width: auto;
  min-width: 220px;
  padding-right: 32px;
  padding-left: 32px;
  border-color: var(--cr-accent);
  background-color: var(--cr-accent);
  color: #fff;
}

html.route-error-not_found body #content .buttons .btn:hover {
  border-color: var(--cr-accent-hover);
  background-color: var(--cr-accent-hover);
}

/* ---------------------------------------------------------------------------------------------
 * 12. Reduced motion
 * --------------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html body .btn,
  html body .form-control,
  html body .scroll-top,
  html body .cr-float .cr-float__btn {
    transition: none;
  }

  html body .btn:active {
    transform: none;
  }
}
