:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --primary-lighter: #4cc9f0;
    --primary-lightest: #e0fbfc;
    --secondary: #f72585;
    --success: #06d6a0;
    --danger: #f94144;
    --warning: #ffd166;
    --gray-light: #f8f9fa;
    --gray-border: #e9ecef;
    --text-dark: #212529;
    --text-medium: #6c757d;
    --text-light: #adb5bd;
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-md: 0 12px 30px rgba(0,0,0,0.12);
    --shadow-lg: 0 25px 50px rgba(0,0,0,0.2);
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --gradient: linear-gradient(135deg, var(--primary), var(--primary-light));
    --card-gradient: linear-gradient(135deg, #ffffff, #f9faff);
    --border-radius: 16px;
    --card-height: 470px;
    --image-height: 200px;
}

.rm-page-wrapper {
    padding-top: 90px;
    padding-bottom: 30px;
    min-height: calc(100vh - 100px);
    background: linear-gradient(to bottom, #f0f4ff, #ffffff);
}

@media (max-width: 992px) {
    .rm-page-wrapper {
        padding-top: 80px;
    }
}

@media (max-width: 768px) {
    .rm-page-wrapper {
        padding-top: 70px;
    }
}

@media (max-width: 576px) {
    .rm-page-wrapper {
        padding-top: 60px;
    }
}

.rm-products-container {
    padding-top: 0;
    padding-bottom: 20px;
    overflow-x: hidden;
}

.rm-products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 25px;
    padding: 25px 0;
    animation: slideIn 0.5s ease-out;
    max-width: 900px;
    margin: 0 auto;
    justify-content: center;
    padding-right: 400px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.rm-product-card {
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: var(--card-height);
    border: none;
    position: relative;
    transform: translateY(0);
    perspective: 1000px;
    transform-style: preserve-3d;
    will-change: transform;
    backface-visibility: hidden;
    max-width: 300px;
}

.rm-product-card:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 0 20px 40px rgba(67, 97, 238, 0.15);
}

.rm-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 40%, rgba(67, 97, 238, 0.03) 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
    pointer-events: none;
}

.rm-product-card:hover::before {
    opacity: 0.8;
}

.rm-product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rm-product-badge .badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 30px;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    animation: badgePulse 2s infinite;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    z-index: 2;
    backdrop-filter: blur(4px);
    background-color: rgba(255, 255, 255, 0.85);
}

.badge.bg-success {
    background: linear-gradient(45deg, var(--success), #06b48d) !important;
    color: white;
}

.badge.bg-danger {
    background: linear-gradient(45deg, var(--secondary), #e51770) !important;
    color: white;
}

@keyframes badgePulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

.rm-product-image-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    height: var(--image-height);
}

.rm-product-image {
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc, #f0f9ff);
    position: relative;
    transition: all 0.8s ease;
}

.rm-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 50%);
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.rm-product-card:hover .rm-image-overlay {
    opacity: 0.7;
}

.rm-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
    z-index: 1;
    padding: 20px;
    transform: scale(1);
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.05));
}

.rm-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95) translateY(8px);
    transition: var(--transition);
    padding: 20px;
    filter: drop-shadow(0 8px 15px rgba(0,0,0,0.1));
}

.rm-product-card:hover .rm-main-image {
    opacity: 0;
    transform: scale(1.03);
}

.rm-product-card:hover .rm-hover-image {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.rm-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 2.2rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
}

.rm-product-info {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(0,0,0,0.03);
    min-height: 0;
}

.rm-product-header {
    margin-bottom: 12px;
    position: relative;
}

.rm-product-title-link {
    text-decoration: none;
    display: block;
    transition: var(--transition);
    position: relative;
}

.rm-product-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.3;
    transition: var(--transition);
    position: relative;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8em;
    letter-spacing: -0.1px;
}

.rm-product-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    border-radius: 2px;
}

.rm-product-title-link:hover .rm-product-title {
    color: var(--primary);
}

.rm-product-title-link:hover .rm-product-title::after {
    width: 100%;
}

.rm-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.stars {
    color: var(--warning);
    position: relative;
    font-size: 0.85rem;
    display: inline-flex;
}

.stars::before {
    content: '\f005 \f005 \f005 \f005 \f005';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #e2e8f0;
    letter-spacing: 1px;
}

.stars i {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}

.rm-product-description {
    color: var(--text-medium);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
    position: relative;
    padding-bottom: 8px;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 4.5em;
}

.rm-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.rm-price-container {
    display: flex;
    flex-direction: column;
}

.rm-product-price {
    font-weight: 800;
    color: var(--text-dark);
    font-size: 1.25rem;
    line-height: 1.1;
    letter-spacing: -0.3px;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    padding-right: 3px;
}

.rm-product-old-price {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.85rem;
    text-decoration: line-through;
    margin-top: 1px;
}

.rm-discount-save {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 700;
    margin-top: 3px;
    padding: 3px 8px;
    background: rgba(6, 214, 160, 0.1);
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
    border: 1px dashed rgba(6, 214, 160, 0.2);
}

/* Измененная кнопка: уменьшена ширина и удалена иконка */
.rm-product-cart-btn {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    color: white;
    border: none;
    padding: 10px 18px; /* Уменьшен горизонтальный padding */
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    min-width: 102px; /* Уменьшено на 15% (120px * 0.85) */
    height: 40px;
    z-index: 2;
    white-space: nowrap; /* Предотвращает перенос текста */
}

.rm-product-cart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 60%, #ec4899 100%);
}

.rm-product-cart-btn:active {
    transform: translateY(0);
}

.rm-product-cart-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20px;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(25deg);
    transition: all 0.6s;
}

.rm-product-cart-btn:hover::after {
    left: 120%;
}

.rm-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-medium);
    background: var(--gray-light);
    border-radius: var(--border-radius);
    margin-top: 20px;
    box-shadow: var(--shadow-md);
    border: 2px dashed #cbd5e1;
    animation: fadeIn 0.8s ease;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc, #f0f9ff);
}

.rm-no-products::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.05) 0%, transparent 70%);
    z-index: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.rm-no-products i {
    color: #e2e8f0;
    margin-bottom: 20px;
    font-size: 3rem;
    position: relative;
    z-index: 1;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.rm-no-products h4 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: var(--text-dark);
    position: relative;
    z-index: 1;
    font-weight: 700;
}

.rm-no-products p {
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text-medium);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.rm-product-card {
    animation: cardAppear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
}

.rm-product-card:nth-child(1) { animation-delay: 0.1s; }
.rm-product-card:nth-child(2) { animation-delay: 0.2s; }
.rm-product-card:nth-child(3) { animation-delay: 0.3s; }
.rm-product-card:nth-child(4) { animation-delay: 0.4s; }
.rm-product-card:nth-child(5) { animation-delay: 0.5s; }
.rm-product-card:nth-child(6) { animation-delay: 0.6s; }
.rm-product-card:nth-child(7) { animation-delay: 0.7s; }
.rm-product-card:nth-child(8) { animation-delay: 0.8s; }

@media (max-width: 1400px) {
    .rm-products-grid {
        padding-right: 380px;
    }
}

@media (max-width: 1200px) {
    .rm-products-grid {
        grid-template-columns: repeat(3, minmax(240px, 1fr));
        gap: 25px;
        max-width: 780px;
        padding-right: 350px;
    }
}

@media (max-width: 1100px) {
    .rm-products-grid {
        max-width: 720px;
        padding-right: 320px;
    }
}

@media (max-width: 992px) {
    .rm-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
        max-width: none;
        padding-right: 0;
        justify-content: flex-start;
    }
    
    .rm-product-image-link {
        height: 180px;
    }
    
    .rm-product-title {
        font-size: 1.05rem;
    }
    
    .rm-product-price {
        font-size: 1.15rem;
    }
    
    :root {
        --card-height: 440px;
        --image-height: 180px;
    }
}

@media (max-width: 768px) {
    .rm-products-container {
        padding-top: 0;
    }
    
    .rm-product-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .rm-product-cart-btn {
        width: 100%;
        margin-top: 10px;
    }
    
    #quickViewModal .modal-dialog {
        margin: 1rem;
    }
    
    #quickViewModal .row {
        flex-direction: column;
    }
    
    :root {
        --card-height: 420px;
        --image-height: 170px;
    }
}

@media (max-width: 576px) {
    .rm-products-grid {
        gap: 20px;
    }
    
    .rm-product-image-link {
        height: 160px;
    }
    
    .rm-product-title {
        font-size: 1rem;
    }
    
    .rm-product-price {
        font-size: 1.15rem;
    }
    
    .rm-product-cart-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .rm-no-products h4 {
        font-size: 1.4rem;
    }
    
    .rm-no-products p {
        font-size: 0.95rem;
    }
    
    .rm-no-products {
        padding: 45px 15px;
    }
    
    :root {
        --card-height: 400px;
        --image-height: 150px;
    }
}
