/**
 * African-themed Menu Styling for Beck's Kitchen
 */

/* Menu Section Container */
.menu {
    position: relative;
    padding: 80px 0;
    background-color: #FFF8E1;
    background-image: url('../images/menu-bg-pattern.svg');
    background-size: 200px;
    background-repeat: repeat;
    background-attachment: fixed;
    position: relative;
}

/* Menu Header */
.menu .section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--pattern-dark);
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 40px;
}

.menu .section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background-image: linear-gradient(
        to right,
        var(--pattern-primary),
        var(--pattern-accent),
        var(--pattern-secondary)
    );
    border-radius: 5px;
}

/* Menu Categories */
.menu-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
    position: relative;
}

.menu-categories::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        var(--pattern-dark),
        var(--pattern-dark) 5px,
        transparent 5px,
        transparent 15px
    );
    opacity: 0.2;
    z-index: 0;
}

.category-btn {
    background-color: var(--pattern-light);
    color: var(--pattern-dark);
    border: 2px solid var(--pattern-secondary);
    padding: 10px 20px;
    margin: 0 8px 10px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/category-btn-pattern.svg');
    background-size: 50px;
    background-repeat: repeat;
    opacity: 0.05;
    border-radius: 30px;
    z-index: -1;
}

.category-btn:hover, .category-btn.active {
    background-color: var(--pattern-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

/* Menu Items Container */
.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Menu Filtering Animation */
.menu.filtering {
    position: relative;
}

.menu.filtering::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    z-index: 1;
    pointer-events: none;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Individual Menu Item */
.menu-item {
    background-color: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 1;
    transform: translateY(0);
    display: flex;
    flex-direction: column;
}

/* Menu Item Filtering States */
.menu-item.filtering {
    transition: all 0.3s ease-out;
}

.menu-item.hidden {
    opacity: 0;
    transform: translateY(20px);
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    z-index: -1;
}

.menu-item.visible {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    animation: fadeIn 0.5s ease-out;
}

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

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background-image: linear-gradient(
        to right,
        var(--pattern-primary),
        var(--pattern-accent)
    );
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.item-img {
    height: 200px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transition: transform 0.5s ease;
    display: block;
    max-width: 100%;
}

.menu-item:hover .item-img img {
    transform: scale(1.05);
}

/* Fix for images that might be too tall or wide */
.item-img img[src*="placehold.co"] {
    object-position: center;
    object-fit: contain;
    padding: 10px;
}

/* Ensure proper aspect ratio for dish images */
.dish-img {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.dish-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.item-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background-image: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.5),
        transparent
    );
    opacity: 0.7;
}

.item-details {
    padding: 20px;
    position: relative;
}

.item-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15px;
    right: 15px;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        var(--pattern-dark),
        var(--pattern-dark) 3px,
        transparent 3px,
        transparent 8px
    );
    opacity: 0.2;
}

.item-details h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--pattern-dark);
    font-weight: 600;
    position: relative;
    padding-left: 15px;
}

.item-details h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: var(--pattern-primary);
    border-radius: 50%;
}

.description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.price {
    font-weight: 700;
    font-size: 18px;
    color: var(--pattern-secondary);
    position: relative;
    padding-left: 20px;
}

.price::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    background-image: url('../images/african-coin.svg');
    background-size: contain;
    background-repeat: no-repeat;
}

.add-to-cart-btn {
    background-color: var(--pattern-primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.add-to-cart-btn::before {
    content: '+';
    margin-right: 5px;
    font-size: 16px;
    font-weight: 700;
}

.add-to-cart-btn:hover {
    background-color: var(--pattern-secondary);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Dish Type Badge */
.dish-type {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--pattern-dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dish-type.spicy::after {
    content: '🌶️';
    margin-left: 3px;
}

.dish-type.vegetarian {
    background-color: rgba(76, 175, 80, 0.9);
    color: white;
}

.dish-type.vegetarian::after {
    content: '🌱';
    margin-left: 3px;
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: -10px;
    left: 20px;
    background-color: var(--pattern-accent);
    color: white;
    padding: 5px 15px;
    border-radius: 0 0 10px 10px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-30%);
    opacity: 0;
    transition: all 0.3s ease;
}

.menu-item.featured .featured-badge {
    transform: translateY(0);
    opacity: 1;
}

.featured-badge::before,
.featured-badge::after {
    content: '★';
    margin: 0 5px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .menu-items {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .item-details h3 {
        font-size: 18px;
    }
    
    .description {
        font-size: 13px;
    }
    
    .price {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .menu-items {
        grid-template-columns: 1fr;
    }
    
    .category-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
}
