/* =====================================================================
   Dizen — audit fixes (loaded after style.css)
   Sections: 1 Typography  2 Contrast  3 Responsive  4 Touch targets
             5 Native-app feel  6 PWA UI (toast/install/iOS hint)
   ===================================================================== */

/* ---------- 1. TYPOGRAPHY ---------- */
body {
  font-size: 15px;
  line-height: 1.6;
}
p { line-height: 1.65; }

/* ---------- 2. COLOR CONTRAST (WCAG 2.1 AA) ---------- */
/* Tan #d7b39a on white = 1.94:1 (fail). Buttons: dark brand text on tan = 7.9:1 */
.site-button,
.site-button:visited {
  color: #23252d;
}
.site-button:hover,
.site-button:focus,
.site-button:active {
  color: #ffffff; /* hover bg darkens in theme; white passes there */
}
/* ...but the rule above assumes a tan button. The dark footer overrides
   .site-button to a near-black fill (#0e0e0e), where #23252d ink is
   invisible — that is what hid the newsletter send icon. Put white back
   for buttons on dark surfaces. */
.footer-dark .site-button,
.footer-dark .site-button:visited {
  color: #ffffff;
}
.footer-dark .site-button:hover,
.footer-dark .site-button:focus,
.footer-dark .site-button:active {
  background-color: #d7b39a;
  color: #23252d;
}
/* Accent-colored text on light backgrounds -> darker accent 5.4:1 */
.bg-white a:not([class*="site-button"]):hover,
.bg-gray a:not([class*="site-button"]):hover {
  color: #8a6238;
}
/* Visible focus indicators (keyboard a11y) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #8a6238;
  outline-offset: 2px;
}

/* ---------- 2b. QUICK ENQUIRY: SUBJECT DROPDOWN ---------- */
/* The slide-out enquiry panel (common/header.php) uses the theme's
   .input-animate pattern: a label positioned absolutely at top:10px that
   the text input slides out from under on focus. A <select> can't do that
   — it paints an opaque box in the same space — so the Subject label sat
   underneath the dropdown, overlapping its text. Selects always have a
   value, so the label simply goes above, and the control is restyled to
   match the underlined look of the fields around it. */
.contact-nav-form .input.input-select {
  position: relative;
  margin-bottom: 30px;
}
.contact-nav-form .input-select label {
  position: static;
  display: block;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: #000;
  cursor: pointer;
}
.contact-nav-form .input-select select {
  width: 100%;
  height: 40px;
  padding: 0 28px 0 0;
  border: 0;
  border-bottom: 1px solid #dcdcdc;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #000;
  line-height: 40px;
  cursor: pointer;
  /* Native arrow sits inconsistently across browsers once the borders are
     stripped, so draw our own in the brand tan. */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a07d5c' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 11px 7px;
}
.contact-nav-form .input-select select:focus {
  outline: none;
  border-bottom-color: #d7b39a;
}
.contact-nav-form .input-select select:focus-visible {
  outline: 2px solid #8a6238;
  outline-offset: 2px;
}
/* IE/Edge legacy: hide the built-in arrow so ours isn't doubled */
.contact-nav-form .input-select select::-ms-expand { display: none; }

/* ---------- 3. RESPONSIVE FIXES ---------- */
/* Rev slider arrows overflow viewport at tablet widths (was +45px side-scroll) */
.rev_slider_wrapper { overflow: hidden !important; }

/* Off-canvas panels (Quick Enquiry parked at right:-100%) must never create
   horizontal scroll. Use overflow-x: CLIP, not hidden — hidden turns body into
   a scroll container on this theme, which killed mouse-wheel/trackpad
   scrolling in Chrome. clip only clips paint; the window stays the scroller.
   (Verified live: wheel scroll works with clip, breaks with hidden.) */
body { overflow-x: clip; }
@supports not (overflow-x: clip) {
  /* very old browsers: fall back to clipping the wrapper, never body */
  .page-wraper { overflow-x: hidden; }
}

/* Hero: never show a flat gray box — first slide as CSS fallback + LCP boost */
#rev_slider_three_wrapper {
  background-image: url(../images/main-slider/slider4.jpg) !important;
  background-size: cover;
  background-position: center;
}

/* Quick Enquiry slide-panel: columns had no base col-12 -> 2x viewport width on phones */
@media (max-width: 991.98px) {
  .contact-nav .contact-nav-form > .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }
  .contact-nav .contact-nav-info { padding: 20px; border-width: 6px; }
  .contact-nav { overflow-y: auto; display: block; padding-top: 60px; }
  .contact-nav .contact_close { width: auto; }
}

/* Prevent iOS zoom-on-focus: inputs must be >= 16px */
input, select, textarea, .form-control { font-size: 16px !important; }

/* ---------- 4. TOUCH TARGETS (44x44 minimum) ---------- */
@media (pointer: coarse) {
  .social-icons li a,
  .social-bx li a,
  .full-social-bg ul li a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .site-button,
  .site-button-secondry,
  button[type="submit"] {
    min-height: 44px;
  }
  .navbar-toggler { min-width: 44px; min-height: 44px; }
  .footer-legal-links a { display: inline-block; padding: 10px 2px; }
  .header-nav .nav > li > a { padding-top: 14px; padding-bottom: 14px; }
}

/* ---------- 5. NATIVE-APP FEEL ---------- */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
/* NOTE: do NOT set overscroll-behavior-y:none on html/body here — combined with
   the overflow-x clip it disables mouse-wheel/trackpad scrolling in Chrome.
   Pull-to-refresh is only suppressed inside the installed (standalone) app: */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: contain; }
}

/* No text selection on UI chrome (content stays selectable) */
.site-header, .header-nav, .site-footer .widget-title, .site-button,
.site-button-secondry, .navbar-toggler, .scroltop, .owl-nav, .tparrows {
  -webkit-user-select: none;
  user-select: none;
}

/* Momentum scrolling for any scrollable panels */
.header-nav .nav, .contact-slide-hide, .contact-nav {
  -webkit-overflow-scrolling: touch;
}

/* Press feedback on buttons (ripple-like) */
.site-button, .site-button-secondry, button.site-button {
  transition: transform .12s ease, filter .12s ease;
}
.site-button:active, .site-button-secondry:active {
  transform: scale(.97);
  filter: brightness(.95);
}

/* Safe-area support (notch / Dynamic Island / home indicator) */
@supports (padding: env(safe-area-inset-top)) {
  .site-header .main-bar { padding-top: env(safe-area-inset-top); }
  .site-footer .footer-bottom {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .contact-slide-hide { padding-top: env(safe-area-inset-top); }
}

/* Smooth page transitions (native-style).
   OPACITY ONLY — never transform: any transform on body/page-wraper makes
   them the containing block for position:fixed and breaks the fixed header
   (header rendered blank until manual refresh). */
.dizen-page-anim body {
  animation: dizenFadeIn .25s ease;
}
.dizen-page-leave body {
  opacity: 0;
  transition: opacity .18s ease;
}
@keyframes dizenFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dizen-page-anim body { animation: none; }
}

/* ---------- 6. PWA UI ---------- */
.dizen-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px);
  background: #23252d;
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 100000;
  max-width: calc(100vw - 32px);
}
.dizen-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.dizen-toast.success { border-left: 4px solid #4caf7d; }
.dizen-toast.error   { border-left: 4px solid #e05d5d; }

.dizen-install-banner {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  color: #23252d;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  z-index: 100000;
  transform: translateY(120%);
  transition: transform .35s cubic-bezier(.2,.8,.25,1);
}
.dizen-install-banner.show { transform: none; }
.dizen-install-banner img { border-radius: 9px; }
.dizen-install-banner .dib-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.dizen-install-banner .dib-txt span { font-size: 12.5px; color: #666; }
.dizen-install-banner .dib-install {
  background: #23252d; color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font-weight: 600; font-size: 14px; min-height: 44px;
}
.dizen-install-banner .dib-close {
  background: none; border: 0; font-size: 22px; color: #999;
  min-width: 44px; min-height: 44px;
}

.dizen-ios-hint {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  color: #23252d;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 44px 14px 14px;
  z-index: 100000;
  transform: translateY(120%);
  transition: transform .35s cubic-bezier(.2,.8,.25,1);
}
.dizen-ios-hint.show { transform: none; }
.dizen-ios-hint p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.dizen-ios-hint img { border-radius: 8px; }
.dizen-ios-hint .dih-share { color: #0a84ff; font-size: 17px; }
.dizen-ios-hint .dih-close {
  position: absolute; top: 2px; right: 2px;
  background: none; border: 0; font-size: 20px; color: #999;
  min-width: 44px; min-height: 44px;
}
