/* Global typography overrides for front-end (design_1) */
html, body {
    font-size: 15px !important; /* was 16px */
    line-height: 1.7;
}

/* Hero: fix upper CTA alignment (RTL + mobile) */
.two-columns-hero-section__content > a > div {
    align-items: center;
}

@media (max-width: 576px) {
    .two-columns-hero-section__content { text-align: center; }
    .two-columns-hero-section__content > a { display: block; }
    .two-columns-hero-section__content > a > div {
        margin: 0 auto;
    }
}

/* Make the small primary badge padding symmetrical in RTL */
.rtl .two-columns-hero-section__content .rounded-16.bg-primary {
    padding-right: 10px !important;
    padding-left: 10px !important;
}

/* Fine-tune sizes by viewport to avoid overflow on small screens */
@media (max-width: 380px) {
    html, body { font-size: 14px !important; }
}
@media (min-width: 1200px) {
    html, body { font-size: 16px !important; }
}

body {
    font-weight: 500;
    overflow-x: hidden; /* prevent accidental horizontal scroll */
}

/* Enlarge header logos (desktop + mobile) */
.theme-header-1__logo,
.theme-header-2__logo {
    height: 64px !important;
}

.theme-header-1__logo img,
.theme-header-2__logo img {
    height: 100% !important;
}

.theme-header-mobile__logo {
    height: 48px !important;
}

.theme-header-mobile__logo img {
    height: 100% !important;
}

/* Mobile header links (replace hamburger on small screens) */
.pm-mobile-links {
    display: none;
}

@media (max-width: 768px) {
    .theme-header-mobile__sticky {
        flex-wrap: nowrap !important;
    }

    .pm-mobile-menu-toggle {
        display: none !important;
    }

    .pm-mobile-links {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1;
        min-width: 0;
        margin-inline-start: 12px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pm-mobile-links::-webkit-scrollbar {
        display: none;
    }

    .pm-mobile-link {
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        color: var(--dark);
        font-size: 14px;
        line-height: 1.4;
        padding: 6px 0;
        text-decoration: none;
    }

    .pm-mobile-link:hover {
        color: var(--primary);
        text-decoration: none;
    }

    .pm-mobile-link.active {
        color: var(--primary);
        font-weight: 700;
    }

    .rtl .pm-mobile-links {
        direction: rtl;
    }
}

/* Safer wrapping for typical text containers */
.card .card-title,
.card .card-text,
.card .card-body,
.breadcrumb,
.modal-body,
.dropdown-menu,
.table td, .table th {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Tables: avoid layout blow-ups */
.table { table-layout: fixed; }

/* Allow UI labels to wrap if narrow */
.btn,
.badge,
.nav-link,
.dropdown-item {
    white-space: normal;
}

/* Mobile layout polish and fixes */
@media (max-width: 991px) {
    /* Ensure safe side padding */
    .container, .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Prevent content overflow */
    img, video, iframe {
        max-width: 100%;
        height: auto;
    }

    /* Wrap long text and UI labels */
    h1, h2, h3, h4, h5, h6,
    p, a, span,
    .btn, .badge, .nav-link {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Add vertical spacing between stacked columns */
    .row > [class*="col-"] {
        margin-bottom: 16px;
    }

    /* Make touch targets comfortable */
    .form-control, .custom-select, .btn {
        min-height: 44px;
    }

    /* Hide decorative floating/overlay elements that can overlap on small screens */
    [class*="__floating-"],
    [class*="-floating-"],
    [class*="__overlay-img"],
    [class*="-overlay-img"] {
        display: none !important;
    }

    /* Let flex rows wrap to avoid collisions */
    .container .d-flex,
    .container-fluid .d-flex {
        flex-wrap: wrap;
    }

    /* Footer newsletter: avoid overlay/collision by disabling absolute positioning */
    .theme-footer-1__newsletter {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        margin-top: 16px;
    }

    .theme-footer-1.has-newsletter .theme-footer-1__section {
        padding-top: 32px !important;
        height: auto !important;
    }

    .theme-footer-1__newsletter-mask {
        display: none !important;
    }
}
