.ui-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.ui-modal.hidden {
    display: none;
}

.ui-modal-content {
    width: 450px;
    max-width: 100%;
    background: #fffaf6;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    scrollbar-width: thin;
}

/* ================= SECTIONS ================= */

.popup-section {
    padding: 0.75rem 1rem;
}

.popup-section:not(:last-child) {
    border-bottom: 1px solid rgb(231, 224, 218);
}

/* ================= HEADER ================= */

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
    font-family: var(--font-playfair);
    margin: 0;
}

.popup-header .close-modal {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
}

/* ================= PRODUCT INFO ================= */

.product-info {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.product-info img {
    max-width: 5rem;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.75rem;
    object-fit: cover;
}

.product-info h5 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.product-info p {
    font-size: 0.875rem;
    line-height: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 400;
    color: var(--light-theme-color);
}

.product-info .single.pieces {
    margin-bottom: 0;
    font-weight: 400;
}

/* ================= SIZE OPTIONS ================= */

.size-section .title {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    font-family: var(--font-playfair);
    margin-bottom: 0.75rem;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 10px;
    place-content: center;
}

.size-box {
    border: 1px solid rgb(231, 224, 218);
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 400;
    transition: all 0.3s ease;
}

.size-box:hover {
    border-color: rgb(132, 106, 98);
}

.size-box .pcs {
    font-size: 0.625rem;
    line-height: 1rem;
    font-weight: 400;
    color: rgb(48, 33, 29);
}

.size-box .price {
    font-size: 1rem;
    line-height: 1.25rem;
    font-weight: 600;
    color: var(--light-theme-color);
}

.size-box .content>strong {
    font-size: 0.875rem;
    line-height: 1.125rem;
    font-weight: 500;
    display: inline-block;
}

.size-box .delivery-text {
    color: rgb(48, 33, 29);
    font-size: 0.75rem;
    line-height: 1.25rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
}

.single.pieces,
.size-box .pieces {
    display: inline-block;
    font-size: 0.75rem;
    line-height: 1.25rem;
    color: rgb(132, 106, 98);
    margin-bottom: 0.5rem;
    background-color: rgb(246, 242, 238);
    padding: 0.25rem 0.5rem;
    border-radius: 0.75rem;
}

.size-box .delivery-text svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #000;
}

/* .size-box.active {
    border-color: var(--light-theme-color);
    background: rgba(207, 50, 32, 0.05);
    position: relative;
}

.size-box.active::after {
    content: "\f00c";
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(40%, -40%);
    background: var(--light-theme-color);
    color: #fff;
    font-size: 11px;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
} */

/* ================= MARINADE OPTIONS ================= */
.marinade-section {
    max-height: 20rem;
    overflow-y: auto;
    scrollbar-width: thin;
     -webkit-overflow-scrolling: touch;
         max-height: 90vh;
}

.marinade-section .title {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    font-family: var(--font-playfair);
    margin-bottom: 0.75rem;
}

.marinade-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.marinade-row {
    border: 1px solid rgb(231, 224, 218);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.marinade-row:hover {
    border-color: rgb(132, 106, 98);
}

.marinade-row span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.marinade-row span.name {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
    color: rgb(48, 33, 29);
}

.marinade-row span.price {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 400;
    color: rgb(132, 106, 98);
}

.marinade-row input {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid rgb(132, 106, 98);
    position: relative;
    background: #fff;
}

.marinade-row input:checked {
    border-color: var(--light-theme-color);
    background: var(--light-theme-color);
}

.marinade-row input:checked::after {
    content: "\f00c";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    font-family: "Font Awesome 6 Free";
    line-height: 1;
}

.marinade-row:has(input:checked) {
    border-color: var(--light-theme-color);
    background: #fff0eb;
}

/* ================= FOOTER ================= */
.popup-footer {
    position: sticky;
    bottom: 0;
    background-color: rgba(246, 242, 238, 1);
}

.popup-footer .title {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    margin-bottom: 0;
}

.popup-footer .qtys {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.qty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #fff;
    border: 1px solid rgb(231, 224, 218);
    border-radius: 0.75rem;
    padding: 0.25rem;
    /* Safari fixes */
    width: fit-content;
    overflow: hidden;
    flex-wrap: nowrap;
}

.qty button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    max-width: 2rem;
    width: 100%;
    /* flex: 0 0 2rem; */
    border-radius: 0.5rem;
    transition: 0.3s ease-in-out;
    flex: 0 0 auto;
}

.qty button:hover {
    background-color: rgb(239, 235, 231);
}

.qty button i {
    font-size: 1rem;
    line-height: 1rem;
    color: rgb(48, 33, 29);
}

.qty span {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.5rem;
    color: rgb(48, 33, 29);
     -webkit-appearance: none;
        appearance: none;
        width: 4rem;
}

/* ================= ADD TO CART ================= */

.add-btn {
    width: 100%;
    background: var(--light-theme-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.add-btn:not(:disabled):hover {
    background: rgba(207, 50, 32, 0.9);
}

.repeat-action-footer {
    padding: 1rem;
}

.repeat-action-footer .add-btn {
    width: 100%;
    color: #fff;
    background-color: var(--light-theme-color);
    border: 1px solid rgb(231, 224, 218);
    font-weight: 600;
}

.repeat-action-footer .repeat {
    width: 100%;
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-weight: 400;
    background-color: rgba(107, 180, 34, 0.8);
    color: #fff;
    border: 1px solid rgb(231, 224, 218);
}

.repeat-action-footer .repeat:hover {
    background-color: var(--green);    
}

@media only screen and (max-width: 768px) {
    .ui-modal-content {
        max-width: calc(100% - 2rem);
        width: 100%;
        margin-inline: auto;
    }

    .product-weight .size-box .size-static-small {
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
    }

    .product-info img {
        max-width: 3.5rem;
    }

    .size-static-small {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
}