/* Стили для карточки производителя */

.brand-catalog-title {
    font-size: 28px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    font-family: var(--theme-font-title-family), Arial, sans-serif;
    font-weight: var(--theme-font-title-weight);
    color: #333;
    text-align: center;
}

/* Обновляем стили для заголовков разделов */
.brand-section-header h3 {
    font-size: 20px;
}

.brand-section-wrapper {
    margin-bottom: 20px;
}

.brand-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.brand-section-title {
    font-size: 24px;
    margin: 0;
    font-family: var(--theme-font-title-family), Arial, sans-serif;
    font-weight: var(--theme-font-title-weight);
    color: #333;
    transition: color 0.3s ease;
}

.brand-section-header:hover .brand-section-title {
    color: #478dce;
}

.brand-section-title small {
    font-size: 14px;
    color: #666;
    margin-left: 10px;
    font-weight: 400;
    transition: color 0.3s ease;
}

.brand-section-header:hover .brand-section-title small {
    color: #478dce;
}

.brand-section-toggle {
    font-size: 20px;
    color: #666;
    user-select: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-section-header:hover .brand-section-toggle {
    color: #478dce;
}

.brand-section-content {
    margin-top: 20px;
}

.catalog-section-items {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-top: 20px;
}

/* Адаптивность для заголовка h2 */
@media (max-width: 992px) {
    .brand-catalog-title {
        font-size: 26px;
        margin-bottom: 25px;
        padding-bottom: 12px;
    }
}

@media (max-width: 768px) {
    .brand-catalog-title {
        font-size: 24px;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .brand-catalog-title {
        font-size: 22px;
        margin-bottom: 18px;
        padding-bottom: 8px;
    }
}

/* Адаптивность для заголовков разделов */
@media (max-width: 992px) {
    .brand-section-title {
        font-size: 22px;
    }
    
    .brand-section-title small {
        font-size: 13px;
    }
    
    .brand-section-toggle {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .brand-section-title {
        font-size: 20px;
    }
    
    .brand-section-title small {
        font-size: 12px;
        margin-left: 8px;
    }
    
    .brand-section-toggle {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    .brand-section-toggle {
        display: none;
    }
}

@media (max-width: 576px) {
    .brand-section-title {
        font-size: 18px;
    }
    
    .brand-section-title small {
        font-size: 11px;
        margin-left: 6px;
    }
}

@media (max-width: 400px) {
    .brand-section-title {
        font-size: 17px;
    }
    
    .brand-section-title small {
        font-size: 10px;
        margin-left: 4px;
    }
}

/* Адаптивная сетка товаров */
@media (max-width: 1200px) {
    .catalog-section-items {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (max-width: 992px) {
    .catalog-section-items {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .catalog-section-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 15px;
    }
}

@media (max-width: 576px) {
    .catalog-section-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 12px;
    }
}

@media (max-width: 400px) {
    .catalog-section-items {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Стили для карточки товара */
.catalog-item {
    border: 1px solid #eee;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .catalog-item {
        padding: 10px;
        border-radius: 6px;
    }
}

@media (max-width: 576px) {
    .catalog-item {
        padding: 8px;
        border-radius: 4px;
    }
}

.catalog-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-image {
    margin-bottom: 12px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .item-image {
        height: 90px;
        margin-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .item-image {
        height: 80px;
        margin-bottom: 8px;
    }
}

@media (max-width: 400px) {
    .item-image {
        height: 75px;
    }
}

.item-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 110px;
    max-height: 110px;
}

@media (max-width: 768px) {
    .item-image img {
        max-width: 90px;
        max-height: 90px;
    }
}

@media (max-width: 576px) {
    .item-image img {
        max-width: 80px;
        max-height: 80px;
    }
}

@media (max-width: 400px) {
    .item-image img {
        max-width: 75px;
        max-height: 75px;
    }
}

.item-name {
    margin-bottom: 10px;
    flex-grow: 1;
}

@media (max-width: 576px) {
    .item-name {
        margin-bottom: 8px;
    }
}

.item-name a {
    color: #333;
    text-decoration: none;
    line-height: 1.4;
    display: block;
    min-height: 36px;
    font-family: var(--theme-font-title-family), Arial, sans-serif;
    font-weight: var(--theme-font-title-weight);
    transition: color 0.3s ease;
}

@media (max-width: 992px) {
    .item-name a {
        font-size: 16px;
        min-height: 38px;
    }
}

@media (max-width: 768px) {
    .item-name a {
        font-size: 16px;
        min-height: 36px;
        line-height: 1.3;
    }
}

@media (max-width: 576px) {
    .item-name a {
        font-size: 16px;
        min-height: 34px;
        line-height: 1.3;
    }
}

@media (max-width: 400px) {
    .item-name a {
        font-size: 16px;
        min-height: 32px;
    }
}

.item-name a:hover {
    color: #478dce;
}

/* Стили для цены */
.item-price {
    margin-top: auto;
    padding-top: 8px;
}

@media (max-width: 576px) {
    .item-price {
        padding-top: 6px;
    }
}

.price-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .price-wrapper {
        gap: 6px;
    }
}

@media (max-width: 576px) {
    .price-wrapper {
        gap: 4px;
    }
}

.current-price {
    color: #333;
    font-size: 1.125rem;
    font-family: var(--theme-font-family), Arial, sans-serif;
    font-weight: 600;
    line-height: 1.2;
    order: 1;
}

@media (max-width: 992px) {
    .current-price {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .current-price {
        font-size: 0.9375rem;
    }
}

@media (max-width: 576px) {
    .current-price {
        font-size: 0.875rem;
    }
}

.old-price {
    color: #999;
    font-size: 0.75rem;
    font-weight: 400;
    font-family: var(--theme-font-family), Arial, sans-serif;
    text-decoration: line-through;
    order: 2;
}

@media (max-width: 768px) {
    .old-price {
        font-size: 0.6875rem;
    }
}

@media (max-width: 576px) {
    .old-price {
        font-size: 0.625rem;
    }
}

.price-on-request {
    color: #666;
    font-size: 0.875rem;
    font-family: var(--theme-font-family), Arial, sans-serif;
    font-weight: 500;
    width: 100%;
}

@media (max-width: 768px) {
    .price-on-request {
        font-size: 0.8125rem;
    }
}

@media (max-width: 576px) {
    .price-on-request {
        font-size: 0.75rem;
    }
}

/* Стили для контейнера когда есть старая цена */
.has-old-price .price-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .has-old-price .price-wrapper {
        gap: 6px;
    }
}

.has-old-price .current-price {
    order: 1;
}

.has-old-price .old-price {
    order: 2;
}

/* Кнопка "Показать еще" - ФИКС ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ */
.show-more-container {
    text-align: center;
    margin-top: 25px;
}

@media (max-width: 768px) {
    .show-more-container {
        margin-top: 20px;
    }
}

@media (max-width: 576px) {
    .show-more-container {
        margin-top: 15px;
    }
}

.show-more-btn {
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 20px;
    font-family: var(--theme-font-family), Arial, sans-serif;
    transition: all 0.3s ease;
    --button-height: 42px;
    font-size: .9375rem;
    line-height: 1em;
    font-weight: 600;
    text-transform: none;
    border-radius: var(--border-radius);
    justify-content: center;
    height: var(--button-height);
    white-space: nowrap;
    transition: background-color .1s ease;
    -moz-transition: background-color .1s ease;
    -ms-transition: background-color .1s ease;
    -o-transition: background-color .1s ease;
    -webkit-transition: background-color .1s ease;
    cursor: pointer;
    background: transparent;
    display: inline-block;
    min-width: 160px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .show-more-btn {
        --button-height: 38px;
        font-size: .875rem;
        padding: 6px 16px;
        min-width: 140px;
    }
}

@media (max-width: 576px) {
    .show-more-btn {
        --button-height: 36px;
        font-size: .8125rem;
        padding: 5px 12px;
        width: auto;
        max-width: 90%;
        min-width: 120px;
        white-space: normal;
        line-height: 1.2;
        word-break: break-word;
    }
}

@media (max-width: 400px) {
    .show-more-btn {
        --button-height: 34px;
        font-size: .75rem;
        padding: 4px 10px;
        min-width: 100px;
        max-width: 95%;
    }
}

/* Исправление для очень маленьких экранов */
@media (max-width: 320px) {
    .show-more-btn {
        font-size: .6875rem;
        padding: 3px 8px;
        min-width: 90px;
        max-width: 100%;
        line-height: 1.1;
    }
}

@media (max-width: 280px) {
    .show-more-btn {
        font-size: .625rem;
        padding: 3px 6px;
        min-width: 80px;
    }
}

/* Для экстремально маленьких экранов */
@media (max-width: 200px) {
    .show-more-btn {
        font-size: .5625rem;
        padding: 2px 4px;
        min-width: 70px;
        white-space: normal;
        word-break: break-all;
        line-height: 1;
        height: auto;
        --button-height: auto;
        min-height: 28px;
    }
}

.show-more-btn:hover {
    background: #478dce;
    color: white;
    border-color: #478dce;
}

.show-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Стили для загрузки */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading:after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.more-products-container {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .more-products-container {
        margin-top: 15px;
    }
}

/* Дополнительные адаптивные улучшения */
@media (max-width: 768px) {
    .brand-section-header {
        flex-wrap: nowrap;
        align-items: center;
    }
    
    .brand-section-title {
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 600px) {
    .brand-section-header {
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .brand-section-header {
        flex-wrap: wrap;
        align-items: center;
    }
}

@media (max-width: 400px) {
    .brand-section-header {
        align-items: center;
        padding-bottom: 8px;
    }
    
    .brand-section-title {
        margin-bottom: 0;
        display: flex;
        align-items: center;
    }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 320px) {
    .catalog-section-items {
        gap: 6px;
    }
    
    .catalog-item {
        padding: 6px;
    }
    
    .item-image {
        height: 65px;
    }
    
    .item-image img {
        max-width: 65px;
        max-height: 65px;
    }
    
    .item-name a {
        font-size: 14px;
        min-height: 28px;
        line-height: 1.2;
    }
    
    .brand-section-title {
        font-size: 16px;
    }
    
    .brand-section-title small {
        font-size: 9px;
    }
}

@media (max-width: 280px) {
    .catalog-item {
        padding: 4px;
    }
    
    .item-image {
        height: 60px;
    }
    
    .item-image img {
        max-width: 60px;
        max-height: 60px;
    }
    
    .item-name a {
        font-size: 13px;
        min-height: 26px;
    }
    
    .brand-section-title {
        font-size: 15px;
    }
}

@media (max-width: 200px) {
    .catalog-item {
        padding: 3px;
        border-radius: 2px;
    }
    
    .item-image {
        height: 50px;
        margin-bottom: 4px;
    }
    
    .item-image img {
        max-width: 50px;
        max-height: 50px;
    }
    
    .item-name a {
        font-size: 12px;
        min-height: 24px;
        line-height: 1.1;
    }
    
    .brand-section-title {
        font-size: 14px;
    }
    
    .brand-section-title small {
        font-size: 8px;
        margin-left: 2px;
    }
    
    .current-price {
        font-size: 0.75rem;
    }
    
    .old-price {
        font-size: 0.5rem;
    }
    
    .price-on-request {
        font-size: 0.625rem;
    }
}