/**
 * Multilingual Responsive CSS
 * Handles long words in Russian and German languages
 * Prevents layout breaking with overflow controls
 */

/* Global Text Overflow Prevention */
body {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Navigation Menu - Prevent overflow */
.main-nav ul li a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Russian Language - Long text handling */
html[lang="ru"] .main-nav ul li a {
    font-size: 13px;
    max-width: 140px;
}

html[lang="ru"] .btn-royal span,
html[lang="ru"] .royal-nav-btn span {
    font-size: 12px;
}

html[lang="ru"] .hero-title {
    font-size: 2.8rem;
    line-height: 1.2;
}

html[lang="ru"] .hero-subtitle {
    font-size: 1.3rem;
}

/* German Language - Long compound words */
html[lang="de"] .main-nav ul li a {
    font-size: 13px;
    max-width: 160px;
}

html[lang="de"] .btn-royal span,
html[lang="de"] .royal-nav-btn span {
    font-size: 12px;
}

html[lang="de"] .vehicle-features-item {
    font-size: 13px;
}

/* Button Text Overflow */
.btn-royal,
.royal-nav-btn,
.btn-primary,
.btn-secondary {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Titles - Prevent overflow */
.card-title,
.service-card h3,
.why-card h4 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Footer Navigation Button */
.royal-nav-btn {
    white-space: normal !important;
    text-align: center;
}

@media (max-width: 768px) {
    .royal-nav-btn {
        font-size: 11px !important;
        padding: 6px 12px !important;
    }
}

/* Form Labels and Placeholders */
label,
.form-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

input::placeholder,
textarea::placeholder,
select option {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Menu - Language specific */
@media (max-width: 991px) {
    html[lang="ru"] .main-nav ul li a,
    html[lang="de"] .main-nav ul li a {
        max-width: 100%;
        font-size: 14px;
    }
}

/* Table Cells - Prevent overflow */
table td,
table th {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Breadcrumb - Long paths */
.breadcrumb-item {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Alert Messages */
.alert,
.notification {
    word-break: break-word;
    hyphens: auto;
}

/* Modal Titles */
.modal-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90%;
}

/* Dropdown Menu Items */
.dropdown-item {
    white-space: normal;
    word-wrap: break-word;
}

/* Russian Cyrillic - Better readability */
html[lang="ru"] {
    letter-spacing: 0.3px;
}

html[lang="ru"] h1,
html[lang="ru"] h2,
html[lang="ru"] h3 {
    letter-spacing: 0.5px;
}

/* German - Compound words spacing */
html[lang="de"] {
    word-spacing: 1px;
}

/* Responsive Font Scaling */
@media (max-width: 576px) {
    html[lang="ru"] .hero-title {
        font-size: 2rem;
    }
    
    html[lang="de"] .hero-title {
        font-size: 2.2rem;
    }
    
    html[lang="ru"] .card-title,
    html[lang="de"] .card-title {
        font-size: 1rem;
    }
}

/* Ensure no horizontal scroll */
body,
html {
    overflow-x: hidden;
}

.container,
.container-fluid {
    overflow-x: hidden;
}
