/**
 * Chekkos UI layer — UX/a11y overrides for tt_smartbooks2
 */

/* --- Base typography & contrast --- */
body {
  font-family: var(--chekkos-font-body);
  font-size: var(--chekkos-font-size-base);
  line-height: var(--chekkos-line-height);
  color: var(--chekkos-text);
  background-color: var(--chekkos-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--chekkos-font-display);
  color: var(--chekkos-text);
}

/* --- Focus & accessibility (override theme outline:none) --- */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--chekkos-primary-light);
  outline-offset: 2px;
}

.chekkos-skip-link {
  position: absolute;
  top: -100px;
  left: var(--chekkos-space-4);
  z-index: var(--chekkos-z-skip);
  padding: var(--chekkos-space-2) var(--chekkos-space-4);
  background: var(--chekkos-primary);
  color: var(--chekkos-text-inverse);
  border-radius: var(--chekkos-radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--chekkos-transition);
}

.chekkos-skip-link:focus {
  top: var(--chekkos-space-4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Top utility bar --- */
nav#top {
  background: var(--chekkos-bg-muted);
  border-bottom: 1px solid var(--chekkos-border);
  font-size: 13px;
}

nav#top a {
  color: var(--chekkos-text-muted);
  transition: color var(--chekkos-transition);
}

nav#top a:hover,
nav#top a:focus-visible {
  color: var(--chekkos-primary);
}

@media (max-width: 767px) {
  nav#top .box-right > div:nth-child(1),
  nav#top .box-right > div:nth-child(2) {
    display: none;
  }
}

/* --- Header & search --- */
header .header-inner {
  background: var(--chekkos-bg-elevated);
  box-shadow: var(--chekkos-shadow-sm);
}

#search input {
  border-radius: var(--chekkos-radius-md) 0 0 var(--chekkos-radius-md);
  border-color: var(--chekkos-border-strong);
  min-height: var(--chekkos-touch-min);
  font-size: 15px;
}

#search .input-group-btn button {
  min-width: var(--chekkos-touch-min);
  min-height: var(--chekkos-touch-min);
  border-radius: 0 var(--chekkos-radius-md) var(--chekkos-radius-md) 0;
  cursor: pointer;
  background: var(--chekkos-primary);
  border-color: var(--chekkos-primary);
  transition: background var(--chekkos-transition);
}

#search .input-group-btn button:hover,
#search .input-group-btn button:focus-visible {
  background: var(--chekkos-primary-dark);
  border-color: var(--chekkos-primary-dark);
}

/* --- Quote CTA (header) --- */
.box-cart .mini-quote .quote_content > a,
.quote_button {
  background: var(--chekkos-primary) !important;
  color: var(--chekkos-text-inverse) !important;
  border-radius: var(--chekkos-radius-md) !important;
  min-height: var(--chekkos-touch-min);
  padding: 0 var(--chekkos-space-4) !important;
  font-weight: 600;
  display: inline-flex !important;
  align-items: center;
  gap: var(--chekkos-space-2);
  transition: background var(--chekkos-transition), box-shadow var(--chekkos-transition);
  box-shadow: var(--chekkos-shadow-sm);
}

.box-cart .mini-quote .quote_content > a:hover,
.quote_button:hover {
  background: var(--chekkos-primary-dark) !important;
  box-shadow: var(--chekkos-shadow-md);
}

/* --- Product page: primary quote button --- */
#button-quote,
.btn-quote-primary {
  background: var(--chekkos-primary) !important;
  border-color: var(--chekkos-primary) !important;
  color: var(--chekkos-text-inverse) !important;
  font-weight: 600;
  min-height: var(--chekkos-touch-min);
  padding: var(--chekkos-space-3) var(--chekkos-space-6);
  border-radius: var(--chekkos-radius-md);
  width: 100%;
  max-width: 360px;
  margin-top: var(--chekkos-space-3);
  transition: background var(--chekkos-transition), transform var(--chekkos-transition);
  cursor: pointer;
}

#button-quote:hover,
.btn-quote-primary:hover {
  background: var(--chekkos-primary-dark) !important;
  border-color: var(--chekkos-primary-dark) !important;
}

/* --- Sticky quote bar (mobile product) --- */
.chekkos-sticky-quote {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--chekkos-z-sticky);
  padding: var(--chekkos-space-3) var(--chekkos-space-4);
  background: var(--chekkos-bg-elevated);
  border-top: 1px solid var(--chekkos-border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.1);
  gap: var(--chekkos-space-3);
  align-items: center;
}

.chekkos-sticky-quote.is-visible {
  display: flex;
}

.chekkos-sticky-quote__info {
  flex: 1;
  min-width: 0;
}

.chekkos-sticky-quote__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--chekkos-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.chekkos-sticky-quote__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--chekkos-primary);
  margin: 0;
}

.chekkos-sticky-quote__btn {
  flex-shrink: 0;
  background: var(--chekkos-primary);
  color: #fff;
  border: none;
  border-radius: var(--chekkos-radius-md);
  min-height: var(--chekkos-touch-min);
  padding: 0 var(--chekkos-space-5);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--chekkos-transition);
}

.chekkos-sticky-quote__btn:hover {
  background: var(--chekkos-primary-dark);
}

@media (min-width: 992px) {
  .chekkos-sticky-quote {
    display: none !important;
  }
}

/* --- Product cards --- */
.product-thumb {
  border-radius: var(--chekkos-radius-md);
  border: 1px solid var(--chekkos-border);
  overflow: hidden;
  transition: box-shadow var(--chekkos-transition), border-color var(--chekkos-transition);
}

.product-thumb:hover {
  border-color: var(--chekkos-border-strong);
  box-shadow: var(--chekkos-shadow-md);
}

.product-thumb .caption h4 a,
.product-thumb .product-name a {
  color: var(--chekkos-text);
  font-weight: 600;
  transition: color var(--chekkos-transition);
}

.product-thumb .caption h4 a:hover {
  color: var(--chekkos-primary);
}

/* --- Breadcrumbs --- */
.breadcrumb {
  background: transparent;
  padding: var(--chekkos-space-4) 0;
  font-size: 14px;
}

.breadcrumb > li + li:before {
  color: var(--chekkos-text-muted);
}

/* --- Footer --- */
footer {
  background: var(--chekkos-bg-muted);
  border-top: 1px solid var(--chekkos-border);
}

footer .footer-title h5 {
  font-weight: 700;
  color: var(--chekkos-text);
  margin-bottom: var(--chekkos-space-4);
}

footer a {
  color: var(--chekkos-text-muted);
  transition: color var(--chekkos-transition);
}

footer a:hover {
  color: var(--chekkos-primary);
}

/* --- FAB group: WhatsApp + back to top --- */
.chekkos-fab-group {
  position: fixed;
  bottom: var(--chekkos-space-5);
  right: var(--chekkos-space-5);
  z-index: var(--chekkos-z-fab);
  display: flex;
  flex-direction: column;
  gap: var(--chekkos-space-3);
  align-items: flex-end;
}

#whatsapp-widget {
  position: static;
  z-index: auto;
}

#whatsapp-widget a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background-color: #25d366;
  color: #fff;
  border-radius: var(--chekkos-radius-full);
  font-size: 28px;
  text-decoration: none;
  box-shadow: var(--chekkos-shadow-md);
  transition: transform var(--chekkos-transition), box-shadow var(--chekkos-transition);
}

#whatsapp-widget a:hover {
  transform: translateY(-2px);
  box-shadow: var(--chekkos-shadow-lg);
}

#whatsapp-widget a .fa{
  font-size: 34px;
}

#back-top {
  position: static !important;
  display: none;
  width: 44px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  background: var(--chekkos-primary);
  color: #fff;
  border-radius: var(--chekkos-radius-full);
  cursor: pointer;
  box-shadow: var(--chekkos-shadow-md);
  transition: background var(--chekkos-transition), transform var(--chekkos-transition);
}

#back-top:hover {
  background: var(--chekkos-primary-dark);
  transform: translateY(-2px);
}

#back-top.is-visible {
  display: block;
}

/* Offset sticky bar above FAB on product mobile */
body:has(#chekkos-sticky-quote.is-visible) .chekkos-fab-group {
  bottom: calc(80px + var(--chekkos-space-5));
}

/* --- Buttons general --- */
.btn-primary,
.button.btn-primary {
  background: var(--chekkos-primary);
  border-color: var(--chekkos-primary);
  border-radius: var(--chekkos-radius-sm);
  min-height: var(--chekkos-touch-min);
  transition: background var(--chekkos-transition);
}

.btn-primary:hover {
  background: var(--chekkos-primary-dark);
  border-color: var(--chekkos-primary-dark);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fix-header {
    animation: none !important;
  }

  #whatsapp-widget a:hover,
  #back-top:hover {
    transform: none;
  }
}

/* --- Container breathing room on mobile --- */
@media (max-width: 767px) {
  .container {
    padding-left: var(--chekkos-space-4);
    padding-right: var(--chekkos-space-4);
  }

  #product-product {
    padding-bottom: 72px;
  }
}

/* --- Google Sans Flex (site-wide text; icon fonts unchanged) --- */
html {
  font-family: 'Google Sans Flex', system-ui, -apple-system, sans-serif;
}

body,
h1, h2, h3, h4, h5, h6,
p, a, span, li, label, legend, small, strong, em, cite,
input, button, select, textarea, optgroup, option,
.btn, .button, .form-control,
table, th, td, caption,
nav, .nav, .nav a, .breadcrumb, .breadcrumb a,
.product-thumb .caption, .product-thumb .price,
.module-title, .title-module,
#menu a, #menu .nav > li > a,
.chekkos-hero__title, .chekkos-hero__subtitle,
.toast, .alert {
  font-family: 'Google Sans Flex', system-ui, -apple-system, sans-serif !important;
}
