* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    background: linear-gradient(135deg, #1a3a4a 0%, #2d5f75 100%);
    color: white;
    min-height: 60px;
    padding-bottom: 5px;
    padding-top: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #1a3a4a;
    font-size: 24px;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.site-title {
    font-size: 20px;
    font-weight: 600;
    max-width: 600px;
    white-space: nowrap;
    overflow: visible;
}

.header-right {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.language-selector {
    display: flex;
}

.lang-select {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    width: 70px;
}

.lang-select:hover {
    border-color: white;
    background: rgba(255,255,255,0.3);
}

.lang-select:focus {
    outline: none;
    border-color: white;
    background: white;
    color: #1a3a4a;
}

.contact-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Main Content */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.hero {
    text-align: center;
    margin-bottom: 60px;
    background: linear-gradient(135deg, rgba(26,58,74,0.05) 0%, rgba(45,95,117,0.05) 100%);
    padding: 40px;
    border-radius: 12px;
    border-left: 5px solid #2d5f75;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #1a3a4a;
}

.hero p {
    font-size: 18px;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

/* Catalog Section */
.catalog-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
    color: #1a3a4a;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2d5f75;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Products Slider */
.products-slider-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 40px;
    position: relative;
}

.slider {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.slides {
    display: flex;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    padding: 30px;
    box-sizing: border-box;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
    max-width: 600px;
    margin: 0 auto;
}

.product-info {
    flex: 1;
}

.product-image {
    flex: 0 0 600px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.product-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.product-name {
    color: #1a3a4a;
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.product-model {
    font-family: monospace;
    background: #f0f5f7;
    padding: 4px 8px;
    border-radius: 4px;
    color: #2d5f75;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
}

.product-desc {
    line-height: 1.5;
    margin-bottom: 15px;
    color: #555;
}

.product-price {
    font-weight: 700;
    color: #2d5f75;
    font-size: 20px;
    margin-bottom: 20px;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(45,95,117,0.1);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
    transition: all 0.3s ease;
}

.slider-btn:hover {
    background: rgba(45,95,117,0.4);
}

.slider-btn.prev {
    left: 10px;
}

.slider-btn.next {
    right: 10px;
}

.slide-indicators {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    margin: 0 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.indicator.active {
    background: #2d5f75;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #2d5f75 0%, #1a3a4a 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45,95,117,0.3);
}

.btn-secondary {
    background: white;
    color: #2d5f75;
    border: 2px solid #2d5f75;
}

.btn-secondary:hover {
    background: #f0f5f7;
}

/* Modal for Detail View */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal.active {
    display: block;
}

/* Image Viewer Modal */
.image-viewer-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: hidden;
}

.image-viewer-modal.active {
    display: block;
}

.image-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-slide {
    max-width: 90%;
    max-height: 90%;
    display: none;
}

.image-viewer-slide.active {
    display: block;
}

.image-viewer-slide img,
.image-viewer-slide video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    transition: background 0.3s ease;
}

.image-viewer-nav:hover {
    background: rgba(0,0,0,0.8);
}

.image-viewer-prev {
    left: 20px;
}

.image-viewer-next {
    right: 20px;
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    transition: background 0.3s ease;
}

.image-viewer-close:hover {
    background: rgba(0,0,0,0.8);
}

.image-viewer-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.image-viewer-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.image-viewer-indicator.active {
    background: white;
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 0;
    width: 95%;
    max-width: 1000px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #1a3a4a 0%, #2d5f75 100%);
    color: white;
    position: sticky;
    top: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 30px;
}

.detail-section {
    margin-bottom: 30px;
}

.detail-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.detail-value {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.gallery-container {
    position: relative;
    margin-top: 15px;
}

.gallery {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scroll-behavior: smooth;
}

.gallery::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Safari, Opera */
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(45,95,117,0.1);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    transition: all 0.3s ease;
}

.gallery-nav:hover {
    background: rgba(45,95,117,0.4);
}

.gallery-nav.prev {
    left: -15px;
}

.gallery-nav.next {
    right: -15px;
}

.gallery-item {
    flex: 0 0 200px;
    aspect-ratio: 1;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    scroll-snap-align: start;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item video {
    background: #000;
}

.gallery-item.main-image {
    border: 3px solid #2d5f75;
}

.gallery-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    color: #999;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1a3a4a 0%, #2d5f75 100%);
    color: white;
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-title {
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section {
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-evenly;
    margin-top: 15px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.contact-link:hover {
    opacity: 0.8;
}

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.contact-icon svg[id="_x36_"] {
    background: none;
}

/* Quick Contact Widget */
.quick-contact {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.quick-contact-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-contact-btn:hover {
    transform: scale(1.1);
}

.telegram-btn {
    background: #0088cc;
}

.whatsapp-btn {
    background: #25D366;
}

.email-btn {
    background: transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .logo-section {
        flex: 1;
        min-width: 0;
    }

    .site-title {
        font-size: 16px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.2;
        max-height: 2.4em; /* 2 строки * 1.2 line-height */
        max-width: 100%;
    }

    .header-right {
        flex-direction: row;
        width: auto;
        flex-shrink: 0;
    }

    .contact-info {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }

    .hero {
        display: none;
    }

    .slide {
        padding: 10px;
    }

    .product-card {
        padding: 10px;
        min-height: auto;
    }

    .product-image {
        height: 250px;
    }

    .product-name {
        font-size: 20px;
        line-height: 1.2;
        margin-bottom: 8px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .product-info {
        margin-top: 20px;
    }

    .product-image {
        margin-bottom: 10px;
    }

    .catalog-title {
        font-size: 24px;
    }

    .modal-content {
        width: 98%;
    }

    .modal-body {
        padding: 15px;
    }

    .gallery {
        gap: 10px;
    }

    .gallery-item {
        flex: 0 0 150px;
    }

    .contact-links {
        flex-direction: column;
    }

    .quick-contact {
        bottom: 20px;
        right: 20px;
        flex-direction: column;
    }

    .quick-contact-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .header-container {
        gap: 3px;
        padding: 0 8px;
    }

    .logo-section {
        flex: 1;
        min-width: 0;
        margin-right: 5px;
    }

    .site-title {
        -webkit-line-clamp: unset;
        max-height: none;
        display: block;
        overflow: visible;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        min-height: 2.4em;
        font-size: 18px;
        line-height: 1.3;
        max-width: 100%;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
    }

    .lang-select {
        padding: 5px 10px;
        font-size: 11px;
        width: 55px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .catalog-title {
        font-size: 20px;
    }

    .product-name {
        font-size: 18px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .footer-title {
        font-size: 18px;
    }
}

/* Для экранов меньше 320px - делаем текст многострочным, сохраняя высоту header */
@media (max-width: 320px) {
    .site-title {
        -webkit-line-clamp: unset;
        max-height: none;
        display: block;
        overflow: visible;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        min-height: 2.4em;
        font-size: 18px;
        line-height: 1.3;
        max-width: 100%;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
    }
    
    .header-container {
        min-height: 40px;
        align-items: flex-start;
    }
    
    .logo-section {
        padding-top: 5px;
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Desktop layout for product cards */
@media (min-width: 769px) {
    .product-card {
        display: flex;
        gap: 20px;
        align-items: flex-start;
        max-width: none;
    }
}

/* Engineering Design Elements */
.engineering-accent {
    position: relative;
}

.engineering-accent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(45deg, transparent 48%, rgba(45,95,117,0.05) 49%, rgba(45,95,117,0.05) 51%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(45,95,117,0.05) 49%, rgba(45,95,117,0.05) 51%, transparent 52%);
    background-size: 20px 20px;
    pointer-events: none;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.success-message {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

/* Share Modal Styles */
.share-modal {
    display: none;
    position: fixed;
    z-index: 2500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.share-modal.active {
    display: block;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.share-option {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.share-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.qr-code-container {
    margin: 20px 0;
}

#qrCode {
    margin: 15px 0;
}

.share-link-display {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    word-break: break-all;
    font-family: monospace;
    font-size: 11px;
    color: #666;
    border: 1px solid #e9ecef;
}

/* Contact links in modal */
.modal .contact-links {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: space-evenly;
    padding: 10px 0;
    margin-top: 15px;
}

.modal .contact-link {
    flex: 0 0 auto;
    min-width: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.modal .contact-icon {
    width: 36px;
    height: 36px;
    margin: 0;
}

.modal .contact-link span {
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}
