/*
 * Hammerite Responsive
 * Responsive layer for OpenCart 1.5 default theme.
 * Desktop layout stays close to the original; phone/tablet rules are below.
 */

/* Safe responsive defaults */
*, *:before, *:after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

#mobile-menu-toggle {
    display: none;
}

/* Prevent long content from forcing the whole page wider than the viewport. */
#content,
.box,
.box-content,
.tab-content,
.category-info,
.product-info,
.checkout-content,
.contact-info,
.sitemap-info {
    max-width: 100%;
}

/* Tablets and narrow desktop windows */
@media only screen and (max-width: 1000px) {
    #container {
        width: auto;
        max-width: 980px;
        margin-left: 10px;
        margin-right: 10px;
    }

    #menu > ul > li > a {
        padding-left: 7px;
        padding-right: 7px;
        font-size: 12px;
    }

    .slideshow,
    .slideshow .nivoSlider {
        max-width: 100% !important;
    }

    .banner img,
    .category-info img,
    #content img {
        max-width: 100%;
        height: auto;
    }
}

/* Logo size on desktop */
@media only screen and (min-width: 1025px),
       only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    #header #logo {
        width: 290px;
        height: auto;
    }

    #header #logo img {
        width: 290px !important;
        max-width: 290px !important;
        height: auto !important;
    }
}

/* Главная — вводный блок */
.home-intro {
    margin: 0 0 18px 0;
    padding: 0;
}

.home-intro p {
    margin: 0 0 12px 0;
    font-size: 15px;
    line-height: 22px;
}

.home-intro-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.home-intro-button {
    display: inline-block;
    padding: 10px 18px;
    background: #1687b8;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 14px;
    line-height: 20px;
    border-radius: 3px;
}

.home-intro-button:hover {
    text-decoration: none;
}

.home-intro-button-light {
    background: #444444;
}

/* Главная — выбор типа фарбы */
@media only screen and (min-width: 1025px),
       only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {

    .home-intro-buttons {
        justify-content: center;
    }

    .home-paint-choice {
        display: none;
        max-width: 850px;
        margin: 12px auto 20px auto;
        padding: 12px;
        background: #f5f5f5;
        border: 1px solid #dddddd;
        border-radius: 4px;
        box-sizing: border-box;
    }

    .home-paint-choice.open {
        display: block;
    }

    .home-paint-choice-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .home-paint-choice-grid a {
        display: block;
        padding: 11px 8px;
        background: #ffffff;
        border: 1px solid #dddddd;
        border-radius: 3px;
        text-align: center;
        text-decoration: none;
        font-size: 14px;
        line-height: 18px;
    }

    .home-paint-choice-grid a:hover {
        background: #eeeeee;
    }
}

/* Главная — преимущества магазина */
.home-trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 14px 0 18px 0;
}

.home-trust-item {
    display: block;
    padding: 10px 12px;
    background: #f5f5f5;
    border: 1px solid #dddddd;
    border-radius: 3px;
    text-align: center;
    text-decoration: none !important;
    box-sizing: border-box;
}

.home-trust-item strong {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
    line-height: 18px;
    color: #333333;
}

.home-trust-item span {
    display: block;
    font-size: 12px;
    line-height: 16px;
    color: #777777;
}

.home-trust-item:hover {
    background: #eeeeee;
}

/* Главная — информационный блок Hammerite */
.home-about-hammerite {
    margin: 25px 0 20px 0;
    padding: 18px 20px;
    background: #f5f5f5;
    border: 1px solid #dddddd;
    border-radius: 3px;
}

.home-about-hammerite h2 {
    margin: 0 0 10px 0;
    font-size: 21px;
    line-height: 27px;
    font-weight: normal;
}

.home-about-hammerite p {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 21px;
}

.home-about-link {
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
}

/* Phones */
@media only screen and (max-width: 767px),
       only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    
    .home-trust {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 12px 0 15px 0;
}

.home-about-hammerite {
    margin: 20px 0 15px 0;
    padding: 14px 12px;
}

.home-about-hammerite h2 {
    font-size: 19px;
    line-height: 24px;
}

.home-about-hammerite p {
    font-size: 14px;
    line-height: 20px;
}

.home-trust-item {
    padding: 8px 4px;
}

.home-trust-item strong {
    font-size: 12px;
    line-height: 15px;
}

.home-trust-item span {
    font-size: 11px;
    line-height: 14px;
}
    
    .home-paint-choice {
    display: none !important;
}
    
    .home-intro {
    margin-bottom: 16px;
}

.home-intro p {
    font-size: 15px;
    line-height: 21px;
}

.home-intro-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.home-intro-button {
    width: 100%;
    padding: 10px 5px;
    text-align: center;
    font-size: 14px;
    box-sizing: border-box;
}
    
    html {
        
        overflow-x: hidden;
    }

    body {
        min-width: 0;
        overflow-x: hidden;
    }

    body, td, th, input, textarea, select, a {
        font-size: 14px;
    }

    h1, .welcome {
        font-size: 24px;
        line-height: 1.25;
        margin-bottom: 14px;
    }

    h2 {
        font-size: 18px;
        line-height: 1.3;
    }

    #container {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0 10px;
    }

/* Главная — товарные карточки Рекомендовані */
.home-content-top .box-product > div {
    text-align: center;
}

/* Картинка по центру колонки */
.home-content-top .box-product .image {
    width: 100%;
    text-align: center;
}

.home-content-top .box-product .image img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Название товара */
.home-content-top .box-product .name {
    width: 100%;
    text-align: center;
}

.home-content-top .box-product .name a {
    display: block;
    text-align: center;
}

/* Цена */
.home-content-top .box-product .price {
    width: 100%;
    text-align: center;
}

/* Рейтинг */
.home-content-top .box-product .rating {
    width: 100%;
    text-align: center;
}

/* Кнопка До кошика */
.home-content-top .box-product .cart {
    width: 100%;
    text-align: center;
}

.home-content-top .box-product .cart input.button,
.home-content-top .box-product .cart a.button {
    float: none !important;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
}

    /* Header */
    #header {
        height: auto;
        min-height: 0;
        margin-bottom: 10px;
        padding: 10px 0 0 0;
        position: relative;
        z-index: 99;
    }

   #header #logo {
    position: static;
    width: 100%;
    text-align: center;
    margin: 0 auto 10px auto;
}

#header #logo a {
    display: block;
    width: 100%;
}

#header #logo img {
    display: block;
    width: 95% !important;
    max-width: 95% !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto;
}

    #language,
    #currency {
        position: static;
        display: inline-block;
        vertical-align: top;
        width: auto;
        min-width: 0;
        margin: 0 12px 10px 0;
        line-height: 26px;
    }

    #header #search {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin: 0 0 10px 0;
        z-index: 15;
    }

    #header .button-search {
        left: 0;
        top: 0;
        height: 38px;
        width: 40px;
    }

    #header #search input {
        width: 100%;
        height: 40px;
        padding: 6px 8px 6px 48px;
        font-size: 16px;
    }

    #header #cart {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        min-width: 0;
        margin: 0 0 10px 0;
        z-index: 30;
    }

    #header #cart .heading,
    #header #cart.active .heading {
        float: none;
        margin: 0;
        padding: 9px 12px;
        border: 1px solid #EEEEEE;
        border-radius: 4px;
        background: #FFFFFF;
    }

    #header #cart .heading h4 {
        display: inline-block;
        margin: 0 8px 0 0;
        font-size: 15px;
    }

    #header #cart .heading a {
        display: inline-block;
    }

    #header #cart .content {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        width: auto;
        min-width: 0;
        max-height: 70vh;
        overflow: auto;
        border-radius: 0 0 7px 7px;
        box-shadow: 0 2px 5px #CCCCCC;
    }

    #header #welcome {
        display: none;
    }

  #header .links {
    position: static;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    width: 100%;
    padding: 0;
    margin: 0 0 10px 0;
    gap: 0;
    font-size: 13px;
    text-align: center;
}

#header .links a {
    float: none;
    display: block;
    padding: 7px 3px;
    margin: 0 !important;
    font-size: 14px;
    line-height: 19px;
    border: 0 !important;
}

/* Первая строка */
#header .links a:nth-child(1),
#header .links a:nth-child(2) {
    grid-column: span 3;
}

/* Вторая строка */
#header .links a:nth-child(3),
#header .links a:nth-child(4),
#header .links a:nth-child(5) {
    grid-column: span 2;
}

    /* Mobile category menu */
    #menu {
        height: auto;
        min-height: 44px;
        padding: 0;
        margin-bottom: 14px;
        border-radius: 5px;
        overflow: visible;
    }

    #mobile-menu-toggle {
        display: block;
        width: 100%;
        min-height: 44px;
        padding: 10px 14px;
        border: 0;
        background: transparent;
        color: #FFFFFF;
        text-align: left;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
    }

    .mobile-menu-icon {
        display: inline-block;
        margin-right: 8px;
        font-size: 20px;
        line-height: 1;
        vertical-align: -1px;
    }

    #menu > ul {
        display: none;
        width: 100%;
        padding: 0 5px 7px 5px;
    }

    #menu.mobile-open > ul {
        display: block;
    }

    #menu > ul > li {
        float: none;
        width: 100%;
        padding: 0;
        border-top: 1px solid rgba(255,255,255,.16);
    }

    #menu > ul > li > a {
        padding: 11px 10px;
        margin: 0;
        font-size: 15px;
        line-height: 20px;
        border-radius: 0;
    }

    #menu > ul > li:hover > a {
        border-radius: 0;
    }

    #menu > ul > li > div,
    #menu > ul > li:hover > div {
        display: block;
        position: static;
        width: 100%;
        padding: 0 0 7px 14px;
        border: 0;
        border-radius: 0;
        background: rgba(0,0,0,.16);
    }

    #menu > ul > li > div > ul {
        display: block;
        width: 100%;
        padding: 0 !important;
    }

    #menu > ul > li ul + ul {
        padding-left: 0;
    }

    #menu > ul > li ul > li > a {
        min-width: 0;
        white-space: normal;
        padding: 8px 10px;
        line-height: 18px;
    }

    /* Main layout: side columns are hidden on phones; all categories remain in the top menu. */
    #column-left,
    #column-right {
        display: none;
    }

    #column-left + #column-right + #content,
    #column-left + #content,
    #column-right + #content,
    #content {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        min-height: 0;
    }

    .breadcrumb {
        line-height: 20px;
        overflow-wrap: anywhere;
    }

    /* Hide the large desktop slideshow on phones. */
    .slideshow {
        display: none !important;
    }

    /* General content */
    #content .content .left,
    #content .content .right,
    .contact-info .left,
    .contact-info .right,
    .sitemap-info .left,
    .sitemap-info .right,
    .login-content .left,
    .login-content .right,
    .checkout-content .left,
    .checkout-content .right {
        float: none;
        width: 100%;
        margin: 0 0 12px 0;
    }

    /* Forms */
    input[type='text'],
    input[type='password'],
    input[type='email'],
    input[type='tel'],
    textarea,
    select,
    input.large-field,
    select.large-field {
        max-width: 100%;
    }

    table.form,
    table.form tbody,
    table.form tr,
    table.form td {
        display: block;
        width: 100%;
    }

    table.form tr {
        margin-bottom: 10px;
    }

    table.form tr td:first-child {
        width: 100%;
        padding-bottom: 2px;
        font-weight: bold;
    }

    table.form td {
        padding-left: 0;
        padding-right: 0;
    }

    table.form input[type='text'],
    table.form input[type='password'],
    table.form textarea,
    table.form select,
    .checkout-content input[type='text'],
    .checkout-content input[type='password'],
    .checkout-content textarea,
    .checkout-content select {
        width: 100%;
        min-height: 38px;
        font-size: 16px;
    }

    textarea {
        min-height: 90px;
    }

    /* Category */
    /* On phones hide the category thumbnail and all images inserted into the category description. */
    .category-info .image,
    .category-info img {
        display: none !important;
    }

    .category-list ul,
    .manufacturer-list ul {
        float: none;
        width: 100%;
        margin: 0 0 8px 0;
        padding-left: 18px;
    }

   /* В мобильной категории сортировка, вид и количество товаров не показываются */
.product-filter {
    display: none !important;
}

    .product-compare {
        margin-bottom: 14px;
    }

 /* КАТЕГОРИЯ: один товар на строку */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    overflow: visible;
}

.product-grid > div,
#column-left + #column-right + #content .product-grid > div {
    width: 100%;
    margin: 0 0 24px 0;
    padding: 12px 8px 20px 8px;
    border-bottom: 1px solid #eeeeee;
}


/* ГЛАВНАЯ СТРАНИЦА — Рекомендовані: два товара в строку */
.box-product {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: calc(100% + 10px);
    margin-left: -5px;
    margin-right: -5px;
    overflow: visible;
}

.box-product > div,
#column-left + #column-right + #content .box-product > div {
    width: 50%;
    margin: 0 0 16px 0;
    padding: 0 5px;
}

/* Крупное изображение товара */
.product-grid .image,
.box-product .image {
    text-align: center;
    width: 100%;
    margin-bottom: 12px;
}

.product-grid .image img,
.box-product .image img {
    width: auto;
    height: auto;
    max-width: 210px;
    max-height: 230px;
}

/* Название товара */
.product-grid .name,
.box-product .name {
    margin-bottom: 7px;
}

.product-grid .price {
    font-size: 17px;
    line-height: 22px;
    margin: 7px 0;
}

.box-product .price {
    font-size: 14px;
    line-height: 18px;
}

/* Цена */
.product-grid .price {
    font-size: 17px;
    line-height: 22px;
    margin: 7px 0;
}

.box-product .price {
    font-size: 14px;
    line-height: 18px;
}
}

/* Старая/акционная цена */
.product-grid .price-old,
.box-product .price-old,
.product-grid .price-new,
.box-product .price-new {
    font-size: 17px;
}

/* Кнопка "До кошика" */
.product-grid .cart,
.box-product .cart {
    margin-top: 8px;
    margin-bottom: 7px;
}

.product-grid .cart input.button,
.product-grid .cart a.button,
.box-product .cart input.button,
.box-product .cart a.button {
    font-size: 16px;
    min-height: 38px;
    padding-left: 18px;
    padding-right: 18px;
}

/* Избранное и сравнение */
.product-grid .wishlist a,
.product-grid .compare a,
.box-product .wishlist a,
.box-product .compare a {
    font-size: 14px;
    line-height: 21px;
}

    .product-grid .image,
    .box-product .image {
        text-align: center;
        min-height: 0;
    }

    .product-grid .image img,
    .box-product .image img {
        width: auto;
        max-width: 100%;
        height: auto;
    }

    .product-grid .cart input.button,
    .product-grid .cart a.button,
    .box-product a.button {
        max-width: 100%;
    }

    .product-grid .wishlist a,
    .product-grid .compare a {
        font-size: 12px;
        line-height: 16px;
    }

    /* If list view is selected manually, keep it readable. */
    .product-list > div {
        padding-bottom: 12px;
    }

    .product-list .right {
        float: none;
        margin: 8px 0 0 0;
    }

    .product-list .image {
        max-width: 38%;
        margin-right: 10px;
    }

    .product-list .price {
        float: none;
        height: auto;
        margin: 6px 0;
        text-align: left;
    }

    /* Product page */
    .product-info {
        overflow: visible;
    }

    .product-info > .left {
        float: none;
        width: 100%;
        margin: 0 0 12px 0;
    }

    .product-info > .left + .right {
        margin-left: 0;
        width: 100%;
    }

    .product-info .image {
        float: none;
        width: 100%;
        padding: 8px;
        margin-bottom: 12px;
    }

    .product-info .image img {
        max-width: 100%;
        height: auto;
    }

    .product-info .image-additional {
        width: 100%;
        margin-left: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .product-info .image-additional a {
        float: none;
        margin: 0 0 8px 0;
    }

    .product-info .description,
    .product-info .price,
    .product-info .options,
    .product-info .cart {
        padding-left: 0;
        padding-right: 0;
    }

    .product-info .option select,
    .product-info .option input[type='text'],
    .product-info .option textarea {
        width: 100%;
        min-height: 38px;
        font-size: 16px;
    }

    .product-info .cart input[name='quantity'] {
        min-height: 38px;
        font-size: 16px;
    }

    .product-info .cart .links {
        display: block;
        margin-top: 10px;
        line-height: 24px;
    }

    .htabs {
        height: auto;
        min-height: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        border-bottom: 1px solid #DDDDDD;
    }

    .htabs a {
        float: none;
        display: block;
        margin: 0;
        padding: 8px 10px;
        font-size: 13px;
    }

    .tab-content {
        padding: 10px 0;
        overflow-x: auto;
    }
    
v
    .attribute,
    .compare-info {
        min-width: 620px;
    }

    /* Carts and checkout tables remain fully usable by horizontal scrolling. */
    .cart-info,
    .wishlist-info,
    .checkout-product,
    .compare-info {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cart-info table,
    .wishlist-info table,
    .checkout-product table {
        min-width: 650px;
    }

    .cart-total table {
        float: none;
        width: 100%;
    }

    .checkout-heading {
        padding: 11px 9px;
        font-size: 14px;
    }

    .checkout-content {
        overflow: visible;
    }

    /* Account/return pages */
    .return-name,
    .return-model,
    .return-quantity,
    .return-reason,
    .return-opened,
    .return-captcha {
        float: none;
        width: 100%;
        margin: 0 0 12px 0;
    }

    .order-list .order-content div,
    .return-list .return-content div,
    .download-list .download-content div {
        float: none;
        width: 100%;
        margin-bottom: 5px;
    }

    /* Buttons */
    .buttons {
        overflow: visible;
    }

    .buttons .left,
    .buttons .right,
    .buttons .center {
        float: none;
        text-align: center;
        width: 100%;
        margin: 6px 0;
    }

    .buttons a.button,
    .buttons input.button {
        display: inline-block;
        min-width: 150px;
        text-align: center;
    }

/* Нижняя карусель на мобильной версии не нужна */
div[id^="carousel"] {
    display: none !important;
}

/* Карусель перед футером на телефоне */
div[id^="carousel"] {
    display: none !important;
}

/* Footer: две колонки на мобильном */
#footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "information service"
        "extra account";
    column-gap: 18px;
    row-gap: 12px;
    padding: 15px 10px;
}

#footer .column {
    float: none;
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
}

#footer .footer-information {
    grid-area: information;
}

#footer .footer-extra {
    grid-area: extra;
}

#footer .footer-service {
    grid-area: service;
}

#footer .footer-account {
    grid-area: account;
}

#footer .column h3 {
    margin-top: 0;
    margin-bottom: 7px;
}

#footer .column ul {
    margin-bottom: 0;
}

#footer .column li {
    line-height: 18px;
}

#powered {
    text-align: center;
    line-height: 20px;
}
}

/* Very narrow phones */
@media only screen and (max-width: 420px) {
    #container {
        padding-left: 8px;
        padding-right: 8px;
    }

    #footer .column {
        float: none;
        width: 100%;
        padding-right: 0;
    }
}

/* Footer — 4 колонки на компьютере */
@media only screen and (min-width: 1025px),
       only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {

    #footer {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        grid-template-areas:
            "information service account extra" !important;
        column-gap: 25px;
        align-items: start;
    }

    #footer .column {
        float: none !important;
        width: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #footer .footer-information {
        grid-area: information;
    }

    #footer .footer-service {
        grid-area: service;
    }

    #footer .footer-account {
        grid-area: account;
    }

    #footer .footer-extra {
        grid-area: extra;
    }
}

/* =====================================================
   MOBILE: изображения и видео в описании товара
   защита от растягивания и выхода за экран
   ===================================================== */

@media only screen and (max-width: 767px),
       only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {

    #tab-description {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    /* КАРТИНКИ — сохраняем реальные пропорции */
    #tab-description img {
        display: block !important;
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        box-sizing: border-box !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* ВИДЕО */
    #tab-description iframe,
    #tab-description video,
    #tab-description embed,
    #tab-description object {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
        box-sizing: border-box !important;
        margin-left: auto !important;
        margin-right: auto !important;
        border: 0 !important;
    }

}