/* Global UX enhancements */
:root {
    --content-max: 1180px;
    --section-y: clamp(56px, 7vw, 96px);
    --card-radius: 18px;
}

#site-header:empty {
    min-height: 70px;
}

body {
    overflow-x: hidden;
}

section.container,
.detailed-services-container,
.visit-form-wrap,
.amc-container .container {
    width: min(100%, var(--content-max));
}

section.container {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
}

.section-title {
    position: relative;
    margin-bottom: 32px;
    text-align: center;
}

.section-title::after {
    content: "";
    display: block;
    width: 72px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

header {
    gap: 18px;
}

header nav {
    flex: 1;
    min-width: 0;
}

.nav-links {
    align-items: center;
    justify-content: center;
    gap: clamp(0.7rem, 1.4vw, 1.6rem);
    flex-wrap: wrap;
}

.nav-links li a {
    white-space: nowrap;
    font-size: clamp(0.88rem, 0.95vw, 1rem);
}

header .nav-controls {
    flex-shrink: 0;
}

.btn {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.2;
}

.btn:not(.btn-primary):not(.lang-toggle-btn) {
    background: var(--background-pure);
    color: var(--primary-color);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn:not(.btn-primary):not(.lang-toggle-btn):hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.premium-card,
.service-card,
.stat-card,
.service-row,
.amc-form,
.amc-result,
.visit-form {
    border-radius: var(--card-radius) !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94)) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07) !important;
}

.service-card {
    padding: 28px;
    min-height: 190px;
}

.service-card i,
.m-feature i {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(42, 82, 136, 0.1);
    color: var(--primary-color);
    margin-bottom: 14px;
}

.service-card h3,
.m-feature h3 {
    margin-bottom: 10px;
}

.service-card p,
.m-feature p,
.service-details p {
    color: var(--text-muted);
}

.services-grid {
    gap: clamp(18px, 2.2vw, 30px);
}

.services-hero,
.about-hero,
.portfolio-header,
.blog-hero,
.store-hero,
.help-hero,
.calculator-header {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.services-hero::after,
.about-hero::after,
.portfolio-header::after,
.blog-hero::after,
.store-hero::after,
.help-hero::after,
.calculator-header::after {
    content: "";
    position: absolute;
    inset: auto -10% -35% -10%;
    height: 70%;
    background: radial-gradient(circle, rgba(201, 154, 54,0.22), transparent 60%);
    pointer-events: none;
}

table {
    border-spacing: 0;
}

table th,
table td {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

table tbody tr:nth-child(even) {
    background: rgba(42, 82, 136, 0.035);
}

table tbody tr:hover {
    background: rgba(201, 154, 54, 0.08);
}

details {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

details[open] {
    border-color: rgba(42, 82, 136, 0.35) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

summary {
    cursor: pointer;
}

.footer-grid {
    text-align: start;
}

.footer-links li {
    line-height: 1.5;
}

.footer-links a {
    border-radius: 8px;
}

.footer-bottom {
    margin-top: 10px;
}

.quote-container .form-control,
.calculator-header + .calc-container input,
.calculator-header + .calc-container textarea {
    background: var(--background-pure);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.select-card {
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.select-card:hover,
.select-card.selected {
    transform: translateY(-2px);
    border-color: var(--secondary-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.filter-btn {
    font-family: inherit;
}

html[dir="ltr"] .nav-links a.active {
    border-bottom: 2px solid var(--secondary-color);
}

html[dir="rtl"] .nav-links a.active {
    border-bottom: 2px solid var(--secondary-color);
}

html[dir="ltr"] body {
    direction: ltr;
    text-align: left;
}

html[dir="ltr"] header,
html[dir="ltr"] nav,
html[dir="ltr"] .nav-links,
html[dir="ltr"] .nav-controls,
html[dir="ltr"] .footer-grid,
html[dir="ltr"] .services-grid,
html[dir="ltr"] .portfolio-grid,
html[dir="ltr"] .dashboard-grid,
html[dir="ltr"] .form-row,
html[dir="ltr"] .maintenance-features,
html[dir="ltr"] .stats-grid {
    direction: ltr;
}

html[dir="ltr"] .slide-content,
html[dir="ltr"] .section-title,
html[dir="ltr"] .quote-header,
html[dir="ltr"] .calculator-header,
html[dir="ltr"] .services-hero,
html[dir="ltr"] .portfolio-header,
html[dir="ltr"] .about-hero,
html[dir="ltr"] .blog-hero,
html[dir="ltr"] .store-hero,
html[dir="ltr"] .help-hero {
    direction: ltr;
}

html[dir="ltr"] .service-row {
    direction: ltr;
}

html[dir="ltr"] .service-row.reverse {
    flex-direction: row-reverse;
}

html[dir="ltr"] .footer-contact-list i,
html[dir="ltr"] .footer-links i {
    margin-left: 0;
    margin-right: 10px;
}

html[dir="ltr"] .chatbot-header,
html[dir="ltr"] .chatbot-body,
html[dir="ltr"] .chat-msg {
    direction: ltr;
    text-align: left;
}

html[dir="rtl"] .chatbot-header,
html[dir="rtl"] .chatbot-body,
html[dir="rtl"] .chat-msg {
    direction: rtl;
    text-align: right;
}

html[dir="ltr"] .footer-col h3::after {
    right: auto;
    left: 0;
}

html[dir="ltr"] .footer-links a:hover {
    padding-right: 0;
    padding-left: 8px;
}

html[dir="ltr"] .timeline-item.right,
html[dir="ltr"] .timeline-item.left {
    direction: ltr;
}

html[dir="ltr"] input,
html[dir="ltr"] textarea,
html[dir="ltr"] select {
    direction: ltr;
    text-align: left;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    direction: rtl;
    text-align: right;
}

@media (max-width: 1200px) {
    header {
        flex-wrap: wrap;
    }

    header nav {
        order: 3;
        flex-basis: 100%;
    }

    .nav-links {
        justify-content: center;
        row-gap: 8px;
    }
}

@media (max-width: 992px) {
    header {
        flex-wrap: nowrap;
    }

    header nav {
        order: initial;
        flex-basis: auto;
        flex: 0;
    }

    .nav-links {
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        flex-wrap: nowrap;
    }

    .nav-links li a {
        color: var(--text-dark);
        white-space: normal;
    }

    html[dir="ltr"] .nav-links {
        left: -100%;
        right: auto;
    }

    html[dir="ltr"] .nav-links.active {
        left: 0;
        right: auto;
    }
}

@media (max-width: 768px) {
    section.container,
    .detailed-services-container,
    .visit-form-wrap {
        padding-left: 16px;
        padding-right: 16px;
    }

    .service-card {
        min-height: auto;
        padding: 22px;
    }

    table {
        min-width: 640px;
    }

    .footer-grid {
        gap: 28px;
    }

    header .nav-controls .nav-consult-btn,
    header .nav-controls .nav-portal-btn {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
