/* ============================================================
   GYTO SUCCESS COMPANY — Cross-Browser Compatibility Layer
   Covers: Chrome, Firefox, Safari (iOS & macOS), Edge,
           Samsung Internet, Android WebView, Opera, IE11
   Load BEFORE style.css in every HTML <head>
   ============================================================ */

/* ── 1. Font Stack — system-ui first so every OS picks its
         native sans-serif before falling back ────────────── */
:root {
  --font-main: system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ── 2. Universal box-sizing reset ─────────────────────────── */
*, *::before, *::after {
  -webkit-box-sizing: border-box;
  -moz-box-sizing:    border-box;
  box-sizing:         border-box;
}

/* ── 3. Smooth scroll — pure CSS (Safari 15.4+, Chrome, FF)
         JS polyfill in main.js handles older Safari ─────── */
html {
  scroll-behavior: smooth;
  /* Momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  /* Prevent text inflation on orientation change */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust:    100%;
  text-size-adjust:         100%;
}

/* ── 4. Font smoothing ──────────────────────────────────────── */
body {
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering:          optimizeLegibility;
}

/* ── 5. position: sticky — navbar ──────────────────────────── */
.navbar {
  position: -webkit-sticky;
  position: sticky;
}

/* ── 6. Transitions — webkit prefix on every interactive el ── */
.btn,
.nav-link,
.nav-cta,
.service-card,
.sector-card,
.contact-card,
.why-point,
.social-link,
.scroll-top,
.whatsapp-float,
.footer-links a,
.footer-bottom-links a,
.footer-contact-item a,
.dropdown-menu a,
.tip-list li,
.value-card,
.mv-card,
.product-card,
.k9-breed-card,
.btn-download-profile,
.btn-product,
.profile-products-link,
.service-photo-panel,
a {
  -webkit-transition: all 0.3s ease;
  -moz-transition:    all 0.3s ease;
  -o-transition:      all 0.3s ease;
  transition:         all 0.3s ease;
}

/* ── 7. Transforms — webkit prefix ─────────────────────────── */
.service-card:hover    { -webkit-transform: translateY(-6px); transform: translateY(-6px); }
.sector-card:hover     { -webkit-transform: translateY(-4px); transform: translateY(-4px); }
.mv-card:hover         { -webkit-transform: translateY(-4px); transform: translateY(-4px); }
.value-card:hover      { -webkit-transform: translateY(-3px); transform: translateY(-3px); }
.product-card:hover    { -webkit-transform: translateY(-6px); transform: translateY(-6px); }
.k9-breed-card:hover   { -webkit-transform: translateY(-2px); transform: translateY(-2px); }
.contact-card:hover    { -webkit-transform: translateX(4px);  transform: translateX(4px);  }
.why-point:hover       { -webkit-transform: none;             transform: none;             }
.btn-download-profile:hover { -webkit-transform: translateY(-2px); transform: translateY(-2px); }
.whatsapp-float:hover  { -webkit-transform: scale(1.12);      transform: scale(1.12);      }

.scroll-top            { -webkit-transform: translateY(20px); transform: translateY(20px); }
.scroll-top.visible    { -webkit-transform: translateY(0);    transform: translateY(0);    }

.nav-toggle.open span:nth-child(1) {
  -webkit-transform: translateY(8px) rotate(45deg);
  transform:         translateY(8px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) {
  -webkit-transform: translateY(-8px) rotate(-45deg);
  transform:         translateY(-8px) rotate(-45deg);
}

/* ── 8. Flexbox — webkit + ms prefixes ─────────────────────── */

/* display: flex */
.top-bar .container,
.top-bar-left,
.top-bar-right,
.top-bar-item,
.navbar .container,
.logo,
.nav-menu,
.hero-buttons,
.cta-buttons,
.about-features,
.feature-item,
.why-point,
.why-point-icon,
.contact-info,
.contact-card,
.contact-icon,
.hours-row,
.footer-grid,
.footer-links,
.footer-bottom .container,
.footer-bottom-links,
.social-links,
.social-link,
.breadcrumb,
.page-header-content,
.tip-category-header,
.tip-list li,
.k9-breed-card,
.k9-breed-icon,
.profile-highlights li,
.profile-download-actions,
.profile-stats-row,
.profile-stat,
.products-cta-strip,
.btn-download-profile,
.btn-product,
.service-icon,
.mv-icon,
.sector-card,
.scroll-top,
.whatsapp-float,
.stat-item,
.nav-toggle,
.requirement-tags,
.form-group,
.service-list li,
.file-upload-area,
.logo-float-panel,
.pdf-mock-header {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}

/* flex-direction: column */
.contact-info,
.footer-links,
.nav-menu,
.tip-list,
.why-points,
.form-group,
.product-body,
.profile-highlights,
.profile-download-visual {
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
}

/* align-items: center */
.top-bar .container,
.top-bar-left,
.top-bar-right,
.top-bar-item,
.navbar .container,
.logo,
.nav-menu,
.feature-item,
.why-point,
.contact-card,
.hours-row,
.footer-bottom .container,
.breadcrumb,
.tip-category-header,
.tip-list li,
.k9-breed-card,
.profile-highlights li,
.btn-download-profile,
.btn-product,
.service-icon,
.mv-icon,
.sector-card,
.scroll-top,
.whatsapp-float,
.service-list li {
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
}

/* align-items: flex-start */
.contact-card,
.footer-contact-item,
.tip-list li,
.service-list li {
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
  -ms-flex-align: start;
  align-items: flex-start;
}

/* justify-content */
.top-bar .container        { -webkit-justify-content: space-between; -ms-flex-pack: justify;  justify-content: space-between; }
.navbar .container         { -webkit-justify-content: space-between; -ms-flex-pack: justify;  justify-content: space-between; }
.footer-bottom .container  { -webkit-justify-content: space-between; -ms-flex-pack: justify;  justify-content: space-between; }
.hours-row                 { -webkit-justify-content: space-between; -ms-flex-pack: justify;  justify-content: space-between; }
.cta-buttons               { -webkit-justify-content: center;        -ms-flex-pack: center;   justify-content: center;        }
.scroll-top                { -webkit-justify-content: center;        -ms-flex-pack: center;   justify-content: center;        }
.whatsapp-float            { -webkit-justify-content: center;        -ms-flex-pack: center;   justify-content: center;        }
.mv-icon                   { -webkit-justify-content: center;        -ms-flex-pack: center;   justify-content: center;        }
.service-icon              { -webkit-justify-content: center;        -ms-flex-pack: center;   justify-content: center;        }

/* flex-wrap */
.hero-buttons,
.cta-buttons,
.requirement-tags,
.top-bar .container,
.footer-bottom .container,
.social-links,
.products-cta-strip {
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

/* flex-shrink: 0 — icons and fixed-size elements */
.feature-icon,
.contact-icon,
.k9-breed-icon,
.service-icon,
.mv-icon,
.why-point-icon,
.tip-list li i,
.service-list li::before,
.profile-highlights li i,
.logo-img,
.footer-logo-img,
.footer-contact-item i {
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

/* flex: 1 — growing elements */
.product-body,
.profile-stat {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

/* ── 9. gap fallback using grid-gap (older alias) ──────────── */
/* grid-gap is the older property name — wider browser support  */
.services-grid          { grid-gap: 28px; gap: 28px; }
.sectors-grid           { grid-gap: 20px; gap: 20px; }
.about-features         { grid-gap: 16px; gap: 16px; }
.footer-grid            { grid-gap: 40px; gap: 40px; }
.form-grid              { grid-gap: 20px; gap: 20px; }
.mv-grid                { grid-gap: 28px; gap: 28px; }
.values-grid            { grid-gap: 24px; gap: 24px; }
.products-grid          { grid-gap: 28px; gap: 28px; }
.k9-breeds              { grid-gap: 16px; gap: 16px; }
.profile-products-grid  { grid-gap: 10px 20px; gap: 10px 20px; }
.profile-stats-row      { grid-gap: 16px; gap: 16px; }
.contact-grid           { grid-gap: 48px; gap: 48px; }
.why-grid               { grid-gap: 64px; gap: 64px; }

/* flex gap fallback — use margin on children where gap not supported */
@supports not (gap: 1px) {
  .social-links .social-link        { margin-right: 10px; }
  .social-links .social-link:last-child { margin-right: 0; }
  .hero-buttons .btn                { margin-right: 16px; margin-bottom: 12px; }
  .hero-buttons .btn:last-child     { margin-right: 0; }
  .cta-buttons .btn                 { margin: 6px 8px; }
  .top-bar-left .top-bar-item       { margin-right: 20px; }
  .top-bar-right .top-bar-item      { margin-left: 20px; }
  .feature-item                     { margin-bottom: 16px; }
  .why-points .why-point            { margin-bottom: 24px; }
  .footer-links a                   { margin-bottom: 10px; }
  .contact-info .contact-card       { margin-bottom: 20px; }
  .profile-stats-row .profile-stat  { margin-right: 16px; }
  .profile-stats-row .profile-stat:last-child { margin-right: 0; }
}

/* ── 10. CSS Grid — grid-template-columns older syntax ─────── */
/* Use both grid-gap and gap; column definitions are universally
   supported in modern browsers that support grid at all ────── */
.stats-bar .container            { grid-gap: 0; }
.about-intro .container          { grid-gap: 64px; gap: 64px; }
.recruitment-intro               { grid-gap: 48px; gap: 48px; }
.profile-download-inner          { grid-gap: 64px; gap: 64px; }

/* ── 11. object-fit fallback for browsers without support ───── */
/* Wrap images in a container and use background-image as fallback.
   Modern browsers use the img tag; IE/old Edge use the ::after trick.
   The .service-photo-panel already handles this via bg sizing. ── */
.service-photo-panel img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;       /* Opera 19-22 */
  object-fit: cover;
  -o-object-position: center;
  object-position: center;
}
.service-photo-panel.k9-portrait img {
  -o-object-fit: contain;
  object-fit: contain;
  -o-object-position: center;
  object-position: center;
}
.logo-img, .footer-logo-img, .hero-logo img {
  -o-object-fit: contain;
  object-fit: contain;
}

/* ── 12. Form cross-browser reset ───────────────────────────── */
input,
select,
textarea,
button {
  -webkit-appearance: none;
  -moz-appearance:    none;
  appearance:         none;
  /* Remove iOS inner shadow on text inputs */
  -webkit-box-shadow: none;
  box-shadow:         none;
  /* Use site font everywhere */
  font-family: inherit;
  font-size:   inherit;
}

/* Restore focus outline for accessibility */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(26,42,108,0.4);
  outline-offset: 2px;
}

/* Custom select arrow — replaces removed native arrow */
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a2a6c' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* File input — replace inset with explicit sides for IE ──────── */
.file-upload-area input[type="file"] {
  position: absolute;
  top:    0;
  right:  0;
  bottom: 0;
  left:   0;
  opacity: 0;
  cursor: pointer;
  width:  100%;
  height: 100%;
}

/* Prevent tap-highlight flicker on Android ───────────────────── */
a,
button,
.btn,
.nav-link,
.service-card,
.sector-card,
input[type="submit"],
input[type="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* Prevent text selection on buttons (long-press Android) ──────── */
button,
.btn,
.nav-toggle,
.scroll-top,
.whatsapp-float {
  -webkit-user-select: none;
  -moz-user-select:    none;
  -ms-user-select:     none;
  user-select:         none;
}

/* ── 13. iOS safe-area insets (notch / home bar) ────────────── */
.navbar {
  padding-left:  env(safe-area-inset-left,  0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.top-bar {
  padding-left:  env(safe-area-inset-left,  0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.footer {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.whatsapp-float {
  /* Shift above home bar on iOS */
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

/* ── 14. High-DPI / Retina display ──────────────────────────── */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi),
       (min-resolution: 2dppx) {
  .logo-img,
  .footer-logo-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ── 15. Reduced motion — respect OS accessibility setting ───── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    -webkit-animation-duration: 0.01ms !important;
    animation-duration:         0.01ms !important;
    -webkit-transition-duration: 0.01ms !important;
    transition-duration:         0.01ms !important;
    scroll-behavior:             auto !important;
  }
}

/* ── 16. Print styles ───────────────────────────────────────── */
@media print {
  .navbar,
  .top-bar,
  .scroll-top,
  .whatsapp-float,
  .hero-scroll,
  .cta-section,
  .nav-toggle { display: none !important; }

  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.75em; }
  .container { max-width: 100%; padding: 0; }
  .section-padding { padding: 20pt 0; }

  .footer { background: #fff; color: #000; }
  .footer-main { border-top: 1pt solid #ccc; }
  .footer-brand p,
  .footer-links a,
  .footer-contact-item { color: #000; opacity: 1; }
}

/* ── 17. Firefox-specific form fixes ───────────────────────── */
@-moz-document url-prefix() {
  .form-group input,
  .form-group select,
  .form-group textarea {
    -moz-appearance: none;
  }
  /* Remove Firefox's extra inner padding on buttons */
  button::-moz-focus-inner,
  input[type="button"]::-moz-focus-inner,
  input[type="submit"]::-moz-focus-inner {
    border: 0;
    padding: 0;
  }
}

/* ── 18. Internet Explorer 11 — static colour fallbacks ─────── */
/* IE 11 does not support CSS custom properties (var()).
   These rules provide hardcoded colour fallbacks so the site
   at least displays in colour instead of unstyled grey. ─────── */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  /* Navbar */
  .navbar { background: #ffffff; border-bottom: 3px solid #f5821f; }
  /* Top bar */
  .top-bar { background: #0d1530; border-bottom: 2px solid #f5c200; }
  /* Buttons */
  .btn-primary  { background: #f5821f; color: #0d1530; border-color: #f5821f; }
  .btn-dark     { background: #1a2a6c; color: #ffffff; border-color: #1a2a6c; }
  .btn-outline  { background: transparent; color: #ffffff; border-color: #ffffff; }
  /* Hero */
  .hero { background: #1a2a6c; color: #ffffff; }
  /* Stats bar */
  .stats-bar { background: #f5821f; }
  .stat-number { color: #0d1530; }
  /* Service cards */
  .service-card { background: #ffffff; border-top: 3px solid #1a2a6c; }
  .service-icon { background: #1a2a6c; color: #f5821f; }
  /* Sectors */
  .sectors-section { background: #1a2a6c; }
  .sector-card { border: 1px solid rgba(255,255,255,0.12); }
  /* Footer */
  .footer { background: #0d1530; }
  .footer-col h4 { color: #ffffff; }
  .footer-bottom { background: rgba(0,0,0,0.15); }
  /* Page header */
  .page-header { background: #1a2a6c; }
  /* CTA */
  .cta-section { background: #0d1530; }
  /* Section title */
  .section-title { color: #1a2a6c; }
  .section-title span { color: #f5821f; }
  .title-line { background: #f5821f; }
  /* Nav */
  .nav-link:hover, .nav-link.active { color: #1a2a6c; background: rgba(26,42,108,0.07); }
  .nav-cta { background: #f5821f; color: #0d1530; }
  /* Contact */
  .contact-section { background: #fdf5ec; }
  .contact-card { background: #ffffff; }
  .contact-icon { background: #1a2a6c; color: #f5821f; }
  .hours-card { background: #f5821f; }
  /* Forms */
  .form-group input,
  .form-group select,
  .form-group textarea { border: 1.5px solid #e2d8cc; border-radius: 6px; }
  /* Sticky fallback — IE doesn't support sticky */
  .navbar { position: relative; }
  /* WhatsApp */
  .whatsapp-float { background: #25d366; color: #ffffff; }
  /* Scroll top */
  .scroll-top { background: #f5821f; color: #0d1530; border: 2px solid #f5c200; }
}

/* ── 19. Samsung Internet / UC Browser image rendering ──────── */
img {
  image-rendering: auto;
  /* Prevent sub-pixel blurring on Android */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ── 20. Edge legacy (pre-Chromium) flex fixes ──────────────── */
@supports (-ms-ime-align: auto) {
  /* Edge 16-18 — flex gap not supported */
  .social-links .social-link  { margin-right: 10px; }
  .hero-buttons .btn          { margin-right: 16px; }
  .cta-buttons .btn           { margin: 6px 8px; }
}
