/* UX/UI polish layer for MediAdvance clone.
   Scope: visual refinements only. No content or structural changes. */

:root {
  --ma-accent: #3cb9b3;
  --ma-accent-strong: #2f9f99;
  --ma-text: #1d2c37;
  --ma-muted: #5f717d;
  --ma-border: rgba(28, 48, 66, 0.12);
  --ma-radius: 14px;
  --ma-shadow-sm: 0 8px 22px rgba(18, 34, 50, 0.08);
  --ma-shadow-md: 0 14px 30px rgba(18, 34, 50, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p,
li {
  color: var(--ma-muted);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: 0.01em;
}

#masthead,
.ast-theme-transparent-header #masthead {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid var(--ma-border);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}

.main-header-menu .menu-link {
  position: relative;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.main-header-menu .menu-link::after {
  content: "";
  position: absolute;
  left: 10%;
  bottom: 0.35rem;
  width: 80%;
  height: 2px;
  background: var(--ma-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}

.main-header-menu .menu-link:hover::after,
.main-header-menu .current-menu-item .menu-link::after,
.main-header-menu .current-page-ancestor .menu-link::after,
.main-header-menu .current-menu-ancestor .menu-link::after {
  transform: scaleX(1);
}

.ast-builder-grid-row-container,
.ast-container {
  max-width: 1180px;
}

.elementor-section.elementor-section-boxed > .elementor-container {
  max-width: min(1180px, calc(100% - 2.5rem));
}

.elementor-widget-image img,
.elementor-widget-google_maps iframe,
.elementor-widget-google_maps .elementor-widget-container {
  border-radius: var(--ma-radius);
  box-shadow: var(--ma-shadow-sm);
}

.elementor-widget-icon-box .elementor-widget-container,
.elementor-widget-testimonial .elementor-testimonial-content,
.elementor-accordion .elementor-tab-title,
.elementor-accordion .elementor-tab-content {
  border-radius: 12px;
}

.elementor-widget-icon-box .elementor-widget-container:hover,
.elementor-widget-testimonial .elementor-testimonial-content:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--ma-shadow-md);
}

.elementor-button,
.wp-element-button,
button,
input[type="submit"] {
  border-radius: 12px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.elementor-button:hover,
.wp-element-button:hover,
button:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(59, 185, 177, 0.26);
}

.elementor-button:focus-visible,
.wp-element-button:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(60, 185, 179, 0.34);
  outline-offset: 2px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  border-radius: 10px !important;
  border-color: #d5e0e8 !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--ma-accent) !important;
  box-shadow: 0 0 0 3px rgba(60, 185, 179, 0.16);
}

#content [id] {
  scroll-margin-top: 110px;
}

@media (max-width: 1024px) {
  .elementor-section.elementor-section-boxed > .elementor-container {
    max-width: calc(100% - 2rem);
  }
}

@media (max-width: 767px) {
  #masthead,
  .ast-theme-transparent-header #masthead {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.97) !important;
  }

  .elementor-section.elementor-section-boxed > .elementor-container {
    max-width: calc(100% - 1.5rem);
  }

  .main-header-menu .menu-link::after {
    bottom: 0.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
