body {
    margin: 0;
    padding: 0;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

.container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    gap: 3rem;
}

/* Для больших экранов: картинка и описание слева, характеристики справа */
.image-and-description {
    display: flex;
    flex-direction: column;
    width: 60%;
    max-width: 800px;
}

.newPage-Product-Img {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.carousel img {
    width: 100%;
    height: auto;
    display: none;
    border-radius: 10px;
}

.carousel img.active {
    display: block;
}
.contacts p {
    font-size: 1rem;
    font-weight: bold;
    margin: 0.2rem 0;
}
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 5px;
}

.carousel-arrow.left {
    left: 10px;
}

.carousel-arrow.right {
    right: 10px;
}

.thumbnails {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.75rem;
}

.thumbnails img {
    width: 80px;
    height: auto;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    border-radius: 5px;
}

.thumbnails img.active {
    opacity: 1;
    border-color: #333;
}

.product-description {
    margin-top: 2rem;
}

.product-description h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

.product-description p {
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: justify;
}

.newPage-Product-Info {
    width: 40%;
    padding: 2rem;
}

.newPage-Product-Info h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.newPage-Product-Info p {
    font-size: 1.5rem;
    margin: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.newPage-Product-Info p span.criterion {
    font-weight: bold;
    width: 50%;
}

.newPage-Product-Info p span.value {
    width: 50%;
    text-align: right;
}

header, footer {
    padding: 2rem;
    text-align: center;
}

.headerLogo, .socialLinks, .contacts, .workSchedule, .address {
    margin: 1rem 0;
}
footer .contacts p {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Адаптивность основной части */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        align-items: center;
        padding: 2rem;
        gap: 2rem;
    }
    .newPage-Product-Img {
        width: 100%;
        max-width: 600px;
        order: 1;
    }
    .newPage-Product-Info {
        width: 100%;
        padding: 1rem;
        order: 2;
    }
    .product-description {
        width: 100%;
        max-width: 600px;
        order: 3;
    }
    .newPage-Product-Info h2 {
        font-size: 2rem;
    }
    .newPage-Product-Info p {
        font-size: 1.3rem;
    }
    .product-description h3 {
        font-size: 1.3rem;
    }
    .product-description p {
        font-size: 1.1rem;
        line-height: 1.7;
    }
    .thumbnails img {
        width: 60px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    .newPage-Product-Img {
        max-width: 500px;
    }
    .newPage-Product-Info h2 {
        font-size: 1.8rem;
    }
    .newPage-Product-Info p {
        font-size: 1.2rem;
        margin: 0.8rem 0;
    }
    .product-description h3 {
        font-size: 1.2rem;
    }
    .product-description p {
        font-size: 1rem;
        line-height: 1.6;
    }
    .carousel-arrow {
        padding: 0.8rem;
        font-size: 1.2rem;
    }
    .thumbnails img {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
        gap: 1rem;
    }
    .newPage-Product-Img {
        max-width: 100%;
    }
    .newPage-Product-Info h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .newPage-Product-Info p {
        font-size: 1rem;
        margin: 0.6rem 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    .newPage-Product-Info p span.criterion,
    .newPage-Product-Info p span.value {
        width: 100%;
        text-align: left;
    }
    .product-description h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    .product-description p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    .carousel-arrow {
        padding: 0.5rem;
        font-size: 1rem;
    }
    .thumbnails img {
        width: 40px;
    }
}

/* HEADER: по умолчанию — одна строка (для средних и больших экранов) */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 1rem 2rem;
    gap: 1rem;
    white-space: nowrap;
    overflow: hidden;
}

.headerLogo {
    display: flex;
    align-items: center;
    flex-shrink: 1;
}

.headerLogo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.headerLogo img {
    margin-right: 0.5rem;
    max-height: 40px;
    height: auto;
}

.headerLogo h3 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.contacts {
    text-align: center;
    flex: 1 1 auto;
}

.contacts p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    font-weight: bold;
}

.ui-switch {
    flex-shrink: 1;
    display: inline-flex;
    align-items: center;
}

/* Центрирование контактов и постепенное уменьшение элементов */
@media (max-width: 1200px) {
    header {
        justify-content: center;
        gap: 0.5rem;
    }
    .headerLogo img {
        max-height: 35px;
    }
    .contacts p {
        font-size: 0.7rem;
        font-weight: bold;
    }
    .ui-switch {
        transform: scale(0.9);
    }
}

@media (max-width: 992px) {
    .headerLogo img {
        max-height: 30px;
    }
    .contacts p {
        font-size: 0.8rem;
        font-weight: bold;
    }
    .ui-switch {
        transform: scale(0.85);
    }
}

@media (max-width: 768px) {
    .headerLogo img {
        max-height: 28px;
    }
    .contacts p {
        font-size: 0.7rem;
        font-weight: bold;
    }
    .ui-switch {
        transform: scale(0.8);
    }
}

/* Price adjustments */
.newPage-Product-Img > div[style*="display: flex"] p {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 1rem;
    margin-left: 2rem;
}

.newPage-Product-Img > div[style*="display: flex"] p span.criterion {
    margin-right: 1rem;
    font-weight: bold;
}

.newPage-Product-Img > div[style*="display: flex"] p span.value {
    font-size: 1.2rem;
    font-weight: bold;
}

.newPage-Product-Info p span.criterion {
    font-size: 1.5rem;
    font-weight: bold;
}

.newPage-Product-Info p span.value {
    font-size: 1.5rem;
    font-weight: normal;
}

.newPage-Product-Info p:first-child span.criterion {
    margin-right: 1rem;
}

.newPage-Product-Info p:first-child span.value {
    font-weight: bold;
}

/* Adjust price and params for smaller devices */
@media (max-width: 1024px) {
    .newPage-Product-Img > div[style*="display: flex"] p span.criterion,
    .newPage-Product-Img > div[style*="display: flex"] p span.value {
        font-size: 1.3rem;
    }
    .newPage-Product-Info p span.criterion,
    .newPage-Product-Info p span.value {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .newPage-Product-Img > div[style*="display: flex"] p {
        margin-left: 1.5rem;
    }
    .newPage-Product-Img > div[style*="display: flex"] p span.criterion,
    .newPage-Product-Img > div[style*="display: flex"] p span.value {
        font-size: 1.2rem;
    }
    .newPage-Product-Info p span.criterion,
    .newPage-Product-Info p span.value {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .newPage-Product-Img > div[style*="display: flex"] {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .newPage-Product-Img > div[style*="display: flex"] p {
        margin-left: 0;
        justify-content: flex-start;
    }
    .newPage-Product-Img > div[style*="display: flex"] p span.criterion,
    .newPage-Product-Img > div[style*="display: flex"] p span.value {
        font-size: 1rem;
    }
    .newPage-Product-Info p span.criterion,
    .newPage-Product-Info p span.value {
        font-size: 1rem;
    }
}

/* === Small screens: логотип + название в 1 строке, контакты + переключатель на 2-й строке === */
@media (max-width: 524px) {
    header {
        flex-wrap: wrap;
        white-space: normal;
        overflow: visible;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        padding: 0.8rem 1rem;
    }

    .headerLogo {
        order: 1;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
        padding: 0;
    }
    .headerLogo img {
        max-height: 36px;
        margin-right: 0.5rem;
    }
    .headerLogo h3 {
        font-size: 1rem;
        margin: 0;
        white-space: nowrap;
    }

    .contacts {
        order: 2;
        width: auto;
        flex: 0 1 auto;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        gap: 0.4rem;
        text-align: center;
        margin: 0.25rem 0;
        font-size: 0.5rem;
        font-weight: bold;
    }

    .contacts p {
        margin: 0;
        line-height: 1.1;
    }

    .ui-switch {
        order: 2;
        margin-left: 0.25rem;
        transform: scale(0.95);
        display: inline-flex;
        align-items: center;
    }
}

/* === Footer contacts adaptation for mobile === */
@media (max-width: 524px) {
    footer .contacts {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
        font-size: 0.8rem;
    }
    footer .contacts p {
        font-size: 0.8rem;
        line-height: 1.2;
        margin: 0;
    }
}
