/* تصميم المنيو كمعرض أفقي مع أقسام الفئات */

/* حاوية المنيو الرئيسية */
#menuContainer {
    display: flex;
    flex-direction: column;
    gap: 50px;
    padding: 20px 0;
}

/* قسم الفئة */
.category-section {
    width: 100%;
}

/* رأس الفئة */
.category-header {
    margin-bottom: 25px;
    position: relative;
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.category-title-wrapper i {
    font-size: 1.8rem;
    color: var(--primary-color);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(195, 33, 44, 0.1), rgba(195, 33, 44, 0.05));
    border-radius: 12px;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: -0.02em;
}

.category-count {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.category-line {
    height: 3px;
    background: linear-gradient(to left, transparent, var(--primary-color) 30%, var(--secondary-color) 60%, transparent);
    border-radius: 2px;
    opacity: 0.45;
}

/* معرض الأصناف الأفقي */
.category-items-gallery,
.items-gallery-single {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 5px 20px 5px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f0f0f0;
}

/* تخصيص شريط التمرير */
.category-items-gallery::-webkit-scrollbar,
.items-gallery-single::-webkit-scrollbar {
    height: 8px;
}

.category-items-gallery::-webkit-scrollbar-track,
.items-gallery-single::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.category-items-gallery::-webkit-scrollbar-thumb,
.items-gallery-single::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.category-items-gallery::-webkit-scrollbar-thumb:hover,
.items-gallery-single::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* بطاقة الصنف */
.menu-item-card {
    flex: 0 0 280px;
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.menu-item-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 45px rgba(195, 33, 44, 0.18), 0 0 0 2px rgba(195,33,44,0.12);
}

/* صورة الصنف */
.item-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.item-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.item-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 70px;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    pointer-events: none;
    z-index: 1;
}

.menu-item-card:hover .item-image-wrapper img {
    transform: scale(1.12);
}

/* شارة الأكثر طلباً */
.popular-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* معلومات الصنف */
.item-info-wrapper {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.item-desc {
    font-size: 0.9rem;
    color: var(--light-text);
    line-height: 1.6;
    margin: 0;
    min-height: 3.2em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* تذييل البطاقة */
.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.item-price-tag {
    font-size: 1.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #C3212C 0%, #8B0000 50%, #C3212C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 4px rgba(195, 33, 44, 0.15);
    position: relative;
    padding: 4px 12px;
    border-radius: 8px;
    background-color: rgba(195, 33, 44, 0.05);
    background-image: linear-gradient(135deg, #C3212C 0%, #8B0000 50%, #C3212C 100%);
    -webkit-background-clip: text;
    background-clip: text;
    animation: priceGlow 3s ease-in-out infinite;
}

@keyframes priceGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

/* زر الإضافة للعربة */
.add-to-cart-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(195, 33, 44, 0.32);
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.add-to-cart-btn:hover::before { opacity: 1; }

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(195, 33, 44, 0.45);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn i {
    font-size: 1rem;
}

/* عرض واحد للفئة المختارة */
.items-gallery-single {
    flex-wrap: wrap;
}

.items-gallery-single .menu-item-card {
    flex: 0 0 calc(25% - 15px);
    min-width: 250px;
}

/* الاستجابة للشاشات المختلفة */
@media (max-width: 1400px) {
    .items-gallery-single .menu-item-card {
        flex: 0 0 calc(33.333% - 14px);
    }
}

@media (max-width: 1024px) {
    .menu-item-card {
        flex: 0 0 260px;
    }
    
    .items-gallery-single .menu-item-card {
        flex: 0 0 calc(50% - 10px);
    }
    
    .category-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    #menuContainer {
        gap: 35px;
    }
    
    .menu-item-card {
        flex: 0 0 240px;
    }
    
    .items-gallery-single .menu-item-card {
        flex: 0 0 100%;
    }
    
    .category-title {
        font-size: 1.3rem;
    }
    
    .category-title-wrapper i {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }
    
    .item-image-wrapper {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .menu-item-card {
        flex: 0 0 220px;
    }
    
    .item-name {
        font-size: 1rem;
    }
    
    .item-desc {
        font-size: 0.8rem;
    }
    
    .item-price-tag {
        font-size: 1rem;
    }
    
    .add-to-cart-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* رسالة عدم وجود نتائج */
.no-items {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-items i {
    font-size: 3.5rem;
    color: #ddd;
    margin-bottom: 20px;
    opacity: 0.6;
}

.no-items h3 {
    color: var(--light-text);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.no-items p {
    color: #999;
    font-size: 0.95rem;
}

/* ============================================ */
/* نافذة تفاصيل الصنف */
/* ============================================ */

.item-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.item-detail-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10001;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: rotate(90deg);
}

.modal-body {
    display: flex;
    overflow-y: auto;
    max-height: 90vh;
}

.modal-image-section {
    flex: 0 0 45%;
    position: relative;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}

.modal-image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-popular-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
}

.modal-info-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.modal-category {
    display: inline-block;
    background: linear-gradient(135deg, rgba(195, 33, 44, 0.1), rgba(195, 33, 44, 0.05));
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--light-text);
    margin: 0;
}

.modal-price-section {
    background: linear-gradient(135deg, rgba(195, 33, 44, 0.1), rgba(139, 0, 0, 0.05));
    padding: 30px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(195, 33, 44, 0.15);
    box-shadow: 0 8px 20px rgba(195, 33, 44, 0.1);
}

.modal-price-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #C3212C 0%, #FFD700 50%, #C3212C 100%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.modal-price-label {
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-price-label::before {
    content: '💰';
    font-size: 1.2rem;
}

.modal-price {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #C3212C 0%, #8B0000 30%, #FFD700 50%, #8B0000 70%, #C3212C 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.03em;
    text-shadow: 0 4px 8px rgba(195, 33, 44, 0.2);
    animation: gradientShift 4s ease-in-out infinite;
    line-height: 1.2;
    position: relative;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

.modal-actions {
    margin-top: auto;
}

.modal-add-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    padding: 18px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(195, 33, 44, 0.4);
}

.modal-add-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(195, 33, 44, 0.5);
}

.modal-add-btn:active {
    transform: translateY(0);
}

.modal-add-btn i {
    font-size: 1.3rem;
}

/* الاستجابة */
@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
    }
    
    .modal-image-section {
        flex: 0 0 300px;
        min-height: 300px;
    }
    
    .modal-info-section {
        padding: 30px 24px;
    }
    
    .modal-header h2 {
        font-size: 1.6rem;
    }
    
    .modal-description {
        font-size: 0.95rem;
    }
    
    .modal-price {
        font-size: 1.8rem;
    }
    
    .modal-add-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .item-detail-modal {
        padding: 10px;
    }
    
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-image-section {
        flex: 0 0 250px;
        min-height: 250px;
    }
    
    .modal-info-section {
        padding: 24px 20px;
        gap: 18px;
    }
    
    .modal-header h2 {
        font-size: 1.4rem;
    }
    
    .modal-close {
        top: 15px;
        left: 15px;
        width: 35px;
        height: 35px;
    }
}
