/*
 * The site's own CSS, on top of the theme's.
 *
 * Loaded last in <head> (see app/_site/site-head.tsx), after all of the theme's CSS, so these
 * rules win over the theme's. It is a plain file in public/ rather than a CSS import: Next puts
 * imported CSS at the top of <head>, where the theme's CSS would override it.
 */

html,
body {
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
}

/* Menu links jump to sections of the page; stop a little lower so the sticky header does not cover the heading. */
html {
  scroll-padding-top: 90px;
}

/* No arrow beside menu items, even ones that open a dropdown. ("body" makes this win over the theme's own rule.) */
body header.l-header .top-bar-container .top-bar .top-bar-right .menu li.has-dropdown > a::after {
  content: none;
}

/*
 * The pointofsale.lk logo: the till icon is about twice the height of the name, so it gets a little
 * more height than the theme's 40px for the name to read. On phones it stays within the screen.
 */
body header.l-header .top-bar-container .top-bar .top-bar-left .logo-wrapper .menu-text a img {
  height: 48px;
  max-height: 48px;
}
body header.l-header .top-bar-container .site-title-bar .title-bar-title a img {
  max-height: 40px;
  max-width: calc(100vw - 120px);
  width: auto;
  height: auto;
}

/* ======================================================================== Layout fixes */

/* Phones: the theme mixes floated columns (vc_col-xs-*) with plain ones in the same section. A plain
   column after floated ones stretches over the whole section and, although invisible, catches taps
   meant for the buttons under it ("See pricing", "Get Started"...). Floating every column full width
   stacks them as intended. Columns with their own phone width (vc_col-xs-6, the home counters) keep it. */
@media (max-width: 767px) {
  .vc_row > .wpb_column.vc_column_container:not([class*="vc_col-xs-"]) {
    float: left;
    width: 100%;
  }
}

/* "Questions shop owners ask" (home): the devices picture behind it is pinned to the left edge at full
   size, so on screens under ~1440px it ran into the questions. It now scales with the screen and stays
   in the left half; once the questions take the full width (tablets, phones) it is left out. */
@media (min-width: 992px) {
  body.home .vc_custom_1549389375664 {
    background-size: min(45vw, 864px) auto !important;
  }
}
@media (max-width: 991px) {
  body.home .vc_custom_1549389375664 {
    background-image: none !important;
  }
}

/* "Your till in your pocket" (home): keep each button on one line in its narrow column (~1280px). */
body.home .vc_custom_1550244924984 .wd-btn {
  white-space: nowrap;
}

/* "How it works" (home): the ring grew to the full column width on tablets, far larger than the screen.
   It keeps its desktop size at most, centred. */
.percentage-circle .single-chart {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Home page, wide screens (1300px and up): the theme pins the two phones of "Your till in your pocket"
   so they hang about 117px into the next section. Give "Latest Updates" room so its heading stays clear.
   Narrower screens stack the phones in the normal flow and already leave enough space. */
@media (min-width: 81.25em) {
  body.home #news {
    padding-top: 190px;
  }
}

/* ======================================================================== Fonts */

/* Text shows straight away in a fallback font while Poppins loads, instead of staying invisible.
   These replace the theme's own declarations of the same files (later rules win). */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 300; font-display: swap; src: url(/assets/fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLDz8Z1xlEA.ttf) format("truetype"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts.gstatic.com/s/poppins/v24/pxiEyp8kv8JHgFVrJJfedw.ttf) format("truetype"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLGT9Z1xlEA.ttf) format("truetype"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLEj6Z1xlEA.ttf) format("truetype"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLCz7Z1xlEA.ttf) format("truetype"); }

/* ======================================================================== Motion */

:root {
  /* Quick to start, long soft landing: movement that feels light rather than mechanical. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

/* ------------------------------------------------ page changes
   The old page lifts away and the new one rises in, while the header stays where it is
   (Chrome, Edge, Safari 18; other browsers simply load the page). */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: page-leave 0.22s var(--ease-in) both;
}
::view-transition-new(root) {
  animation: page-enter 0.6s var(--ease-out) both;
}
::view-transition-group(site-header) {
  animation-duration: 0.45s;
  animation-timing-function: var(--ease-out);
}
header.l-header .top-bar-container {
  view-transition-name: site-header;
}
@keyframes page-leave {
  to { opacity: 0; transform: translateY(-8px); }
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(14px); }
}

/* ------------------------------------------------ blocks that glide in as they come into view
   The list is REVEAL in app/_site/motion-config.ts; site-motion.tsx adds .is-visible.
   Only the outermost block of a nest moves, and nothing inside the hero slider. */
.motion :where(.animated, .wpb_animate_when_almost_visible, .wd-heading, .text-icon.boxes, .pricing-table, .wd-post, .wd-btn-wrap, .wd-svg, .wpb_single_image, .wd-count-up, .percentage-circle, .vc_tta-panel, .wd-clients-carousel, .portfolio_style-2, .testimonail-slik, .titlebar .title, .titlebar .breadcrumbs, .first-footer .widget_text, .blog-posts, .sidebar section, .not_found) {
  animation: none !important;
  transition:
    opacity 0.9s var(--ease-out) var(--reveal-delay, 0s),
    translate 1.1s var(--ease-out) var(--reveal-delay, 0s),
    scale 1.1s var(--ease-out) var(--reveal-delay, 0s),
    transform 0.6s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease !important;
}
.motion :where(.animated, .wpb_animate_when_almost_visible, .wd-heading, .text-icon.boxes, .pricing-table, .wd-post, .wd-btn-wrap, .wd-svg, .wpb_single_image, .wd-count-up, .percentage-circle, .vc_tta-panel, .wd-clients-carousel, .portfolio_style-2, .testimonail-slik, .titlebar .title, .titlebar .breadcrumbs, .first-footer .widget_text, .blog-posts, .sidebar section, .not_found):not(.is-visible):not(:where(.animated, .wpb_animate_when_almost_visible, .wd-heading, .text-icon.boxes, .pricing-table, .wd-post, .wd-btn-wrap, .wd-svg, .wpb_single_image, .wd-count-up, .percentage-circle, .vc_tta-panel, .wd-clients-carousel, .portfolio_style-2, .testimonail-slik, .titlebar .title, .titlebar .breadcrumbs, .first-footer .widget_text, .blog-posts, .sidebar section, .not_found, rs-module-wrap) *) {
  opacity: 0 !important;
  translate: 0 34px;
}
/* Pictures and cards also settle from a touch smaller. */
.motion :where(.text-icon.boxes, .pricing-table, .wd-post, .wd-svg, .wpb_single_image, .percentage-circle, .portfolio_style-2):not(.is-visible) {
  scale: 0.965;
}
.motion :where(.animated, .wpb_animate_when_almost_visible, .wd-heading, .text-icon.boxes, .pricing-table, .wd-post, .wd-btn-wrap, .wd-svg, .wpb_single_image, .wd-count-up, .percentage-circle, .vc_tta-panel, .wd-clients-carousel, .portfolio_style-2, .testimonail-slik, .titlebar .title, .titlebar .breadcrumbs, .first-footer .widget_text, .blog-posts, .sidebar section, .not_found).is-visible {
  opacity: 1 !important;
  translate: none;
  scale: none;
}
/* Safety net: if the motion code never starts, show everything after a few seconds. */
.motion-fallback :where(.animated, .wpb_animate_when_almost_visible, .wd-heading, .text-icon.boxes, .pricing-table, .wd-post, .wd-btn-wrap, .wd-svg, .wpb_single_image, .wd-count-up, .percentage-circle, .vc_tta-panel, .wd-clients-carousel, .portfolio_style-2, .testimonail-slik, .titlebar .title, .titlebar .breadcrumbs, .first-footer .widget_text, .blog-posts, .sidebar section, .not_found) {
  opacity: 1 !important;
  translate: none !important;
  scale: none !important;
}

/* ------------------------------------------------ header
   Fixed after 50px of scrolling (it drops in), tucks away while scrolling down and comes back on the
   way up. site-motion.tsx sets .fixed and .is-tucked. */
header.l-header .top-bar-container.sticky {
  transition: translate 0.5s var(--ease-out), box-shadow 0.35s ease, background-color 0.35s ease;
}
.motion header.l-header .top-bar-container.sticky.fixed {
  animation: header-drop 0.6s var(--ease-out);
}
header.l-header .top-bar-container.sticky.fixed.is-tucked {
  translate: 0 -115%;
  box-shadow: none;
}
@keyframes header-drop {
  from { translate: 0 -100%; }
}

/* Menu: a thin accent line grows under the item you point at and stays under the current page. */
@media (min-width: 64em) {
  header.l-header .top-bar-container .top-bar .top-bar-right .desktop-menu > li > a {
    background-image: linear-gradient(var(--accent-color, #ff3b33), var(--accent-color, #ff3b33));
    background-repeat: no-repeat;
    background-origin: content-box;
    background-position: 50% calc(100% + 6px);
    background-size: 0 2px;
    transition: background-size 0.45s var(--ease-out), color 0.3s ease;
  }
  header.l-header .top-bar-container .top-bar .top-bar-right .desktop-menu > li > a:hover,
  header.l-header .top-bar-container .top-bar .top-bar-right .desktop-menu > li.current-menu-item > a {
    background-size: 100% 2px;
  }
}

/* ------------------------------------------------ pointer and touch
   Buttons lift a little under the pointer and press in when clicked or tapped. */
a,
button,
input[type="submit"],
[role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
:where(.wd-btn, .readmore-button a, .wd-post__read-more a, .wpcf7-form input[type="submit"]) {
  transition: translate 0.35s var(--ease-out), scale 0.25s var(--ease-out), box-shadow 0.35s var(--ease-out), background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}
@media (hover: hover) {
  :where(.wd-btn, .readmore-button a, .wpcf7-form input[type="submit"]):hover {
    translate: 0 -2px;
    box-shadow: 0 16px 30px -14px rgba(22, 36, 102, 0.5);
  }
  /* Feature, service and contact boxes rise to meet the pointer. */
  .motion :where(.text-icon.boxes):hover {
    translate: 0 -6px;
    box-shadow: 0 28px 54px -26px rgba(22, 36, 102, 0.35);
  }
}
:where(.wd-btn, .readmore-button a, .wd-post__read-more a, .wpcf7-form input[type="submit"], .rev-btn):active {
  scale: 0.97;
  transition-duration: 0.12s !important;
}
/* The theme lifted pricing cards a full 30px at once; a gentler, smooth rise instead. */
body .pricing-table.pricing1:hover,
body .pricing-table.pricing2:hover {
  transform: translateY(-10px);
}

/* Keyboard users see where they are. */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--secondary-color, #5164e5);
  outline-offset: 3px;
}

/* ------------------------------------------------ reduced motion
   Visitors who asked their system for less motion get none: pages simply change, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
  header.l-header .top-bar-container.sticky,
  header.l-header .top-bar-container .top-bar .top-bar-right .desktop-menu > li > a,
  :where(.wd-btn, .readmore-button a, .wd-post__read-more a, .wpcf7-form input[type="submit"]) {
    transition: none !important;
  }
}
