/* ===== KMK Chemicals - Shofy UI/UX optimization ===== */
:root {
  --kmk-radius: 10px;
  --kmk-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  --kmk-shadow-hover: 0 10px 28px rgba(0, 0, 0, .12);
  --kmk-ease: .25s ease;
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }

/* Keyboard focus visibility (accessibility) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--tp-theme-primary, #0989ff);
  outline-offset: 2px;
}

/* ----- Header ----- */
.tp-header-area, .tp-header-sticky { transition: box-shadow var(--kmk-ease), background var(--kmk-ease); }
.header-sticky.header-sticky-active,
.tp-header-sticky-active { box-shadow: 0 4px 18px rgba(0, 0, 0, .08); }
.tp-header-search input, .tp-header-search-input { border-radius: var(--kmk-radius); }

/* ----- Buttons ----- */
.tp-btn, .btn, button[type="submit"] {
  border-radius: var(--kmk-radius);
  transition: transform var(--kmk-ease), box-shadow var(--kmk-ease), background var(--kmk-ease);
}
.tp-btn:hover, .btn:hover { transform: translateY(-2px); box-shadow: var(--kmk-shadow-hover); }
.tp-btn:active, .btn:active { transform: translateY(0); }

/* ----- Section titles / spacing ----- */
.tp-section-title { letter-spacing: -.01em; line-height: 1.2; }
section, .tp-section { scroll-margin-top: 90px; }
@media (max-width: 767px) {
  .pt-100 { padding-top: 60px !important; }
  .pb-100 { padding-bottom: 60px !important; }
  .pt-80 { padding-top: 50px !important; }
  .pb-80 { padding-bottom: 50px !important; }
}

/* ----- Product cards ----- */
.tp-product-item {
  border-radius: var(--kmk-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--kmk-shadow);
  transition: transform var(--kmk-ease), box-shadow var(--kmk-ease);
}
.tp-product-item:hover { transform: translateY(-4px); box-shadow: var(--kmk-shadow-hover); }
.tp-product-thumb img { transition: transform .5s ease; width: 100%; object-fit: cover; }
.tp-product-item:hover .tp-product-thumb img { transform: scale(1.05); }
.tp-product-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.8em;
}

/* ----- Category / feature / blog cards ----- */
.tp-category-item, .tp-feature-item, .tp-blog-item {
  border-radius: var(--kmk-radius);
  transition: transform var(--kmk-ease), box-shadow var(--kmk-ease);
}
.tp-category-item:hover, .tp-feature-item:hover, .tp-blog-item:hover {
  transform: translateY(-4px); box-shadow: var(--kmk-shadow-hover);
}
.tp-blog-thumb { overflow: hidden; border-radius: var(--kmk-radius); }
.tp-blog-thumb img { transition: transform .5s ease; }
.tp-blog-item:hover .tp-blog-thumb img { transform: scale(1.06); }

/* ----- Forms ----- */
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], select, textarea, .form-control {
  border-radius: var(--kmk-radius);
  transition: border-color var(--kmk-ease), box-shadow var(--kmk-ease);
}
input:focus, select:focus, textarea:focus, .form-control:focus {
  box-shadow: 0 0 0 3px rgba(9, 137, 255, .15);
}

/* ----- Footer ----- */
.tp-footer-area a { transition: color var(--kmk-ease), padding var(--kmk-ease); }
.tp-footer-area .tp-footer-widget-content a:hover { padding-left: 4px; }

/* ----- Scroll reveal (used by custom JS) ----- */
.kmk-reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.kmk-reveal.kmk-in { opacity: 1; transform: none; }

/* ----- Back to top button (created by JS) ----- */
#kmk-top {
  position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: var(--tp-theme-primary, #0989ff); color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer; z-index: 999;
  box-shadow: var(--kmk-shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all var(--kmk-ease);
}
#kmk-top.show { opacity: 1; visibility: visible; transform: none; }

/* ----- Respect reduced-motion preference ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .kmk-reveal { opacity: 1; transform: none; }
}