/* ==========================================================================
   Mobile Improvements & Layout Overrides
   Last updated: 2026-08-28
   ========================================================================== */

/* ============================
   GLOBAL: Prevent horizontal overflow
   ============================ */
html, body {
  overflow-x: hidden !important;
}

img, svg, iframe, video, embed, object {
  max-width: 100%;
  height: auto;
}

a, p, li, span, h1, h2, h3, h4, h5, h6 {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ============================
   GLOBAL: Touch-friendly base sizing
   ============================ */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================
   NAVBAR: Mobile improvements
   ============================ */
@media (max-width: 1199.98px) {
  .rd-navbar-fixed .rd-navbar-panel {
    height: 60px;
    padding: 8px 16px;
  }
  .rd-navbar-fixed .rd-navbar-toggle {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .rd-navbar-fixed .rd-navbar-brand img {
    max-height: 44px;
    max-width: 140px;
  }
  .rd-navbar-fixed .rd-navbar-nav-wrap {
    width: 290px;
  }
  .rd-navbar-fixed .rd-nav-link {
    padding: 14px 24px !important;
    font-size: 16px;
  }
  .rd-navbar-fixed .rd-nav-item + .rd-nav-item {
    margin-top: 2px;
  }
}

/* ============================
   HERO / ABOUT SECTION (#about on index)
   ============================ */
@media (max-width: 991.98px) {
  #about.section-inset-18 {
    padding: 80px 0 60px !important;
  }
  #about h1 {
    font-size: 2em !important;
    line-height: 1.2 !important;
  }
  #about h2.offset-custom-1 {
    font-size: 1.4em !important;
    margin-top: 10px !important;
  }
  #about h4.offset-custom-2 {
    font-size: 1.05em !important;
    margin-top: 16px !important;
  }
  #about .box-callback {
    margin-top: 24px;
    padding: 20px;
  }
  #about .box-callback svg {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 575.98px) {
  #about.section-inset-18 {
    padding: 60px 0 40px !important;
    text-align: center !important;
  }
  #about h1 {
    font-size: 1.75em !important;
  }
  #about h2.offset-custom-1 {
    font-size: 1.2em !important;
  }
  #about h4 {
    font-size: 1em !important;
  }
  #about .box-callback {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  #about .box-callback .unit {
    flex-direction: column !important;
    align-items: center !important;
  }
  #about .box-callback .unit-body {
    text-align: center !important;
  }
  #about .box-callback .unit-left {
    margin-bottom: 10px;
  }
}

/* ============================
   BIOGRAPHY SECTION (#biography)
   ============================ */
@media (max-width: 991.98px) {
  #biography .row-50 {
    text-align: center;
  }
  #biography img {
    max-width: 280px;
    margin: 0 auto 24px;
    display: block;
  }
  #biography .figure-corporate {
    display: block;
    margin: 16px auto 0;
  }
}

@media (max-width: 575.98px) {
  #biography img {
    max-width: 220px;
  }
  #biography h2 {
    font-size: 1.6em;
  }
  #biography .heading-1 {
    font-size: 1.5em;
  }
  #biography h4 {
    font-size: 1.05em;
  }
  #biography p.big {
    font-size: 1em;
  }
}

/* ============================
   EXPERTISE SECTION (#areas-of-expertise)
   ============================ */
@media (max-width: 991.98px) {
  #areas-of-expertise .service-classic {
    max-width: 100%;
  }
  #areas-of-expertise .service-classic-inset {
    padding: 20px 18px 30px !important;
  }
  #areas-of-expertise img {
    width: 100%;
    height: auto;
  }
}

@media (max-width: 575.98px) {
  #areas-of-expertise .service-classic-inset {
    padding: 16px 14px 24px !important;
  }
  #areas-of-expertise .service-classic-title {
    font-size: 1.1em;
  }
  #areas-of-expertise .service-classic-text {
    font-size: 0.95em;
  }
}

/* ============================
   PROJECTS & SERVICES SECTIONS
   ============================ */
@media (max-width: 991.98px) {
  #projects .service-classic-inset,
  #services .service-classic-inset {
    padding: 20px 18px 28px !important;
  }
  #projects .service-classic-title,
  #services .service-classic-title {
    font-size: 1.05em;
  }
  #projects .service-classic-text,
  #services .service-classic-text {
    font-size: 0.95em;
  }
}

@media (max-width: 575.98px) {
  #projects .service-classic-inset,
  #services .service-classic-inset {
    padding: 16px 14px 22px !important;
  }
}

/* ============================
   CONTACT / FORM SECTION (#contacts)
   ============================ */
@media (max-width: 991.98px) {
  #contacts.section-md {
    padding: 50px 0 0 !important;
  }
  #contacts .form-classic {
    padding: 24px 20px;
    margin: 0 auto;
  }
  #contacts .google-map-absolute {
    position: relative !important;
    height: 300px;
    margin-top: 30px;
  }
  #contacts .google-map-container[data-key] {
    position: relative !important;
    height: 300px;
  }
  #contacts .google-map {
    height: 300px !important;
  }
}

@media (max-width: 575.98px) {
  #contacts .form-classic-header h2 {
    font-size: 1.5em;
  }
  #contacts .form-classic-subtitle {
    font-size: 0.9em;
  }
  #contacts .form-input {
    font-size: 16px !important; /* prevents iOS zoom */
    padding: 12px 14px;
  }
  #contacts textarea.form-input {
    min-height: 100px;
  }
  #contacts .button {
    width: 100%;
    text-align: center;
  }
}

/* ============================
   FOOTER
   ============================ */
@media (max-width: 991.98px) {
  .footer-default {
    text-align: center;
    padding: 50px 0 30px;
  }
  .footer-default .row-30 > [class*="col-"]:first-child {
    margin-bottom: 24px;
  }
  .footer-default .footer-default-contacts {
    padding-left: 0;
  }
  .footer-default .footer-default-contacts li {
    text-align: center;
  }
  .footer-default .list-social {
    justify-content: center !important;
    display: flex !important;
    margin-top: 20px;
  }
  .footer-default .rights {
    margin-top: 20px;
  }
}

/* ============================
   SUB-PAGE HERO (portfolio/blog/shop)
   ============================ */
@media (max-width: 991.98px) {
  .page-hero {
    padding: 60px 0 40px !important;
  }
  .page-hero h1 {
    font-size: 1.8em !important;
  }
  .page-hero p {
    font-size: 1em !important;
  }
}

@media (max-width: 575.98px) {
  .page-hero {
    padding: 50px 0 30px !important;
  }
  .page-hero h1 {
    font-size: 1.5em !important;
  }
  .page-hero p {
    font-size: 0.95em !important;
  }
}

/* ============================
   SHOP HERO (shop.html)
   ============================ */
@media (max-width: 575.98px) {
  .shop-hero {
    padding: 60px 0 50px !important;
  }
  .shop-hero h1 {
    font-size: 2em !important;
  }
  .shop-notify-form {
    flex-direction: column;
    gap: 8px !important;
  }
  .shop-notify-form input[type="email"] {
    border-radius: 3px !important;
    width: 100%;
  }
  .shop-notify-form button {
    border-radius: 3px !important;
    width: 100%;
  }
}

/* ============================
   CARD LAYOUTS (Portfolio/Blog/Shop cards)
   ============================ */
@media (max-width: 991.98px) {
  .portfolio-card, .blog-card {
    padding: 22px 18px 20px !important;
  }
  .portfolio-card h4, .blog-card h4 {
    font-size: 1em !important;
  }
  .portfolio-tags {
    font-size: 0.75em !important;
  }
  .portfolio-outcome {
    font-size: 0.85em !important;
  }
  .product-card {
    padding: 24px 18px 20px !important;
  }
}

@media (max-width: 575.98px) {
  .portfolio-card, .blog-card {
    padding: 18px 14px 16px !important;
    height: auto !important;
  }
  .portfolio-card h4, .blog-card h4 {
    font-size: 0.95em !important;
  }
  .portfolio-card p, .blog-card p {
    font-size: 0.88em !important;
  }
  .portfolio-tags {
    font-size: 0.7em !important;
  }
  .portfolio-outcome {
    font-size: 0.8em !important;
    padding: 6px 10px;
  }
  .portfolio-label {
    font-size: 0.7em !important;
  }
  .product-card {
    padding: 20px 14px 18px !important;
    height: auto !important;
  }
  .product-price {
    font-size: 1.3em !important;
  }
  .blog-card-category {
    font-size: 10px !important;
  }
}

/* ============================
   CONTAINER FIX: Remove double container nesting
   ============================ */
@media (max-width: 1199.98px) {
  #about > .container > .container {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ============================
   TYPOGRAPHY: Responsive headings
   ============================ */
@media (max-width: 575.98px) {
  h1, .h1 { font-size: 1.75rem !important; }
  h2, .h2 { font-size: 1.5rem !important; }
  h3, .h3 { font-size: 1.25rem !important; }
  h4, .h4 { font-size: 1.1rem !important; }
  h5, .h5 { font-size: 1rem !important; }
  h6, .h6 { font-size: 0.9rem !important; }
  
  p.big { font-size: 1em !important; }
  p { font-size: 0.95em; }
  
  .section.section-md {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
}

/* ============================
   BUTTONS: Full-width on mobile
   ============================ */
@media (max-width: 575.98px) {
  .button.button-nuka {
    width: 100%;
    display: block;
    text-align: center;
  }
  .rd-navbar-collapse .button {
    width: auto;
    display: inline-block;
  }
}

/* ============================
   MISC: Touch-friendly links & spacing
   ============================ */
@media (max-width: 991.98px) {
  .list-social li a {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Reduce excessive negative margins on mobile */
  .offset-xl-left--155 {
    margin-left: 0 !important;
  }
}

/* ============================
   PRELOADER: Faster on mobile
   ============================ */
@media (max-width: 991.98px) {
  .preloader-body {
    transform: scale(0.7);
  }
}

/* ============================
   ANIMATION: Reduce motion for users who prefer it
   ============================ */
@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;
  }
  .wow {
    visibility: visible !important;
    animation: none !important;
  }
}

/* ============================
   HERO SECTION (index.html)
   ============================ */
#about.section-inset-18 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 !important;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: heroBounce 2s infinite;
  opacity: 0.8;
}

@keyframes heroBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

@media (max-width: 991.98px) {
  #about.section-inset-18 {
    min-height: 80vh;
  }
}

@media (max-width: 575.98px) {
  #about.section-inset-18 {
    min-height: 60vh;
  }
}

/* ============================
   HERO CTA BUTTONS (index.html)
   ============================ */
.hero-cta {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

@media (max-width: 575.98px) {
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
}

/* ============================
   BUTTON CLEANUP (remove nuka overlay weirdness)
   ============================ */
.button-nuka .button-overlay {
  display: none !important;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.button-primary {
  background: #3F46AE;
  color: #ffffff;
  border-color: #3F46AE;
}

.button-primary:hover {
  background: #2a3080;
  border-color: #2a3080;
  color: #ffffff;
  text-decoration: none;
}

.button-outline {
  background: transparent;
  border-color: #3F46AE;
  color: #3F46AE;
}

.button-outline:hover {
  background: #3F46AE;
  color: #ffffff;
  text-decoration: none;
}

@media (max-width: 575.98px) {
  .button {
    width: 100%;
    max-width: 280px;
  }
}

/* ============================
   OUTLINE BUTTON (for hero)
   ============================ */

/* ============================
   ACCESSIBILITY: Focus indicators
   ============================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #3F46AE !important;
  outline-offset: 2px !important;
}

/* ============================
   DEBUG REMOVER: Kill horizontal scroll
   ============================ */
@media (max-width: 1199.98px) {
  .row {
    margin-left: 0;
    margin-right: 0;
  }
  .row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
  }
}
