/**
 * Modals - Modalni prozori
 */

/* ==========================================
   MODAL BACKDROP
   ========================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.is-open {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   MODAL CONTENT
   ========================================== */
.modal__content {
    background: var(--gradient-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.modal.is-open .modal__content {
    transform: scale(1) translateY(0);
}

.modal__content--lg {
    max-width: 700px;
}

.modal__content--xl {
    max-width: 900px;
}

.modal__content--fullscreen {
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 0;
}

/* ==========================================
   MODAL HEADER
   ========================================== */
.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, transparent 50%);
}

.modal__title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal__title i {
    color: var(--primary);
}

.modal__close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal__close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    transform: rotate(90deg);
}

/* ==========================================
   MODAL BODY
   ========================================== */
.modal__body {
    padding: 24px;
    max-height: calc(90vh - 150px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal__body::-webkit-scrollbar {
    width: 6px;
}

.modal__body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.modal__body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.modal__body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==========================================
   MODAL FOOTER
   ========================================== */
.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(10, 10, 15, 0.5);
}

/* ==========================================
   PRODUCT MODAL (za izbor priloga)
   ========================================== */
.product-modal__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.product-modal__info {
    margin-bottom: 24px;
}

.product-modal__name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-modal__desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.product-modal__price {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-modal__addons {
    margin-bottom: 24px;
}

.product-modal__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.product-modal__total-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.product-modal__total-price {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   CONFIRMATION MODAL
   ========================================== */
.confirm-modal__icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.confirm-modal__icon--warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.confirm-modal__icon--danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.confirm-modal__icon--success {
    background: var(--success-bg);
    color: var(--success);
}

.confirm-modal__text {
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================
   RESPONSIVE MODALS
   ========================================== */
@media (max-width: 768px) {
    .modal {
        padding: 12px;
        align-items: flex-end;
    }
    
    .modal__content {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        margin-bottom: 0;
    }
    
    .modal__content--lg,
    .modal__content--xl {
        max-width: 100%;
    }
    
    .modal__header {
        padding: 16px 18px;
    }
    
    .modal__title {
        font-size: 1.1rem;
        gap: 10px;
    }
    
    .modal__title i {
        font-size: 1rem;
    }
    
    .modal__close {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .modal__body {
        padding: 18px;
        max-height: calc(90vh - 130px);
    }
    
    .modal__footer {
        padding: 14px 18px;
        gap: 10px;
    }
    
    .modal__footer .btn {
        flex: 1;
        min-width: 0;
    }
    
    /* Product modal */
    .product-modal__image {
        height: 160px;
        margin-bottom: 16px;
    }
    
    .product-modal__name {
        font-size: 1.25rem;
    }
    
    .product-modal__desc {
        font-size: 0.9rem;
    }
    
    .product-modal__price {
        font-size: 1.3rem;
    }
    
    .product-modal__total {
        padding: 14px 16px;
    }
    
    .product-modal__total-price {
        font-size: 1.3rem;
    }
    
    /* Confirm modal */
    .confirm-modal__icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
        margin-bottom: 16px;
    }
    
    .confirm-modal__text {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .modal__header {
        padding: 14px 16px;
    }
    
    .modal__body {
        padding: 16px;
    }
    
    .modal__footer {
        padding: 12px 16px;
        flex-direction: column;
    }
    
    .modal__footer .btn {
        width: 100%;
    }
}
