@import url('./constants.css');

/* Popup başlangıç kapalı */
#menu-pop, #order-pop, #menu-edit-pop {
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.95);
}

/* Aktif olunca aç */
#menu-pop.active, #order-pop.active,#menu-edit-pop.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 99999;
    font-family: "Poppins", serif;
    padding: 20px;
    box-sizing: border-box;
}

/* İç popup kutusu - DAHA KÜÇÜK */
.popup {
    background: #fff;
    width: 100%;
    max-width: 40%; /* 850px'den 500px'e düşürüldü */
    border-radius: 12px; /* 16px'den 12px'e düşürüldü */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); /* Daha hafif gölge */
    max-height: 90%; /* 100%'den 90%'a düşürüldü */
    font-family: "Poppins", serif;
}

/* Popup iç container - DAHA KOMPAKT */
.popup-container {
    display: flex;
    flex-direction: column;
    padding: 16px 20px; /* 20px 30px'den 16px 20px'e düşürüldü */
    overflow-y: auto;
    border-radius: 12px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Header ve içerikler - DAHA KOMPAKT */
.popup-header {
    display: flex;
    gap: 15px; /* 20px'den 15px'e düşürüldü */
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-between;
}

.popup-image {
    width: 100%;
    max-width: 200px; /* 280px'den 200px'e düşürüldü */
    height: 150px; /* Sabit yükseklik eklendi */
    border-radius: 8px; /* 12px'den 8px'e düşürüldü */
    object-fit: cover;
}

.popup-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
}

.popup-title {
    font-size: 1.2rem; /* 1.5rem'den 1.2rem'e düşürüldü */
    font-weight: 600;
    color: #333;
    margin-bottom: 8px; /* 10px'den 8px'e düşürüldü */
}

.close-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #666;
    cursor: pointer;
}

/* Body alanı - DAHA KOMPAKT */
.popup-body {
    margin-top: 15px; /* 20px'den 15px'e düşürüldü */
    display: flex;
    flex-direction: column;
    gap: 16px; /* 24px'den 16px'e düşürüldü */
}

/* Sections */
.popup-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-title {
    font-weight: 600;
    font-size: 1rem;
    color: #444;
}

.section-desc {
    font-size: 0.8rem;
    color: #666;
}

/* Description list */
.order-description ul {
    padding-left: 16px;
    font-size: 0.8rem;
    color: #444;
    margin: 0;
}

/* Malzemeler - DAHA KOMPAKT */
.order-ingredient-select-container,
.menu-options {
    display: grid;
    gap: 6px; /* 8px'den 6px'e düşürüldü */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* 120px'den 100px'e düşürüldü */
}

.select-ingredient,
.menu-item {
    font-size: 0.75rem; /* 0.8rem'den 0.75rem'e düşürüldü */
    border: 1px solid #ccc;
    border-radius: 6px; /* 8px'den 6px'e düşürüldü */
    padding: 6px; /* 8px'den 6px'e düşürüldü */
    background-color: #f9f9f9;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.select-ingredient.selected {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
    text-decoration: line-through;
}

.menu-item input {
    margin-right: 6px;
}

.menu-item span {
    font-size: 0.75rem;
    color: #28a745;
    font-weight: 600;
}

/* Footer - DAHA KOMPAKT */
.popup-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px; /* 20px'den 15px'e düşürüldü */
    gap: 15px; /* 20px'den 15px'e düşürüldü */
    flex-wrap: wrap;
}

.order-price {
    font-size: 1.1rem; /* 1.2rem'den 1.1rem'e düşürüldü */
    font-weight: 700;
    color: #000;
}

.order-add {
    background: white;
    border: 2px solid #28a745;
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem; /* 1rem'den 0.9rem'e düşürüldü */
    padding: 8px 16px; /* 10px 20px'den 8px 16px'e düşürüldü */
    border-radius: 6px; /* 8px'den 6px'e düşürüldü */
    transition: 0.3s ease;
    cursor: pointer;
}

.order-add:hover {
    background-color: #28a745;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .popup-container {
        padding: 16px;
    }

    .popup-header {
        flex-direction: column;
        align-items: center;
    }

    .popup-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .order-add {
        width: 100%;
    }

    .order-price {
        width: 100%;
        text-align: center;
    }
}

/* Boş içerik gizleme */
.order-description:empty::before {
    content: attr(data-empty-text);
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    padding-top: 16px;
    display: block;
}

.order-ingredient-select-container:empty,
.menu-options:empty,
.order-ingredient,
.order-ingredient-description {
    display: none !important;
}

/* Güncelleme butonu */
.update-button {
    background: white;
    border: 2px solid #28a745;
    color: #28a745;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 8px;
    transition: 0.3s ease;
    cursor: pointer;
}

.update-button:hover {
    background-color: #28a745;
    color: white;
}
.edit-cart-item{


    font-weight: 400;
    font-size: 1.1rem;

    transition: 0.3s ease;
    cursor: pointer;
}

/*menü edit*/

#menu-edit-pop .popup-content {
    display: flex;
    flex-direction: row;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 24px;
    gap: 16px;
}

#menu-edit-pop .menu-image {
    width: 200px;
    height: 260px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

#menu-edit-pop .popup-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#menu-edit-pop .popup-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

#menu-edit-pop .menu-description {
    color: #777;
    font-size: 13px;
    margin-bottom: 16px;
}

#menu-edit-pop .edit-submenus-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#menu-edit-pop .submenu-group label {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
    display: block;
}

#menu-edit-pop .form-select {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    background-color: #f9f9f9;
}
#menu-edit-pop .popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

#menu-edit-pop .popup-total-price {
    font-size: 16px;
    font-weight: 600;
    color: #28a745;
    margin: 0;
}

#menu-edit-pop #update-menu-cart {
    position: relative!important;
    top: 0!important;
    left: 0!important;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    background-color: #28a745;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

#menu-edit-pop #update-menu-cart:hover {
    background-color: #218838;
}


#menu-edit-pop .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 18px;
    background: #eee;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    text-align: center;
    line-height: 28px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#menu-edit-pop .close-btn:hover {
    background: #ccc;
}
#menu-edit-pop .popup-content{
    height: 330px;}

#menu-edit-pop.popup-wrapper {
    z-index: 1000; /* Swal default'u 1060 üstü, bu yüzden daha düşük olmalı */
}

.swal-custom-z {
    z-index: 99999 !important;
}



/*menü detail*/
.menu-pop-footer{flex-direction: row!important;}

@media (max-width: 540px) {
    #menu-edit-pop .popup-content {
        flex-direction: column;
        height: 50%;
        overflow-y: auto;
    }

    #menu-edit-pop .menu-image {
        width: 100%;
        height: 140px;
    }

    #menu-edit-pop .popup-right {
        margin-top: 16px;
    }
}
