/* Sandwich Modal Styles */
#sandwich-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

#sandwich-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.sandwich-modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.sandwich-modal-header {
    padding: 2rem;
    border-bottom: 2px solid var(--primary-dark);
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.sandwich-modal-header h2 {
    margin: 0;
    color: var(--white);
    font-size: 1.8rem;
}

.sandwich-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--white);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.sandwich-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.sandwich-modal-body {
    padding: 2rem;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* Custom Name Section */
.sandwich-custom-name-section {
    margin-bottom: 2rem;
}

.sandwich-custom-name-section h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-size: 1.2rem;
}

.sandwich-custom-name-section input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.sandwich-custom-name-section input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Ingredientes Section */
.sandwich-ingredientes-section {
    margin-bottom: 2rem;
}

.sandwich-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sandwich-section-header h3 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.2rem;
}

#sandwich-counter {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border-radius: 20px;
}

.ingredientes-group {
    margin-bottom: 2rem;
}

.ingredientes-group h4 {
    margin-bottom: 1rem;
    color: #666;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ingredientes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.sandwich-ingrediente-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sandwich-ingrediente-card:hover {
    border-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.05);
    transform: translateY(-2px);
}

.sandwich-ingrediente-card.selected {
    border-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.1);
}

.sandwich-ingrediente-info {
    flex: 1;
}

.sandwich-ingrediente-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.sandwich-ingrediente-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.sandwich-ingrediente-price.free {
    color: var(--success-color);
}

.sandwich-ingrediente-check {
    width: 30px;
    height: 30px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    background: white;
    transition: all 0.3s;
}

.sandwich-ingrediente-card.selected .sandwich-ingrediente-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Observacao Section */
.sandwich-observacao-section {
    margin-bottom: 2rem;
}

.sandwich-observacao-section h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-size: 1.2rem;
}

.sandwich-observacao-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    resize: vertical;
    min-height: 80px;
    transition: all 0.3s;
}

.sandwich-observacao-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Modal Footer */
.sandwich-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border-radius: 0 0 20px 20px;
}

.sandwich-total {
    display: flex;
    flex-direction: column;
}

.sandwich-total-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.sandwich-total-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.sandwich-modal-actions {
    display: flex;
    gap: 1rem;
}

.btn-cancel-sandwich,
.btn-add-sandwich {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel-sandwich {
    background: #e0e0e0;
    color: #666;
}

.btn-cancel-sandwich:hover {
    background: #d0d0d0;
}

.btn-add-sandwich {
    background: var(--success-color);
    color: white;
}

.btn-add-sandwich:hover {
    background: #229954;
    transform: scale(1.05);
}

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

/* Responsive */
@media (max-width: 768px) {
    #sandwich-modal {
        left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        padding: 10px;
    }
    
    .sandwich-modal-content {
        margin: 10px auto;
    }
    
    .sandwich-modal-header {
        padding: 1.5rem;
    }
    
    .sandwich-modal-header h2 {
        font-size: 1.4rem;
    }
    
    .sandwich-modal-body {
        padding: 1.5rem;
        max-height: calc(100vh - 250px);
    }
    
    .ingredientes-grid {
        grid-template-columns: 1fr;
    }
    
    .sandwich-modal-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .sandwich-total {
        width: 100%;
        text-align: center;
    }
    
    .sandwich-modal-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-cancel-sandwich,
    .btn-add-sandwich {
        width: 100%;
    }
}
