/* ОбщепитТранс — Custom Styles */

/* CLS Prevention: reserve space for images */
img {
    max-width: 100%;
    height: auto;
}

.hero-section {
    contain: layout style paint;
}

.product-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.12) !important;
}

.product-img-wrap {
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.product-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.add-to-cart-btn {
    transition: background-color 0.2s;
}

.add-to-cart-btn.added {
    background-color: #198754;
    border-color: #198754;
}

#searchResults {
    max-height: 320px;
    overflow-y: auto;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: #212529;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.search-item:hover {
    background: #f8f9fa;
}

.search-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
}

.search-item .search-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    margin-right: 12px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better table on mobile */
@media (max-width: 768px) {
    .product-img-wrap {
        height: 140px;
    }
    .product-img {
        height: 140px;
    }
}

/* Toast notification for cart */
.cart-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Reduce motion for accessibility and performance */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .product-card {
        transition: none;
    }
    .cart-toast {
        animation: none;
    }
    .hero-section {
        background-attachment: scroll;
    }
}
