﻿.old-price {
    opacity: 0.7;
    font-size: 0.9rem;
}

.new-price {
    font-size: 1rem;
}

.badge.bg-danger.small {
    vertical-align: middle;
    padding: 0.5rem 0.7rem;
    border-radius: 0.4rem;
}

.card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    height: 100%;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

    .card-body form {
        margin-top: auto;
    }


.btn-shop {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 0.75rem;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
    color: white;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,123,255,0.4);
    }


.ribbon {
    position: absolute;
    top: 12px;
    left: -35px;
    width: 140px;
    text-align: center;
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    transform: rotate(-45deg);
    padding: 5px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(0,0,0,0.2);
    pointer-events: none;
}


.btn-black-friday {
    display: inline-block;
    background: linear-gradient(135deg, #000, #333);
    width: 100%;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1.1rem;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    transition: all 0.3s ease;
} 

.col-4 {
    margin-bottom: 1rem;
}

.card-img-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: contain; /* сохраняет пропорции */
    transition: transform 0.3s ease;
}

/* Стили для десктопного меню категорий */
.product-category-menu {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.15rem;
    position: sticky;
    top: 100px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

    .product-category-menu a {
        display: block;
        padding: 0.45rem 1rem;
        color: #495057;
        text-decoration: none;
        border-radius: 0.5rem;
        transition: all 0.3s ease;
        font-weight: 500;
    }

        .product-category-menu a.active {
            background: linear-gradient(135deg, #007bff, #0056b3);
            color: white;
            box-shadow: 0 2px 8px rgba(0,123,255,0.3);
        }

@media (max-width: 991.98px) and (min-width: 769px) {
    .card-img-wrapper {
        height: 180px; /* меньше высота на телефонах */
    }
    .col-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .product-category-menu {
        padding: 1rem;
        top: 90px;
    }

        .product-category-menu a {
            padding: 0.6rem 0.8rem;
            font-size: 0.9rem;
        }

    .sort-links a {
        font-size: 0.85rem;
        padding: 0.5rem 0.7rem;
        margin: 0.15rem;
    }
}

@media (max-width: 768px) {
    .black-friday-block {
        margin-bottom: 1rem;
    }

    .btn-black-friday {
        font-size: 1.3rem;
        padding: 1rem;
        border-radius: 1rem;
    }

    /* Исправление горизонтального скролла */
    .container {
        max-width: 100%;
        overflow-x: hidden;
        padding-left: 15px;
        padding-right: 15px;
    }

    body {
        overflow-x: hidden;
    }

    .col-9 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

        .col-9 > .row {
            justify-content: center !important;
            margin: 0 auto !important;
            flex-wrap: wrap;
        }

            .col-9 > .row > .col-4 {
                flex: 0 0 100% !important; /* одна карточка в ряд */
                max-width: 100% !important;
                display: flex;
                justify-content: center;
                padding: 0.5rem;
                margin-bottom: 1.5rem;
            }

                .col-9 > .row > .col-4 > .card {
                    width: 100%;
                    max-width: 400px; /* ограничим ширину, чтобы карточка была красивой по центру */
                }


    .product-category-menu {
        display: none;
    }

    /* Мобильные категории */
    .mobile-categories {
        display: block !important;
        margin-bottom: 1rem;
    }

        .mobile-categories .dropdown-toggle {
            padding: 0.75rem 1rem;
            font-size: 1.3rem;
            background: linear-gradient(135deg, #6c757d, #495057);
            color: white;
            border: none;
            border-radius: 0.75rem;
            width: 100%;
        }

    /* Улучшаем отображение сортировки на мобильных */
    .sort-links {
        text-align: center;
        margin-bottom: 1.5rem;
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 0.75rem;
        border: 1px solid #e9ecef;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        .sort-links a {
            display: inline-block;
            margin: 0.3rem;
            padding: 0.6rem 1rem;
            background: white;
            border: 1px solid #dee2e6;
            border-radius: 0.5rem;
            font-size: 0.85rem;
            font-weight: 500;
            color: #495057;
            text-decoration: none;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

    #perpageform {
        background: #f8f9fa;
        padding: 1rem;
        border-radius: 0.75rem;
        border: 1px solid #e9ecef;
        width: 100%;
    }

        #perpageform .row {
            flex-wrap: nowrap;
            align-items: center;
            justify-content: center;
            margin: 0;
        }

        #perpageform .form-label {
            margin: 0 !important;
            margin-right: 0.75rem !important;
            font-size: 0.9rem;
            font-weight: 500;
            color: #495057;
        }

    #perpage {
        font-size: 0.9rem;
        min-width: 80px;
        border-radius: 0.5rem;
        border: 1px solid #ced4da;
    }

    /* Карточки товаров */
    .card {
        margin-bottom: 1.5rem;
        border-radius: 1rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .card-img-top {
        height: 300px;
        object-fit: contain;
        padding: 1.5rem;
        margin: 0 auto;
        display: block;
    }

    .card-body {
        padding: 1.25rem;
        text-align: center;
    }

    .card-text {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    .card-body .btn {
        display: block;
        margin: 0 auto;
    }

    .ribbon {
        font-size: 0.7rem;
        padding: 5px 0;
        left: -40px;
        width: 150px;
        top: 12px;
    }

    /* Улучшаем кнопки */
    .btn-shop {
        padding: 0.75rem 1.5rem;
        font-size: 1.3rem;
        border-radius: 0.75rem;
        font-weight: 500;
    }

    .btn-primary {
        background: linear-gradient(135deg, #007bff, #0056b3);
        border: none;
        box-shadow: 0 2px 8px rgba(0,123,255,0.3);
    }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,123,255,0.4);
        }

    .breadcrumb {
        padding: 0.75rem;
        border-radius: 0.75rem;
        margin-bottom: 1rem;
    }

    .breadcrumb-item {
        font-size: 0.9rem;
    }

    /* Пагинация */
    .pagination {
        margin-top: 2rem;
        justify-content: center;
    }

    .page-link {
        padding: 0.85rem 0.70rem;
        margin: 0.2rem;
        border-radius: 0.5rem;
        border: 1px solid #dee2e6;
    }

    .page-item.active .page-link {
        background: linear-gradient(135deg, #007bff, #0056b3);
        border-color: #007bff;
    }
}


@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .sort-links {
        margin-left: -5px;
        margin-right: -5px;
        padding: 0.75rem;
    }

        .sort-links a {
            font-size: 1.15rem;
            padding: 0.5rem 0.8rem;
            margin: 0.2rem;
        }

    #perpageform .row {
        flex-direction: column;
        gap: 0.5rem;
    }

    #perpageform .form-label {
        margin-right: 0 !important;
        text-align: center;
    }

    .card-img-top {
        height: 300px;
    }

    .card-body {
        padding: 1rem;
    }

    .ribbon {
        font-size: 1.1rem;
        left: -45px;
        width: 140px;
        top: 10px;
    }

    /* Улучшаем отображение цен */
    .old-price, .new-price {
        font-size: 1.3rem;
    }

    .badge.bg-danger.small {
        padding: 0.4rem 0.6rem;
        font-size: 1.45rem;
    }

    /* Еще лучше центрируем карточки */
    .col-4 > .card {
        max-width: 300px;
    }
}

@media (min-width: 769px) {
    .mobile-categories {
        display: none !important;
    }
}

a, button, .card, .form-select {
    transition: all 0.3s ease;
}

.dropdown-menu {
    border-radius: 0.75rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

    .dropdown-item.active,
    .dropdown-item:active {
        background: linear-gradient(135deg, #007bff, #0056b3);
        color: white;
    }
