@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 */
.popup {
    background: #fff;
    width: 100%;
    max-width: 850px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    max-height: 100%;
    font-family: "Poppins", serif;
}

/* Popup iç container */
.popup-container {
    display: flex;
    flex-direction: column;
    padding: 20px 30px;
    overflow-y: auto;
    border-radius: 12px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Header ve içerikler */
.popup-header {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-between;
}

.popup-image {
    width: 100%;
    max-width: 280px;
    border-radius: 12px;
    object-fit: cover;
}

.popup-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.close-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #666;
    cursor: pointer;
}

/* Body alanı */
.popup-body {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 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 */
.order-ingredient-select-container,
.menu-options {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.select-ingredient,
.menu-item {
    font-size: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px;
    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 */
.popup-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.order-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #000;
}

.order-add {
    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;
}

.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: "Bu ürün için açıklama bulunmamaktadır.";
    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: 250px;}

#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;
    }
}
